+\begin{description}
+ \item[MKV] Open, highly configurable and extensively documented. Can have seeking problems. Belongs to the Matroska family.
+ \newline Presets: \textit{ffv1, ffvyuv}
+ \item[MXF] Created by Avid. It is probably the best and most advanced container for editing.
+ \newline Presets: \textit{DNxHR, ffv1, AVC\_Intra\_100}
+ \item[MOV] Created by Apple. It is a suitable format for editing because it organizes the files within the container into hierarchically structured \textit{atoms} described in a header. This brings simplicity and compatibility with various software and does not require continuous encoding/decoding in the timeline.
+ \newline Presets: \textit{DNxHR, ffv1, CineformHD, huffyuv}
+ \item[PRO] Different extension, but it is still mov. Prores is proprietary and there are no official encoders except the original Adobe one. The engine used by ffmpeg is the result of reverse engineering and, according to Adobe, does not guarantee the same quality and performance of the original\protect\footnote{https://support.apple.com/en-us/HT200321}.
+ \newline Presets: \textit{ProRes}
+ \item[QT] Different extension, but it is always mov.
+ \newline Presets: \textit{DNxHD, magicyuv, raw, utvideo}
+ \item[MP4] mostly used for General Purpose. It belongs to the large MPEG family.
+ \newline Presets: \textit{AVC\_Intra\_100}
+ \item[RGB] Raw format.
+ \newline Presets: \textit{raw}
+ \item[YUV] Raw format.
+ \newline Presets: \textit{raw}
+ \item[AVI] Old and limited format (no multi streams, no subtitles, limited metadata) but with high compatibility.
+ \newline Presets: \textit{ffv1}
+\end{description}
+
+\subsubsection{General Purpose}
+\label{ssub:ffmpeg_video_general_purpose}
+
+These are also called Delivery codecs. They are the most used and widespread being suitable for streaming, video sharing, watching TV, smartphones, plus more. Because of lossy compression type Interframe, they produce smaller files with variable quality. They are not suitable for editing, compositing and color correction. Further rendering of these formats worsens the quality exponentially. The most used codecs have hardware support (vaapi, vdpau, nvenc) that make them more efficient.
+
+\begin{description}
+ \item[MOV] Created by Apple. It is a suitable format for editing because it organizes the files within the container into hierarchically structured "atoms" described in a header. This brings simplicity and compatibility with various software and does not require continuous encoding/decoding in the timeline.
+ \newline Presets: \textit{Presets: mov}
+ \item[QT] Different exstension, but it is always mov.
+ \newline Presets: \textit{mjpeg, DV, Div, CinePack}
+ \item[MP4] The most popular. Many other formats belong to this family (MPEG);
+ \newline h264 is actually x264, open, highly configurable and documented; h265/HEVC is actually x265, open, highly configurable and documented. x264-5 is for encoding only.
+ \newline Presets: \textit{h265, h265, mjpeg, mpeg2, obs2youtube}
+ \item[WEBM] Open; similar to mp4 but not as widespread (it is used by YouTube). It belongs to the Matroska family. In \CGG{} there are specific Presets with \texttt{.youtube} extension, but they are still webm.
+ \newline Presets: \textit{VP8, VP9, AV1}
+ \item[MKV] Open, highly configurable and widely documented. It might have seeking problems. It belongs to the Matroska family.
+ \newline Presets: \textit{Theora, VP8, VP9}
+ \item[AVI] Old and limited format (no multistreams, no subtitles, limited metadata) but with high compatibility.
+ \newline Presets: \textit{asv, DV, mjpeg, xvid}
+ \item[MPG] Parent of the MPEG family, to which MP4 also belongs. Mpeg is used by \CGG{} as default for proxies and mpeg-2 is the standard for Video DVDs.
+ \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 codec).
+
+(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}
+
+The image sequences can be uncompressed, with lossy or lossless compression but always Intraframe. They are suitable for post-processing that is compositing (VFX) and color correction.
+
+\begin{description}
+ \item[DPX] Film standard; uncompressed; high quality. \textit{Log} type.
+ \item[PNG] Uncompressed or lossless compression. Supports alpha channel.
+ \item[WEBP, TIFF, GIF, JPEG, ...] Variable compression, size and quality.
+\end{description}
+
+\subsubsection{Old Pro Formats}
+\label{ssub:ffmpeg_old_pro_formats}
+
+Some formats, though used in the past in the pro field, are disappearing with the evolution of technologies. DVD is becoming more and more niche, while Bluray is still widespread (also as a backup); DV/HDV remains only as a support for old Camcorders with magnetic tapes. DV is still a quality format, with intraframe compression; HDV is mpeg-2 compressed.
+
+\begin{description}
+ \item[AVI] old and limited format but with high compatibility.
+ \newline Presets: \textit{DV\_pal, DV\_ntsc, mjpeg}
+ \item[QT] belongs to the Apple mov family.
+ \newline Presets: \textit{DV, mjpeg}
+ \item[M2TS] format for Bluray (mpeg4). Bluray player devices need a standard Bluray disc structure (bdwrite) for playback\protect\footnote{\CGG{} offers specific functionality for creating DVDs/Blurays}.
+ \newline Presets: \textit{AVC422, Lossless, Bluray, hevc}
+ \item[MP4] Belongs to the MPEG family. Motionjpeg has jpeg compression, then Intraframe, so it maintains good quality and fluidity in editing. It is now an old and limited codec.
+ \newline Presets: \textit{mjpeg}
+\end{description}
+
+\subsection{Audio FFmpeg Formats}%
+\label{sub:FFmpeg_audio}
+
+Audio formats and codecs take much less resources and space than video ones, so they are often used without compression for maximum quality. However these are compressed formats and codecs widely used in streaming and sharing.
+
+\subsubsection{High Quality}
+\label{ssub:ffmpeg_audio_high_quality}
+
+\begin{description}
+ \item[FLAC] Open; used for storing music. It has lossless compression.
+ \newline preset: \textit{flac}
+ \item[PCM] Raw format that encodes the signal with \textit{modified pulse modulation} (pcm). FFmpeg does not support pcm audio if you use mp4 as a container.
+ \newline Presets: \textit{s8, s16, s24, s32}
+ \item[WAV] Raw format created by Microsoft. 32-bit addressing leading to the 4 GB recording limit. It is a widely used standard.
+ \newline Presets: \textit{s24le, s32le}
+ \item[W64] Wave format created by Sony to override the 4GB recording limit. Poorly supported.
+ \newline Presets: \textit{s16le, s24le, s32le}
+ \item[MKA] Open, highly configurable and documented. It belongs to the Matroska family. Uncompressed pcm type.
+ \newline Presets: \textit{s16le, s24le, s32le}
+ \item[ALAC] Apple's codec, free to use but not open source. It is lossless and of high quality but is slower than other similar codecs.
+ \newline Presets: \textit{m4a, mkv, qt}
+\end{description}