From: Good Guy Date: Mon, 28 Nov 2022 17:39:15 +0000 (-0700) Subject: Andrea updated detailed information on MKV + minor mods X-Git-Tag: 2022-11~2 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=6b141be7b2c5f36d4c8792c65f4d092b933672c5;p=goodguy%2Fcin-manual-latex.git Andrea updated detailed information on MKV + minor mods --- diff --git a/parts/Advanced.tex b/parts/Advanced.tex index 0074993..be32f91 100644 --- a/parts/Advanced.tex +++ b/parts/Advanced.tex @@ -185,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. diff --git a/parts/Overlays.tex b/parts/Overlays.tex index 07f6bd0..dc948f3 100644 --- a/parts/Overlays.tex +++ b/parts/Overlays.tex @@ -137,7 +137,15 @@ Each line describes a pair with the left one for alpha and the right one for chr The previous math forms are the only truly accurate description of each blending operation, but short descriptions are below where \textit{Source} is the output from the next track and \textit{Destination} is the output from the lower track stacking. Blending starts with new Source and combines it with the previous render stack output, which is referred to as Destination. The new output becomes the next Destination and the next up stack level becomes the new Source. Source is above; Destination is below. -Note: the Graphic Art group operates principally on color, and the others operate principally on alpha. +Some notable items that affect the results are listed here. +\begin{enumerate} + \item So as not to be surprised by the results, set your Video Driver to X11, not X11-OpenGL, because when rendering your video no graphics library is used. Rendering is handled in software and there is sometimes anomaly differences when using the OpenGL driver. + \item The Graphic Art group operates principally on color, and the others operate principally on alpha. + \item When using the Title plugin with text, blending or changes in the text will only take affect in Subtract, Divide, and Difference. This matches the implmentation of the original Cinelerra version. + \item If comparing results with the original Cinelerra version for Subtract and Divide, you may have to switch the order of the source and destination tracks to see the same output. If you do not want to switch tracks, you can use the \textit{overlay} plugin as shared and change the Layer order and/or Output layer. The reason for having to switch tracks to get equivalent output is because of differences in the math formulas used. Subtract exactly matches the original Cinelerra version if you switch the 2 tracks; Divide matches in one order only. + \item Instead of using the patchbay overlays, you may prefer to use the \textit{overlay} plugin instead. + \item If you see undesirable results, always check under Settings->Format and check your Color Model as that will vary or interfere with the look. +\end{enumerate} % Leave the word Group in due to latex2html dual name conflict \subsection*{Normal Group}% @@ -155,11 +163,11 @@ Note: the Graphic Art group operates principally on color, and the others operat Standard numerical operations. \begin{description} - \item[Addition:] The source is added to the destination and replaces the destination. Addition mode is very simple - the pixel values of the upper and lower layers are added to each other. The resulting image is normally brighter. The equation can result in color values greater than $255$, so some of the light colors may be clipped to the maximum value of $255$. Math formula is the same as that used by SVG but different than Gimp. - \item[Subtract:] Subtract mode reduces the pixel values of the upper layer by the pixel values of the lower layer. The resulting image is normally darker. You might get a lot of black or near-black in the resulting image. The equation can result in negative color values, so some of the dark colors may be clipped to the minimum value of $0$. Math formula used is different than that used by Gimp; there is no SVG equivalent. + \item[Addition:] The source is added to the destination and replaces the destination. Addition mode is very simple - the pixel values of the upper and lower layers are added to each other. The resulting image is normally brighter. The equation can result in color values greater than $255$, so some of the light colors may be clipped to the maximum value of $255$. Math formula is the same as that used by SVG but slightly different than Gimp. + \item[Subtract:] Subtract mode reduces the pixel values of the upper layer by the pixel values of the lower layer. The resulting image is normally darker. You might get a lot of black or near-black in the resulting image. The equation can result in negative color values, so some of the dark colors may be clipped to the minimum value of $0$. Math formula used is different than that used by the Gimp "Default" version, but you can get the same as the "Legacy" version if you switch the 2 tracks or use the \textit{overlay} plugin and switch to Top first. There is no SVG equivalent. \item[Multiply:] The source color is multiplied by the destination color and replaces the destination. The resulting color is always at least as dark as either the source or destination color. Multiplying any color with black results in black. Multiplying any color with white preserves the original color. Math formula is the same as used by SVG and Gimp. - \item[Divide:] Divides source color by destination color. If the source color is white, the result color is the underlying color. The resulting image is often lighter. Math formula used is different than that used by Gimp; there is no SVG equivalent. - \item[Replace:] Replace mode will cause any existing destination to be replaced by the source media. Mathematical formula used is the same as used by Gimp; there is no SVG equivalent. + \item[Divide:] Divides source color by destination color. If the source color is white, the result color is the underlying color. The resulting image is often lighter. Math forumula is different than that of Gimp, but by changing the order of the Source and Destination tracks you can get the same results in some cases (this is true for the original Cinelerra version also). There is no SVG equivalent. + \item[Replace:] Replace mode will cause any existing destination to be replaced by the source media. Math formula used is the same as used by Gimp; there is no SVG equivalent. \end{description} \subsection*{Porter-Duff Group}% @@ -222,8 +230,7 @@ generated output is more obvious. \begin{figure}[ht] \centering \includegraphics[width=1.0\linewidth]{normal2.png} - \caption{Normal and Arithmetic overlays - ** Subtract currently not applying guards but should look like this when corrected.} + \caption{Normal and Arithmetic overlays} \end{figure} \begin{figure}[ht] diff --git a/parts/Quickstart.tex b/parts/Quickstart.tex index 8c1fdd0..9400d7e 100644 --- a/parts/Quickstart.tex +++ b/parts/Quickstart.tex @@ -338,6 +338,54 @@ These are also called Delivery codecs. They are the most used and widespread bei \newline Presets: \textit{mpeg, mpeg2} \end{description} +\subsubsection{Note on Matroska (mkv) container} +\label{ssub:note_mkv_container} +\index{mkv} + +Matroska is a modern universal container that is Open Source so there is lots of ongoing development with community input along with excellent documentation. Also derived from this format is the \textit{Webm} container used by Google and YouTube, which use the VP8-9 and AV1 codecs. Although using in \CGG{} is highly recommended, you may have seeking problems during playback. The internal structure of matroskas is sophisticated but requires exact use of internal keyframes (I-frame; B-frame and P-frame) otherwise playback on the timeline may be subject to freeze and drop frames. The mkv format can be problematic if the source encoding is not done well by the program (for example, OBS Studio). For an easy but accurate introduction of codecs and how they work see: \url{https://ottverse.com/i-p-b-frames-idr-keyframes-differences-usecases/}. + +To find out the keyframe type (I, P, B) of your media you can use ffprobe: + +\begin{lstlisting}[numbers=none] + $ ffprobe -v error -hide_banner-of default=noprint_wrappers=0 -print_format flat -select_streams v:0 -show_entries frame=pict_type input.mkv +\end{lstlisting} + +\textbf{-v error -hide\_banner:} serves to hide a blob of information that is useless for our purposes. + +\textbf{-of:} is an alias for \textit{-print\_format} and is used to be able to use \textit{default=noprint\_wrappers =0}. + +\textbf{-default=noprint\_wrappers=0:} is used to be able to show the information from the parsed stream that we need. + +\textbf{-print\_format flat:} is used to display the result of ffprobe according to a \textit{flat} format (you can choose CSV, Json, xml, etc). + +\textbf{-select\_streams v:0:} is used to choose the first stream (0) in case there are multiple audio and video streams (tracks, in \CGG{}). + +\textbf{-show\_entries:} shows the type of data collected by ffprobe that we want to display (there are also types: \texttt{\_streams}, \texttt{\_formats}, \texttt{\_packets}, and \texttt{\_frames}. They are called \textit{specifiers}). + +\textbf{-frame=pict\_type:} within the chosen specifier indicates the data to be displayed; in this case \textit{pict\_type}, that is, the keyframe type (I, P, B) of the frame under consideration. + +\textbf{input.mkv:} is the media to be analyzed (it can be any container and code). + +(see \url{https://ffmpeg.org/ffprobe.html} for more details) + +We thus obtain a list of all frames in the analyzed media and their type. For example: + +\begin{lstlisting}[numbers=none] + frames.frame.0.pict_type="I" + frames.frame.1.pict_type="P" + frames.frame.2.pict_type="B" + frames.frame.3.pict_type="B" + frames.frame.4.pict_type="B" + ... +\end{lstlisting} + +There are also 2 useful scripts that not only show the keyframe type but also show the GOP length of the media. They are zipped tars with readme's at: \newline +\small\url{https://cinelerra-gg.org/download/testing/getgop_byDanDennedy.tar.gz} \newline +\small\url{https://cinelerra-gg.org/download/testing/iframe-probe_byUseSparingly.tar.gz} + +We can now look at the timeline of \CGG{} to see the frames that give problems in playback. Using a codec of type Long GOP, it is probably the rare I-frames that give the freezes. +To find a solution you can use MKVToolNix (\url{https://mkvtoolnix.download/}) to correct and insert new keyframes into the mkv file (matroska talks about \textit{cues data}). It can be done even without new encoding. Or you can use the \texttt{Transcode} tool within \CGG{} because during transcoding new keyframes are created that should correct errors. + \subsubsection{Image Sequences} \label{ssub:ffmpeg_image_sequences}