Andrea incorporated Igor Proxy warning + bdwrite appimage
[goodguy/cin-manual-latex.git] / parts / Advanced.tex
index 50baadfa70be721c614683c56222fb3e9759804b..d04bd8ae6e2d14883c222cd6629c28e5c010c589 100644 (file)
@@ -7,11 +7,11 @@
 
 Proxies was introduced to allow for a smoother timeline experience. Full HD and everything from 4K size up are usually very large in file size. In addition, some commonly used codecs (e.g. h264/5) are very compressed and interframe type, so they are more stressful for timeline playback. These files cause performance problems on weaker PCs. As a solution the developers have introduced proxies to reduce the file size. Reduced means to minimize the resolution/dimension, as usually not the full resolution is needed, because the compositor usually takes only a fraction of the computer screen. Therefore the scaling factor, which indicates how much the original resolution should be reduced. 
 There is also the \textit{proxy 1:1} \index{proxy!1:1} that maintains the original resolution but still allows you to act on the codec (lowering the bit rate, for example). See also next section: \ref{sec:transcode}.
-When rendering, the original setting will be used to avoid loss of image quality.  
+When we want to render the project, remember to remove the proxy to return to the original settings with the highest quality.  
 
 To use the proxy in a classic way, i.e. as a scaling, select \texttt{Settings $\rightarrow$ Proxy settings} and change the Scale factor from Original size to your downsized choice.  You can choose ffmpeg as the File Format \index{file format} and a choice of various codecs associated with that.  A good choice is the default of mpeg which can usually be quite fast.  In addition, to modify values for that codec, click on the wrench icon.
 
-We can use the \textit{Proxy 1:1} in two ways: setting "1" as \textit{Scale factor}, or check the \textit{Rescaled to project size (FFMPEG only)}  button. In this mode we don't have scaling, i.e. downsize, but only variations of the codec parameters that allow to maintain the original resolution. The advantage is that you can use filters that require the original size to work well. NB: if we set any scaling, by activating the \textit{Rescaled to project size (FFMPEG only)} button we automatically lose scaling and enter Proxy 1:1 mode.
+We can use the \textit{Proxy 1:1} in two ways: setting "1" as \textit{Scale factor}, or check the \textit{Rescaled to project size (FFMPEG only)}  button. In this mode we don't have scaling, i.e. downsize, but only variations of the codec parameters that allow to maintain the original resolution. The advantage is that you can use filters that require the original size to work well. Please note that if we set any scaling, by activating the \textit{Rescaled to project size (FFMPEG only)} button we automatically lose scaling and enter Proxy 1:1 mode. The size of your video is scaled down of the \textit{Scale factor} but, then, it is rescaled up to the project format. For example, your format project is $1920x1080$ and Proxy's Scale factor is $\frac{1}{4}$, then your videos will be scaled down to $480x270$ and then up-scaled to $1920x1080$. For an old computer, this option is not recommended.
 
 When you have completed your choices, just click OK, and then the video tracks will be rendered. This may take some time, but previous proxy renders will be reused.
 
@@ -64,7 +64,7 @@ Quality:      -1
 Pixels:                yuv420p
 \end{lstlisting}
 
-If you get errors for some videos, such as those with strange variable bit rate or some types of files made on a smartphone, an usually reliable alternative is to change the following parameters:
+If you get errors for some videos, such as those with strange variable bit rate or some types of files made on a smartphone, a usually reliable alternative is to change the following parameters:
 
 \begin{lstlisting}[numbers=none]
 File Format:   FFMPEG - mov
@@ -80,6 +80,95 @@ If you get error messages \index{proxy!error} when creating proxies, check the V
 
 More specific information on which plugins need to use \textit{Proxy 1:1}. is provided here next. If the keyframe data uses coordinate data that is absolute, then the Factor scale = 1 should be used.  If the data is normalized (like always $0-100\%$) then the proxy can be done with downsize (i.e. classic \textit{Proxy}).  The session geometry format, shown in \texttt{Settings $\rightarrow$ Format} as $width \times height$, is changed if scale factor $\neq$ 1 is used to cause all of the data to be in the reduced format.  If this affects the plugin operation, then \textit{Proxy 1:1} should be used.  Examples of plugins that need the \textit{Proxy 1:1} are: Title, AutoScale, Scale, ScaleRatio, and Translate.  Most others are safe to use with downsize.
 
+A faster method of creating the proxy file outiside of \CGG{} for users who have
+vaapi hardware acceleration capability on their graphics board is via a script.  Speed
+up could potentially be 10 to 30 times faster depending on the parameter values you choose
+and the size of your video file.  This script is included in the doc subdirectory as 
+vaapi\_proxy.sh for users not using an AppImage version and is shown below.  You will
+have to tune it to your specific needs for the vaapi\_device name (currently set to
+/dev/dri/renderr128), file type (currently set to h264 and mp4), and proxy size (now is 6). 
+Once you have created the proxy file, you then start Cinelerra, load the original un-proxied
+video, use the Settings pulldown and choose the Proxy settings options as you would normally,
+but because you already have created the existing proxy file with the correct name, it will
+be automatically loaded and will not have to create it.  The filename of the proxy file
+must be in the same location as the original video and have the exact required naming
+conventions and scale factor.
+
+\begin{lstlisting}[numbers=none]
+#!/bin/bash
+filename="$1"
+fileout="${filename%.*}"
+proxy="6"
+# Hardware encode AMD
+ffmpeg -threads 2 -hwaccel vaapi  -vaapi_device /dev/dri/renderD128 \
+ -i  "$1" -c:v h264_vaapi -vf "format=nv12,hwupload,scale_vaapi=iw/'$proxy':ih/'$proxy'" \
+ -vcodec h264_vaapi  -preset fast -c:a copy \
+ -bf 0 -profile:v 66 "$fileout".proxy"$proxy"-mp4.mp4
+\end{lstlisting}
+
+\subsection{Proxies with Alpha channel}%
+\label{sub:proxies_alpha_channel}
+
+Next are some examples of tested and working configurations that maintain the alpha channel:
+
+\begin{lstlisting}[numbers=none]
+Proxy #1
+       Scale factor: 1/4
+       Rescaled to project size (FFMPEG only) = unchecked
+       File Format: FFMPEG | qt
+       Video Preset-->
+               Compression: png.qt
+               Bitrate: 0
+               Quality: -1
+               Pixels: rgba (or rgba64be)
+       
+       
+Proxy #2
+       Scale factor: 1/4
+       Rescaled to project size (FFMPEG only) = unchecked
+       File Format: FFMPEG | qt
+       Video Preset-->
+               Compression: magicyuv.qt
+               Bitrate: 0
+               Quality: -1
+               Pixels: yuva444p
+       
+       
+Proxy #3
+       Scale factor: 1/4
+       Rescaled to project size (FFMPEG only) = unchecked
+       File Format: FFMPEG | qt
+       Video Preset-->
+               Compression: openjpeg.qt
+               Bitrate: 0
+               Quality: -1
+               Pixels: yuva420p
+       
+       
+Proxy #4
+       Scale factor: 1/4
+       Rescaled to project size (FFMPEG only) = unchecked
+       File Format: FFMPEG | pro
+       Video Preset-->
+               Compression: prores_4444.pro
+               prores_4444xq.pro
+               Bitrate: 0
+               Quality: -1
+               Pixels: yuva444p10le
+       
+       
+Proxy #5
+       Scale factor: 1/4
+       Rescaled to project size (FFMPEG only) = unchecked
+       File Format: FFMPEG | mkv
+       Video Preset-->
+               Compression: user_ffvhuff.mkv
+               Bitrate: 0
+               Quality: -1
+               Pixels: yuva4--p
+                                  yuva4--p--le
+\end{lstlisting}
+
 \section{Transcode}%
 \label{sec:transcode}
 \index{transcode}
@@ -96,7 +185,7 @@ Multiple stream media will only transcode the first stream (this would be like t
 You will get an error message if you already have a transcoded file in the selected format with the same suffix name and try to transcode it again with a different selection made -- you will have to delete that file first. An example would be
 an already converted file that has both video and audio and now you request video only. 
 
-The BIGGEST gain from using this is if you have media that is not \textit{seekable} \index{seek}, that is, you can play it from the beginning but can not move to another spot and have the audio or video play correctly. A video file with no keyframes makes seeking next to impossible, but then a Transcode generally adds these keyframes. This is particularly useful for the \texttt{mkv} container, which often has seek problems.
+The BIGGEST gain from using this is if you have media that is not \textit{seekable} \index{seek}, that is, you can play it from the beginning but can not move to another spot and have the audio or video play correctly. A video file with no keyframes makes seeking next to impossible, but then a Transcode generally adds these keyframes. This is particularly useful for the \texttt{mkv} container, which often has seek problems. For more details on mkv container see \ref{ssub:note_mkv_container}
 
 Another important function of Transcode is being able to convert the project's media into a high-quality \textit{mezzanine} codec \index{mezzanine codec} (sometimes also called \textit{intermediate} codec \index{digital intermediate}), which makes timeline work lighter and more efficient. In fact such codecs (ffv1, ProRes, DNxHD, OpenEXR, huffyuv, etc) are generally little or not at all compressed; the type of compression is intraframe --more suitable for editing, and the image quality (4:2:2 up; 10-bit color up; floating point; etc) is suitable for \textit{Color Correction}, \textit{Chroma Key} and \textit{Rotoscoping}. The use of mezzanine codecs leads to very large files, so you need to make sure you have enough storage space.
 
@@ -244,7 +333,7 @@ See a real-world workflow at appendix \nameref{sec:workflow_openedl_nested_clips
 It is sometimes handy to have EDL \index{EDL} assets not as a copy, but as a
 reference that is automatically updated into your project.  Suppose
 you have several short videos that at the end have the same credits
-which include the current year such as 2019.  But now it is 2020 and
+which include the current year such as 2021.  But now it is 2022 and
 all of the videos would have to be individually updated with the new
 date.  By including a \textit{Referenced File} as the EDL file type
 when you create each of the videos, you can just change the one
@@ -663,7 +752,7 @@ capability of nesting.
 \index{multi-camera}
 \index{mixers}
 
-Use the Mixer Viewer to see multiple media playing simultaneously in re-sizable mini-viewers.  This can be used in various ways and is useful to edit videos shot by multiple cameras from different viewpoints that were simultaneously recorded in order to create a single good video.  Everything will have to be initially synced so you can decide which one of the camera angles is best suited at any time. 
+Use the Mixer Viewer to see multiple media playing simultaneously in re-sizable mini-viewers.  This can be used in various ways and is useful to edit videos shot by multiple cameras from different viewpoints that were simultaneously recorded in order to create a single good video.  Everything will have to be initially synced so you can decide which one of the camera angles is best suited at any time. Mixer mode does not support audio only tracks but there is a workaround described at \nameref{cha:faq_problems_workarounds}.
 
 The number of cameras/mixers you can have is generally limited to the available resources on your computer.  Currently, the number of File Descriptors available in the OS limits cameras to about 50.  If you have many \textit{mixer viewers} you will probably want to use proxy mode whenever possible.  Also, in the \texttt{Settings $\rightarrow$ Playback A} tab \textit{Video Out} section, uncheck \textit{play every frame} and choosing a Video Driver of \textit{X11} with \textit{use direct X11 render if possible} checked, will provide better performance.
 
@@ -859,7 +948,8 @@ Repeat steps 2 through 7 for each of the mixer viewers you need going down the p
 
 Sometimes the association does not stick initially.  If not, highlight the mixer viewer with the problem, change the mixer arrows to point up, and reassociate.
 
-\section{Audio/Video sync via Waveforms/Timecodes}%
+% For html, make sure using below is different from via in subsection
+\section{Audio/Video sync using Waveforms/Timecodes}%
 \label{sec:audio_video_sync}
 \index{audio/video sync}
 
@@ -1060,7 +1150,7 @@ Operation of Align Timecodes includes the following options to help in your setu
        rate as a time standard.
        \item Time Code Start in the Resources window on the bottom of \textit{Info} for the media if the timecode for that
        asset has been scanned and is known. You can scan the asset’s Timecode by using the middle mouse
-       button on its track which then displays the timecode for that on the timebar.
+       button on its track which then displays the timecode for that on the timebar (\texttt{MMB $\rightarrow$ Timecode}). Or you can use the shortcut \texttt{Ctrl+!}, after selecting the edit/track on the timeline.
 \end{itemize}
 
 \paragraph*{Notes}