All posts
Format Guides 7 min readOctober 31, 2026

Video Containers vs Codecs: MP4, MKV, H.264, HEVC, AV1

By , Founder of Filoshi

MP4 and MKV are boxes; H.264, HEVC and AV1 are what's inside. How containers and codecs differ, which pairings play where, and why it decides playback.

Get Filoshi · $29The file converter that works on your PC. 1,841 tested conversions, nothing uploaded.

A video file has two layers. The container (MP4, MOV, MKV, WebM, AVI) is the box: it holds the streams and the information about how they fit together. The codec (H.264, HEVC, AV1, VP9) is how the picture inside was compressed, and AAC, Opus or MP3 do the same for the sound. A player needs to understand both. When a video "doesn't play", the box is rarely the problem; the codec inside usually is.

Containers: the box

A container stores one or more streams (video, audio, subtitles) plus the timing that keeps them in sync, and metadata such as the title or the recording date. The common ones:

ContainerWhere it comes fromGood at
MP4Derived from the ISO base media file format, which comes from Apple's QuickTime formatPlaying everywhere: phones, browsers, TVs, editors
MOVApple's QuickTime formatApple devices and editing; iPhones record it
MKVMatroska, an open standardFilms with several audio and subtitle streams and chapters
WebMBased on Matroska, designed for the webRoyalty-free video in browsers
AVIMicrosoft's older video formatOld files; best converted for modern devices

The lineage matters. Mozilla's documentation explains that MP4 is derived from the ISO base media file format, "which is directly derived from the QuickTime file format developed by Apple", though the two "are not quite interchangeable". It also notes that Apple itself now generally uses MP4 for video (MDN on media containers). Matroska describes itself as an extensible, open source, open standard container: "an envelope for which there can be many audio, video and subtitles streams", with chapters and selectable streams. WebM is a format based on Matroska, and compliant WebM players must support the VP8 and VP9 video codecs and the Vorbis and Opus audio codecs.

MP4 vs MKV compares the two most common choices for sharing and archiving.

Video codecs: what's inside

H.264 (AVC)

The ITU published the first version of H.264, "Advanced video coding for generic audiovisual services", in May 2003 (ITU-T H.264). More than twenty years later it is still the safe choice: MDN calls it broadly compatible in web browsers, and YouTube's recommended upload settings are H.264 in an MP4 container (YouTube upload settings).

HEVC (H.265)

The first version of H.265, "High efficiency video coding", followed in April 2013 (ITU-T H.265). Apple says HEIF and HEVC "offer better compression than JPEG and H.264", which is why phones and cameras record in it (Apple: Using HEIF or HEVC media). The cost is licensing and support: MDN notes HEVC is proprietary and covered by a number of patents, and its browser support depends on the platform and the hardware. On Windows it needs the paid HEVC Video Extensions; why a video won't play on Windows 11 covers that.

VP9 and AV1

VP9 is the successor to Google's VP8. MDN describes it as entirely open and royalty-free, widely supported by browsers, and one of the two video codecs WebM requires. AV1, from the Alliance for Open Media, is its successor. In MDN's words it "achieves higher data compression rates than VP9 and H.265/HEVC, and as much as 50% higher rates than AVC", and it is fully royalty-free (MDN on video codecs). MDN also notes the practical catch: in Safari, AV1 works only on devices with a hardware AV1 decoder, which means recent Macs and iPhones.

ProRes

Apple ProRes is a family of codecs designed for editing, not for watching. Apple's figures put ProRes 422 at about 147 Mbps at 1080p (About Apple ProRes), many times a typical delivery file. You'll meet it as an export from Final Cut Pro or a high-end camera, and it usually gets converted before sharing.

Audio codecs inside video files

The sound is a separate stream with its own codec. AAC is the usual partner of H.264 in MP4 files; YouTube's recommended settings list AAC-LC or Opus. Opus is the standard pairing in WebM. MKV files can hold almost anything, including several audio tracks in different languages. If a video plays with no sound, the audio codec is the part your player can't decode.

What plays where

CombinationBrowsersWindows 11Notes
H.264 + AAC in MP4All major browsersBuilt inThe universal choice
HEVC in MP4 or MOVDepends on platform and hardwareNeeds HEVC Video ExtensionsCommon from iPhones and cameras
VP9 + Opus in WebMWidely supportedVaries by appCommon for web downloads
AV1 in MP4 or WebMSupported; Safari only with a hardware decoderFree AV1 Video ExtensionThe most efficient of these codecs
ProRes in MOVNot for browsersEditing softwareAn editing format

Browser support changes with every release, so treat that table as a snapshot from October 2026 and check MDN for the current state. For TVs, game consoles and car screens, the device's own manual is the only reliable list.

Remux or re-encode?

Because the container and the codec are separate, there are two very different ways to "convert" a video:

  • Remuxing copies the existing streams into a new container without touching them. If an MKV holds H.264 and AAC, both of which MP4 can hold, a remux makes an MP4 in seconds with no quality change.
  • Re-encoding decodes the video and compresses it again, possibly with a different codec. It's needed when the target device doesn't support the codec, or when you want a smaller file, a different resolution or a different frame rate. It takes longer and is a second round of lossy compression.

How to convert video formats without losing quality goes into when each makes sense, and lossy vs lossless compression explains why a second round of compression costs a little each time.

How to see what's inside a file

The extension tells you the container, never the codec. To find the codec on Windows, Microsoft's Codecs FAQ suggests playing the file if you can, then opening its properties and reading the audio codec and video codec details. Microsoft also points out that many programs use their own extensions and that renaming a file doesn't change its format, so the properties are more trustworthy than the name.

Knowing the codec tells you what to do next. HEVC means the HEVC extension or a conversion to H.264. AV1 means the free AV1 extension on Windows. ProRes means the file is an editing master, and the copy you share should be something else. H.264 with AAC means the file should play almost anywhere, and if it doesn't, the file itself may be damaged.

Licensing, briefly

H.264 and HEVC are proprietary formats covered by patents, and MDN notes that commercial use of H.264 requires a license. AV1, VP9 and the WebM format were designed to be royalty-free. That's why HEVC playback is a paid add-on on Windows while AV1 is free, and why browsers adopted VP9 and AV1 widely. Filoshi's codec licensing page lists which formats may be affected (information, not legal advice).

What this means when you convert

  • For the widest reach (sending to anyone, older devices, editors): H.264 with AAC in MP4.
  • For the smallest file where the playback side supports it: AV1, or HEVC on Apple devices.
  • For the web: MP4 with H.264 as the safe default, WebM with VP9 or AV1 as the smaller option.
  • For archiving a film with several languages and subtitles: MKV keeps them all in one file.

Codec choice is also the biggest single factor in file size after resolution. Why is my video file so big? does the math, and what is WebM? covers the web format in detail.

What Filoshi writes

Filoshi converts video with FFmpeg on your PC, with nothing uploaded. By default it writes MP4, MKV and MOV as H.264 video with AAC sound at a high-quality setting, WebM as VP9 with Opus, and AVI as H.264 with MP3 sound. It always re-encodes, so it doesn't offer a remux, and it writes standard 8-bit video, so HDR footage won't stay HDR. Every video conversion the app lists passed its automated test matrix, including MKV to MP4, MOV to MP4, MP4 to WebM and WebM to MP4.

I make Filoshi, so weigh what I say about it accordingly. The facts about formats and Windows are linked to their sources.

Frequently asked questions

Is MP4 a codec?

No. MP4 is a container: a file format that holds video, audio and subtitle streams together. The codec is how each stream was compressed, for example H.264 or HEVC for video and AAC for audio. Two files with the .mp4 extension can contain different codecs, which is why one MP4 plays on a device and another doesn't.

Is HEVC better than H.264?

HEVC makes smaller files at similar quality, which is why phones and cameras use it. H.264 plays on far more devices and needs no paid extension on Windows. So HEVC is better for storage on devices that support it, and H.264 is better for sharing. Converting between them is a re-encode and costs a little quality.

Why isn't AV1 everywhere yet?

AV1 is newer than H.264 and HEVC, and decoding it efficiently needs hardware support that older devices lack. Mozilla's documentation notes that Safari supports AV1 only on devices with a hardware AV1 decoder. Support grows with each generation of phones, PCs and browsers.

Can changing the container change the quality?

Not by itself. Moving the same streams into a different container (a remux) leaves the picture and sound untouched. Quality changes only when the video is re-encoded, which happens when the codec changes or when a converter re-compresses the streams anyway. Filoshi always re-encodes, at a high-quality setting by default.

video codecs mp4 mkv h264

Ready to convert files privately?

1,841 tested conversions. No uploads. No accounts. Runs entirely on your machine.

Get Filoshi · $29