Skip to main content
FFmpeg supports a comprehensive range of container formats through its libavformat library. Container formats (also called muxers/demuxers) handle how audio, video, subtitle, and metadata streams are packaged together in files.

Format Categories

Multimedia Containers

These formats can contain multiple audio, video, and subtitle streams:
FormatExtensionDescriptionInputOutput
Matroska.mkv, .mka, .mk3dUniversal container with excellent codec supportYesYes
MP4.mp4, .m4a, .m4vMPEG-4 Part 14, widely compatibleYesYes
QuickTime.movApple’s multimedia containerYesYes
AVI.aviAudio Video Interleave (legacy Windows)YesYes
WebM.webmWeb-optimized container (VP8/VP9/AV1)YesYes
MPEG-TS.ts, .m2tsMPEG Transport Stream (broadcast)YesYes
MPEG-PS.mpg, .mpeg, .vobMPEG Program StreamYesYes
ASF/WMV.asf, .wmv, .wmaAdvanced Systems Format (Windows Media)YesYes
FLV.flvFlash VideoYesYes
Ogg.ogg, .ogv, .oga, .ogxXiph.Org containerYesYes
NUT.nutFFmpeg’s container formatYesYes
MXF.mxfMaterial eXchange Format (professional)YesYes
GXF.gxfGeneral eXchange Format (broadcast)YesYes

Video-Only Formats

FormatExtensionDescriptionInputOutput
H.264.h264, .264Raw H.264/AVC elementary streamYesYes
H.265.hevc, .h265, .265Raw HEVC elementary streamYesYes
MPEG Video.m1v, .m2vRaw MPEG-1/2 videoYesYes
Dirac.drcDirac video elementary streamYesYes
DNxHD.dnxhdAvid DNxHD raw streamYesYes
AV1.av1AV1 video elementary streamYesYes
Rawvideo.yuv, .rgbUncompressed raw videoYesYes
IVF.ivfIndeo Video Format (VP8/VP9)YesYes
CAVS.cavsChinese AVS videoYesYes

Audio-Only Formats

FormatExtensionDescriptionInputOutput
MP3.mp3MPEG Audio Layer 3YesYes
AAC.aacAdvanced Audio CodingYesYes
ADTS.aacAAC with ADTS headersYesYes
FLAC.flacFree Lossless Audio CodecYesYes
WAV.wavWaveform Audio File FormatYesYes
AIFF.aif, .aiffAudio Interchange File FormatYesYes
Opus.opusOpus audio in Ogg containerYesYes
Vorbis.oggVorbis audio in OggYesYes
WavPack.wvWavPack lossless/hybridYesYes
APE.apeMonkey’s AudioYesNo
TTA.ttaTrue Audio losslessYesYes
AC3.ac3Dolby DigitalYesYes
E-AC3.eac3Dolby Digital PlusYesYes
DTS.dtsDTS Coherent AcousticsYesYes
TrueHD.thdDolby TrueHDYesYes
AU.auSun/NeXT audioYesYes
CAF.cafCore Audio FormatYesYes

Image Sequences

FormatExtensionDescriptionInputOutput
Image2.png, .jpg, etc.Generic image sequenceYesYes
APNG.pngAnimated PNGYesYes
GIF.gifGraphics Interchange FormatYesYes
WebP.webpGoogle WebP imagesYesYes
JPEG.jpg, .jpegJPEG imagesYesYes
PNG.pngPortable Network GraphicsYesYes
TIFF.tif, .tiffTagged Image File FormatYesYes
DPX.dpxDigital Picture ExchangeYesYes
EXR.exrOpenEXR (high dynamic range)YesYes

Subtitle Formats

FormatExtensionDescriptionInputOutput
SubRip.srtSubRip text subtitlesYesYes
ASS/SSA.ass, .ssaAdvanced SubStation AlphaYesYes
WebVTT.vttWeb Video Text TracksYesYes
MicroDVD.subMicroDVD formatYesNo
SubViewer.subSubViewer formatYesNo
JACOsub.jssJACOsub formatYesYes
MPL2.mplMPL2 formatYesNo
SAMI.smiSynchronized Accessible MediaYesNo
SCC.sccScenarist Closed CaptionYesYes
TTML.ttmlTimed Text Markup LanguageYesYes

Streaming Formats

FormatProtocolDescriptionInputOutput
HLS.m3u8HTTP Live Streaming (Apple)YesYes
DASH.mpdDynamic Adaptive Streaming over HTTPYesYes
RTMPrtmp://Real-Time Messaging ProtocolYesYes
RTSPrtsp://Real-Time Streaming ProtocolYesYes
RTPrtp://Real-time Transport ProtocolYesYes
SRTsrt://Secure Reliable TransportYesYes
HTTPhttp://HTTP streamingYesYes

Professional Formats

FormatExtensionDescriptionInputOutput
MXF.mxfMaterial eXchange FormatYesYes
MXF D-10.mxfSMPTE D-10 variantNoYes
MXF OP1a.mxfOperational Pattern 1aNoYes
GXF.gxfGeneral eXchange FormatYesYes
LXF.lxfLeitch/Harris eXchange FormatYesNo
IMF.mxfInteroperable Master FormatYesNo

Legacy & Game Formats

FormatExtensionDescriptionInputOutput
3DO.str3DO STRYesNo
4XM.4xm4X TechnologiesYesNo
Bink.bikRAD Game Tools BinkYesNo
Smacker.smkRAD Game Tools SmackerYesNo
RoQ.roqid Software RoQYesYes
Interplay.mveInterplay MVEYesNo
Westwood.aud, .vqaWestwood StudiosYesNo
Sierra.vmdSierra VMDYesNo
Delphine CIN.cinDelphine SoftwareYesNo

Format Features

Matroska (.mkv)

  • Strengths: Universal codec support, chapters, multiple audio/subtitle tracks, metadata
  • Use Cases: Archival, high-quality video, multi-language content
  • Codecs: Any video/audio codec
  • Limitations: Not universally supported on hardware players

MP4 (.mp4)

  • Strengths: Excellent compatibility, streaming support, mobile-friendly
  • Use Cases: Web video, mobile devices, general distribution
  • Codecs: H.264, H.265, AAC, MP3, Opus
  • Limitations: Limited codec support compared to MKV

WebM (.webm)

  • Strengths: Web-optimized, royalty-free codecs, small file sizes
  • Use Cases: Web video, HTML5 playback
  • Codecs: VP8, VP9, AV1, Opus, Vorbis
  • Limitations: Limited to specific codecs

AVI (.avi)

  • Strengths: Simple structure, wide software support
  • Use Cases: Legacy systems, basic video editing
  • Codecs: Various (MPEG-4, DivX, Xvid, etc.)
  • Limitations: 2GB file size limit (without OpenDML), no modern features

MPEG-TS (.ts)

  • Strengths: Error resilience, broadcast-ready, streaming
  • Use Cases: Broadcasting, DVB, ATSC, streaming
  • Codecs: MPEG-2, H.264, H.265, AAC, AC-3
  • Limitations: Larger file sizes than MP4

MXF (.mxf)

  • Strengths: Professional metadata, frame-accurate editing, broadcast standard
  • Use Cases: Professional video production, broadcasting, archival
  • Codecs: DNxHD, ProRes, MPEG-2, uncompressed
  • Limitations: Complex format, requires specialized software

Checking Available Formats

To list all formats supported by your FFmpeg build:
# List all formats (both muxers and demuxers)
ffmpeg -formats

# List only muxers (output formats)
ffmpeg -muxers

# List only demuxers (input formats)
ffmpeg -demuxers

# Get detailed information about a specific format
ffmpeg -h muxer=mp4
ffmpeg -h demuxer=matroska

Format Selection

FFmpeg usually auto-detects the format based on file extension, but you can override:
# Explicitly specify output format
ffmpeg -i input.avi -f mp4 output.mp4

# Force input format
ffmpeg -f rawvideo -pix_fmt yuv420p -s 1920x1080 -i input.yuv output.mp4

# Change container without re-encoding
ffmpeg -i input.mkv -c copy output.mp4

Format-Specific Options

Many formats support specific options:
# MP4 with fast start (web optimization)
ffmpeg -i input.mkv -c copy -movflags +faststart output.mp4

# Matroska with specific metadata
ffmpeg -i input.mp4 -c copy -metadata title="My Video" output.mkv

# HLS streaming output
ffmpeg -i input.mp4 -c copy -f hls -hls_time 10 output.m3u8

# DASH streaming output
ffmpeg -i input.mp4 -c copy -f dash output.mpd

Common Use Cases

Archive/Master Files

  • Recommended: Matroska (.mkv) with FFV1 or ProRes
  • Reason: Maximum quality preservation, future-proof

Web Distribution

  • Recommended: MP4 (.mp4) with H.264 + AAC or WebM with VP9 + Opus
  • Reason: Universal browser support, efficient streaming

Professional Editing

  • Recommended: MOV (.mov) with ProRes or MXF (.mxf) with DNxHD
  • Reason: Frame-accurate editing, professional metadata

Broadcasting

  • Recommended: MPEG-TS (.ts) or MXF (.mxf)
  • Reason: Broadcast standards compliance, error resilience

Mobile Devices

  • Recommended: MP4 (.mp4) with H.264 + AAC
  • Reason: Universal compatibility, hardware acceleration

See Also

Build docs developers (and LLMs) love