跳转到主要内容
Formats & playback 7 min read

Container vs Codec: What MP4/MKV and H.264/HEVC Actually Mean

Changing "format" actually covers two different operations: swapping the container (the wrapper) or the codec (the compression). Once you can tell the layers apart, most "can this be lossless" and "why won't it open" questions answer themselves.

What is inside a video file

  • Container: MP4, MKV, WebM, MOV, AVI, TS — packages the video, audio, subtitle streams and chapter data together.
  • Video codec: H.264/AVC is the universal default; H.265/HEVC is roughly half the size but narrower support; AV1 is the newer open codec.
  • Audio codec: AAC, MP3, Opus — a separate choice from the video codec.
  • The file extension only tells you the container, never the codec.

Remux vs transcode

Remuxing re-packages the existing streams into a different container: seconds of work, zero quality loss. Transcoding decodes and re-compresses: minutes of work and a generational quality cost. Remux only works when the target container supports the source codec and the streams are spec-valid; otherwise transcode.

Rule of thumb: when converting to MP4, try a remux first and save transcoding for cases that genuinely need new parameters — you keep both quality and time.

"Won't open" is usually a codec problem

A black screen with sound, or sound without picture, means the player lacks a decoder — commonly HEVC on systems without the HEVC extension. TS recordings and FLV downloads are container problems; a remux to MP4 usually fixes them instantly.

Frequently asked questions