Codecs - Basics
Peter Bubestinger-Steindl
(p.bubestinger@av-rd.com)
2021-09
Hello again! :)
Quick introduction of myself and why I think I may be qualified to say anything on this topic.
Codecs - Basics
What would you like to know?
Why bother?
Best quality
Smallest size
Fastest speed
Super robust
Seamlessly interoperable
Most convenient
Preservable like a rock
The “Digital Video Trinity”
It’s >1 format
File suffix = The container format
That’s why you may get an “unable to decode audio/video track”, even if the application supports the container. Or other way around: Could play the codec, but doesn’t support the container format.
Triplet notation
Helps reducing confusions:
H.264 / AAC in MP4
FFV1 / PCM in MKV
IMX / PCM in MXF
etc
When communicating “which video format”, please consider using a triplet-notation, like: “video/audio in container”.
Codec? Container?
Why do AV sync issues happen?
What’s a stream and what other types exist?
What’s a Codec?
Think of a human language…
It’s coded information.
There may be dialects.
Different implementations may
“speak / understand” differently.
What’s a Container?
Think of a regular paper folder…
It’s a wrapper around content.
Contains Metadata.
Structures the content streams.
Metadata: * Index (which streams are contained, etc) * Descriptive MD (title, language, etc) * as well as technical MD (fps, aspect ratio, color handling, etc) * NOTE: Some technical MD may be stored in the container and the codec/stream. This may be a blessing and a curse… Example: Aspect ratio or fps.
Data Streams
What is a “stream”?
Types: audio, video, timecode, subtitle, etc.
A+V sync: correct timestamps?
Which types of streams exist? Only overview. More details in “advanced”.
A+V sync: In a file, Audio/video streams cannot be “next to each other”. Therefore they’re chopped up into packets that have timestamps assigned to them. These timestamps (=technical metadata) are used by a replayer to keep things in sync.
VLC
Very handy, but not the best for this job.
Website: videolan.org/vlc
WARNING: There’s a major fraud out there: “www.vlc.de” - aka “VLC Plus Player”. It contains the original VLC, but with unknown - possibly malicious - additions/modifications. Stay away from it.
Your use cases
“Different strokes for different folks”
Production, Preservation, Access
Who will want/need to work with these files?
Under which conditions?
For how long?
Which properties are significant to you ?
Quality
Avoid generation loss (if possible).
Avoid rescaling.
Don’t invent more bits.
Preserve “pix_fmt”.
More headroom for lower quality?
Use high enough bitrate.
Size
What is the “bitrate” for?
lossy vs lossless vs uncompressed?
What is “Constant Rate Factor (CRF) ” for?
Uncompressed != Uncompressed?
(Ex: RGB, BGR, UYVY, YUY2, V210, etc)
Open vs Closed
Enigma encryption rotor windows
What will be easier (=more likely) to be understood/accessible now and in the future: Documented language or secret code?
Open vs Closed
[…] maps the physical bit level information into the content concepts addressed by the creator of the digital object, an example is the ASCII format which describes how the bits are represented."
Without proper insights on the specification and implementation that was used to encode the data, DLTP requirements may be hard (or impossible) to satisfy.
Popular combinations
XDCAM
PCM
MXF
Broadcast
H.264
AAC
MP4
Consumer
FFV1
PCM, FLAC
MKV, MOV, AVI
Preservation
v210
PCM
MOV, MXF
Preservation
ProRes
PCM
MOV
Production
MPEG-2
AC3
MPG
DVD
DV
PCM
AVI/DV
DV
MPEG-2
MP2
M2T(=MPG)
HDV
XviD
MP3
AVI
Retro
DPX, TIFF
WAV(=PCM)
Folder
Film
List some relevant/noteworthy features of each format
Mention some typical pros/cons
Which format to choose?
Depends on your situation/use-case
“As simple as possible, as complicated as necessary”
more features/options = more complicated
Color-Circle approach
Video codecs: Remarks
Audio-Codecs: Remarks
Uncompressed
PCM (linear)
“WAV” (RIFF = AVI, but often means “PCM”)
MP3 vs AAC (MP4)
FLAC
Containers: Remarks
Audio
Preservation format: PCM in WAV
WAV = PCM = RIFF = AVI?
- FIN -
Peter Bubestinger-Steindl
p.bubestinger@av-rd.com