Skip to content

Containers overview

current

A container (or “muxer format”) is the file that holds your encoded video, audio, subtitles, chapters and metadata together and keeps them in sync. It does not change quality: moving streams between containers is a remux and, with -c copy, is lossless and takes seconds. The file extension is only a label; what matters is which streams are inside and whether your player understands them.

ContainerExtensionsUse it forWatch out for
Matroska.mkv, .mka, .mksArchives and releases: any codec, many tracks, ASS/PGS subtitles, fonts, chaptersNot accepted by most phones, TVs and web browsers
MP4.mp4, .m4a, .m4vSharing, web, phones, TVs, streamingText subtitles only as mov_text; no ASS or PGS
WebM.webmBrowser playback with VP8/VP9/AV1 and Vorbis/OpusNothing else fits: no H.264, AAC or SRT
MOV.movEditing and mezzanine files (ProRes, DNxHR), Apple workflowsLooks like MP4 but accepts codecs MP4 players may not
Ogg.ogg, .oga, .opusOpus, Vorbis and FLAC audio; Theora videoPoor video container; .opus is Opus in Ogg
AVI.aviPlaying old filesNo real timestamps, no modern features; remux old files out of it

For a file you will keep or edit later, use MKV. For a file you will send to someone or put on a website, use MP4 (H.264 or HEVC plus AAC or Opus) or WebM. ISOBMFF is the shared base format behind MP4, MOV, HEIF and AVIF.

Copy streams from one container to another without re-encoding:

Terminal window
ffmpeg -i input.mkv -c copy output.mp4
mkvmerge -o output.mkv input.mp4

This only works if the target container can hold the streams. Without -map, FFmpeg keeps one video, one audio and at most one subtitle stream, and it can drop the subtitles without complaint when they cannot be copied, so check the result with ffprobe. Subtitles are the usual casualty; see Audio and subtitle handling and the subtitle formats overview.

  • They do not fix a bad encode or add compatibility to a codec: an MP4 holding a codec your TV cannot decode will not play.
  • They do not decide the codec. A .mp4 can hold H.264, HEVC, AV1 or VP9; check with ffprobe rather than trusting the extension.
  • Colour and HDR signalling live partly in the bitstream and partly in the container. Remuxing between families can drop or rewrite the container-level part, so verify HDR files after remuxing. See Preserve colour and HDR.