Codec Types
FFmpeg supports three main types of codecs:- Video Codecs: Handle video compression and decompression
- Audio Codecs: Process audio data encoding and decoding
- Subtitle Codecs: Manage subtitle format conversion and rendering
Codec Properties
Codecs in FFmpeg can have various properties:| Property | Description |
|---|---|
LOSSY | Codec uses lossy compression (some data is discarded) |
LOSSLESS | Codec preserves all original data |
INTRA_ONLY | Codec only uses intra-frame compression |
REORDER | Codec can reorder frames (B-frames) |
FIELDS | Codec supports field-based encoding |
Major Video Codec Families
MPEG Family
- MPEG-1 Video (
mpeg1video) - Classic MPEG-1 video compression - MPEG-2 Video (
mpeg2video) - Broadcast-quality video with field support - MPEG-4 Part 2 (
mpeg4) - Advanced video compression with B-frames - H.261 (
h261) - Early ITU video codec - H.263 (
h263) - Improved ITU codec with variants (H.263+, H.263i) - H.264/AVC (
h264) - Modern high-efficiency video codec - H.265/HEVC (
hevc) - Next-generation high-efficiency codec
Modern Codecs
- VP8/VP9 (
vp8,vp9) - Google’s open video codecs - AV1 (
av1) - Royalty-free next-gen codec - VVC (
vvc) - Versatile Video Codec (H.266)
Professional Codecs
- ProRes (
prores) - Apple’s professional video codec - DNxHD/DNxHR (
dnxhd) - Avid’s professional codec - JPEG 2000 (
jpeg2000) - High-quality still and motion codec - FFV1 (
ffv1) - Lossless video archival codec
Legacy & Specialized
- Microsoft Codecs: WMV1, WMV2, WMV3, MSMPEG4v1/v2/v3
- RealVideo: RV10, RV20, RV30, RV40, RV60
- Animation: Cinepak, QTRLE, Animation, GIF
- Screen Capture: Flash Screen Video, ScreenPresso
Major Audio Codec Families
Lossy Audio
- AAC (
aac) - Advanced Audio Coding, standard for modern audio - MP3 (
mp3) - MPEG-1/2 Layer III audio - MP2 (
mp2) - MPEG-1 Layer II audio - Opus (
opus) - Modern low-latency audio codec - Vorbis (
vorbis) - Open-source lossy audio codec
Lossless Audio
- FLAC (
flac) - Free Lossless Audio Codec - ALAC (
alac) - Apple Lossless Audio Codec - WavPack (
wavpack) - Hybrid lossless/lossy codec - TTA (
tta) - True Audio lossless codec
Professional Audio
- PCM (various) - Uncompressed pulse-code modulation
- DTS (
dts) - Digital Theater Systems - AC-3/E-AC-3 (
ac3,eac3) - Dolby Digital audio - TrueHD (
truehd) - Dolby TrueHD lossless - MLP (
mlp) - Meridian Lossless Packing
Speech & Telephony
- AMR-NB/WB (
amrnb,amrwb) - Adaptive Multi-Rate - Speex (
speex) - Speech compression - G.723.1 (
g723_1) - ITU telephony codec - G.729 (
g729) - ITU low-bitrate codec - ILBC (
ilbc) - Internet Low Bitrate Codec
PCM Variants
FFmpeg supports extensive PCM formats:- Signed/unsigned integers: 8, 16, 24, 32, 64-bit
- Floating point: 16, 24, 32, 64-bit
- Both big-endian and little-endian byte order
- Planar and interleaved formats
- Special formats: A-law, μ-law, Blu-ray, DVD
ADPCM Family
Adaptive Differential PCM variants for various platforms:- Gaming: 4XM, ADX, AFC, AGM, DTK, PSX, Xbox
- Multimedia: IMA WAV, MS, Yamaha, Creative ADPCM
- Proprietary: EA, Westwood, Microsoft variants
Subtitle Codecs
Text-Based
- ASS/SSA (
ass,ssa) - Advanced SubStation Alpha - SRT (
srt) - SubRip text format - WebVTT (
webvtt) - Web Video Text Tracks - MOVText (
mov_text) - MP4 timed text - TTML (
ttml) - Timed Text Markup Language
Bitmap-Based
- DVD Subtitles (
dvdsub) - MPEG-2 DVD bitmap subtitles - DVB Subtitles (
dvbsub) - Digital Video Broadcasting subtitles - XSUB (
xsub) - DivX XSUB format
Hardware Acceleration Support
Many codecs support hardware acceleration through:- QSV: Intel Quick Sync Video
- NVENC/NVDEC: NVIDIA GPU encoding/decoding
- VideoToolbox: Apple hardware acceleration
- V4L2 M2M: Video4Linux2 memory-to-memory
- MediaCodec: Android hardware codecs
- AMF: AMD Advanced Media Framework
- RKMPP: Rockchip Media Process Platform
Checking Available Codecs
To list all available codecs in your FFmpeg build:Codec Selection
When using FFmpeg, specify codecs with the-c or -codec option: