[Cin] Formats and Codecs in CinGG

Andrea paz gamberucci.andrea at gmail.com
Mon Nov 15 15:18:03 CET 2021


I present a first draft to create Appendix section about formats and
codecs supported by CinGG.
I don't know DV; DVD; BLU RAY and RAW formats. If anyone uses them and
can provide better info, it would be my pleasure. Also the info on MOV
as a good format for editing I have only read and not understood well.
Are they correct?
Corrections, additions and advice are welcome.
The bigger question is: is it worth stretching the already big manual
with this section?
[NOTE: is not what Terje requested; I'm not sure how to implement
those tables. If you can write them, then I'll transpose them into
Latex...]
-------------- next part --------------
{cha} overwiev on Formats and Codecs

Let's see an overview of the formats and codecs that are used in \CGG{}, both from ffmpeg and the internal engine. We can make a rough division into uncompressed codecs (or codecs with Intraframe compression, which can be lossy or lossless) and compressed codecs of Interframe type (LongGOP, almost always with lossy compression). The first are suitable for editing because a cut or other operation on the timeline corresponds to the exact frame on which you are operating. The second type uses Groups of Pictures (GOP) and a cut or other operation is accurate (and requires no further calculation) only if it coincides with the beginning of the GOP, and not with an internal frame. In addition, heavy compression requires the system to do more encoding/decoding work on the timeline. High quality codecs have high bit rates and bit depths but this also affects the performance of the system, not to mention the increased occupation of disk space.

{sec} FFMPEG (video)

FFmpeg supports hundreds of codecs and formats. Some implement both audio and video, others audio only or video only. We will provide only a selection of the most well-known and used ones.

{sub} HIGH QUALITY

They are also called Mezzanine codecs, Digital Intermediate, Preservation codecs or Editing codecs. Intraframe lossless compression or no compression. Suitable for editing, post-processing, mastering and archiving. They are also used for the interchange of files between different programs. They require a lot of space and powerful systems.

- MKV: Open, highly configurable and extensively documented. Can give Seeking problems. Belongs to the Matroska family.
    presets: ffv1; ffvyuv
- MXF: Created by Avid. It is probably the best and most advanced container for editing.
    presets: DNxHR; ffv1; AVC_Intra_100
- 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.
    presets: DNxHR; ffv1; CineformHD; huffyuv
- PRO: Different extension, but it is still mov.
    presets: ProRes
- QT: Different extension, but it is always mov.
    presets: DNxHD; magicyuv; raw; utvideo
- MP4: mostly used for General Purpose.
    presets: AVC_Intra_100
- RGB: Raw format.
    presets: raw
- YUV: Raw format.
    presets: raw
- AVI: Old and limited format (no multi streams, no subtitle, limited metadata) but with high compatibility.
    preset: ffv1

{sub} GENERAL PURPOSE

They are also called Delivery codecs. They are the most used and widespread. Suitable for streaming, video sharing, watching on TV, smartphones, etc.. Because of lossy compression type Interframe, have 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.

- 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.
    presets: mov
- QT: Different extension, but it is always mov.
    presets: mjpeg; DV; Div; CinePak
- MP4: The most popular. Many other formats belong to this family (MPEG).
    h264 is actually x264, open, highly configurable and documented; h265/HEVC is actually x265, open, highly configurable and documented;
    presets: h265; h265; mjpeg; mpeg2; obs2youtube
- WEBM: Open; similar to mp4 but not as widespread (it is used by Youtube). In CinGG there are specific presets with .youtube extension, but they are still webm.
    presets: VP8; VP9; AV1
- MKV: Open, highly configurable and widely documented. It can give Seeking problems. It belongs to the Matroska family.
    presets: Theora; VP8; VP9
- AVI: Old and limited format (no multistreams, no subtitles, limited metadata) but with high compatibility.
    presets: asv; DV; mjpeg; xvid
- MPG: Parent of the MPEG family, to which MP4 also belongs. Mpeg is used by CinGG as default for proxies; mpeg2 is the standard for Video DVDs.
    presets: mpeg: mpeg2


{sub} IMAGE SEQUENCES

The image sequences can be uncompressed, with lossy or lossless compression but, of course, always Intraframe. They are suitable for post-processing: compositing (VFX) and color correction.

- DPX: Film standard; uncompressed; high quality.
- PNG: Uncompressed or lossless compression. Supports alpha channel.
- WEBP; TIFF; GIF; JPEG; etc: variable compression, size and quality.


{sub} 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 Blu Ray is still widespread; DV remains only as a support for old Camcorders with magnetic tapes.


- AVI: old and limited format but with high compatibility.
    presets: DV_pal; DV_ntsc; mjpeg
- QT: belongs to the Apple mov family.
    presets: DV; mjpeg
- DVD: format for DVD (mpeg2)
    presets: dvd
- M2TS: format for Blu Ray (mpeg4).
    presets: AVC422; Lossless; Blu Ray; hevc
- MP4: Belongs to the MPEG family. Motionjpeg has jpeg compression, then Intra, so it maintains good quality and fluidity in editing. It is now an old and limited codec.
    preset: mjpeg


{sec} 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 there are compressed formats and codecs widely used in streaming and sharing. Some of the codecs seen above support both audio and video; others are only for video or audio.


- FLAC: Open; used for storing music. It has lossless compression.
    preset: flac
- PCM: Raw format that encodes the signal with modified pulse modulation (pcm). FFmpeg does not support pcm audio if you use mp4 as a container.
    presets: s8; s16; s24; s32
- WAV: Raw format created by Microsoft. 32-bit addressing leading to the 4 GB recording limit. It is a widely used std.
    presets: s24le; s32le
- W64: Wave format created by Sony to override the 4GB recording limit. Poorly supported.
    presets: s16le; s24le; s32le
- MKA: Open, highly configurable and documented. It belongs to the Matroska family. Uncompressed pcm type.
    presets: s16le; s24le; s32le


{sub} GENERAL PURPOSE

- MP3: Belongs to the MPEG family. The most widely used in streaming and sharing.
   preset: mp3
- OGG: Open, highly configurable and documented. It belongs to the Matroska family. Flac has lossless compression; opus is compressed but modern and of good quality, superior to mp3. Vorbis is compressed and dated, but lightweight and compatible.
    presets: flac; opus; vorbis
- PRO: Created by Apple; compressed audio codec, competing with mp3.
    presets: acc256k


{sec} \CGG{} internal engine

Ffmpeg is the default engine, but you can also use its internal engine, which is limited in supported formats but efficient and of high quality.

{sub} VIDEO

- RAW DV: support the DV standard.
    presets: dv
- MPEG Video: highly configurable. Extension .m2v
    presets: mpeg1; mpeg2
- OGG (Theora/Vorbis): Open, easily configurable. Theora for video, Vorbis for audio.
    presets: theora; vorbis



{sub} IMAGE SEQUENCES

Many formats available, OpenEXR (Open Standard) is a competing film standard to DPX. Ppm is RGB Raw; Tga is RGB(A) compressed or uncompressed; Tiff is RGB(A) or RGB(A)-Float with various compression types.
    presets: jpg; gif; EXR; png; ppm; tga; tiff



{sub} AUDIO

- AC3: widely used multichannel standard (Dolby Digital). Format with lossy compression.
    preset: ac3
- Apple/SGI AIFF: Created by Apple; is an uncompressed format (pcm type) or with 32/64-bit floating point compression.
    preset: aif
- Sun/Next AU: created by Sun and spread in Unix environment, now in disuse. It can be of pcm type or with lossy compression.
    preset: au
- Flac: Open; lossless compression; very good quality.
    preset: flac
- Microsoft WAV: created by Microsoft. It can have 16-24-32-bit linear or float compression.
    presets: wav
- MPEG Audio: Very widespread standard. Extension .mp3
    presets: mp3





More information about the Cin mailing list