VideoBB
Upload Premium Sign in

Video formats and codecs, explained

A file extension tells you the box. The codec tells you what is inside it. Knowing the difference is the fastest way to stop fighting playback errors, bloated files and failed uploads.

A video file is a container, such as MP4, MKV or AVI. Inside it sit compressed streams made by codecs: H.264, H.265 or AV1 for the picture, and AAC, Opus or MP3 for the sound. For uploading and sharing, MP4 with H.264 video and AAC audio is the mix that plays everywhere.

Abstract illustration of a translucent box containing layered coloured ribbons representing video, audio and subtitle streams

Guides in this hub

  1. ComparisonMP4 vs MKV vs AVIThree containers from three different decades. Here is what each one can hold, where it plays, what it cannot do, and why MP4 is the right default for anything you upload or share.9 min readRead
  2. ComparisonH.264 vs H.265 vs AV1One codec plays on everything, one halves the bitrate but carries licensing baggage, and one is royalty-free and gaining ground. How to choose between them for encoding, upload and delivery.8 min readRead
  3. ExplainerContainer vs codecA file extension names the wrapper. The codec is the compression inside it. Confusing the two is the root of most playback failures, and telling them apart takes one command.7 min readRead
  4. How-toHow to convert AVI to MP4Step-by-step ffmpeg commands that turn old AVI files into MP4s that play in any browser. They range from a lossless remux that takes seconds to a full re-encode with deinterlacing.8 min readRead
  5. ExplainerAAC vs Opus vs MP3Video gets the attention, but the audio codec decides whether a file plays silently, fails in HLS or wastes bitrate. What each of the three main codecs does well and which container each belongs in.8 min readRead

Almost every playback complaint comes down to one of two things. One is the container the file is wrapped in. The other is the codec that squeezed the picture and sound inside it. People say "my MP4 will not play" when the real problem is a codec inside the MP4 that the device cannot decode. They say "MKV is higher quality" when the container has no effect on quality at all. Once you can tell the box from what is in it, most format questions answer themselves.

This hub is the reference for that split. It covers the three containers you will meet most often and the three video codecs that matter today. It also covers the audio codecs beside them, and how to convert one thing into another with free tools. It is written for people who need a file to upload, play in a browser or keep in an archive.

Containers: the box and its label

A container is a file format that holds one or more streams side by side. The streams can be video, audio, subtitles, chapter markers and metadata. The container also stores an index, so a player can jump to any point. The MP4 vs MKV vs AVI comparison works through how the three differ.

MP4, MKV and AVI in one line each

MP4 is defined by ISO/IEC 14496-14, on top of the ISO Base Media File Format. MKV is the Matroska format. It is an open design built on EBML, and the IETF published it as RFC 9559. AVI is the Resource Interchange File Format profile that Microsoft released in 1992.

They differ in what they may hold and how they index it. They also differ in how well they suit streaming and how many players understand them.

Changing the box does not change the picture

The most useful fact about containers is this: changing one does not change picture quality. Moving an H.264 stream from MKV to MP4 is a remux. The compressed frames are copied byte for byte into a new wrapper. It takes seconds, not minutes, and loses nothing.

Only when the codec itself must change does the file need to be decoded and encoded again. That is where quality can be lost. The container vs codec explainer exists mainly to make that point stick.

Video codecs: how much picture per megabit

A codec is the compression scheme. Newer codecs describe the same picture with fewer bits, but they cost more time to encode and play on fewer devices.

H.264, H.265 and AV1

H.264, also called AVC, was standardised in 2003. Almost every phone, laptop, television and browser in use decodes it in hardware. H.265 (HEVC, 2013) and AV1 (AOMedia, 2018) aim for the same quality at a lower bitrate. They make different trade-offs in encoding time, licensing and device support.

The H.264 vs H.265 vs AV1 guide shows where each one is a sensible choice. It also shows where each one just makes a file nobody can open.

The codec only sets the ceiling

A poorly encoded AV1 file can look worse than a well encoded H.264 file. Settings matter as much as the codec. If you are choosing numbers, read the bitrate guide and the resolution comparison next.

What plays where

A simple view of container and codec support where video actually ends up. "Depends" means support hinges on the operating system, the hardware decoder or the browser version.

CombinationBrowsersPhones and TVsEditing softwareNotes
MP4 + H.264 + AACYesYesYesThe universal default
MP4 + H.265 + AACDependsMostlyYesSafari yes; Chrome needs a hardware decoder
MP4 + AV1 + OpusMostlyDependsImprovingNewer devices only for hardware decode
WebM + VP9/AV1 + OpusYesDependsLimitedThe web-native subset of Matroska
MKV + anythingInconsistentDependsMostlyArchive and desktop players, not the web
AVI + MPEG-4 Part 2 + MP3NoRarelyLegacyConvert before sharing

Audio codecs: the half people forget

Sound is compressed separately. It is often the reason a file plays silently or refuses to load. The audio codec guide covers the right bitrates and the compatibility traps.

AAC, Opus and MP3 at a glance

  • AAC is the default partner for H.264 and H.265 in MP4. It is also the audio format Apple's HLS documentation expects.
  • Opus, defined in RFC 6716, is the modern open codec used by WebRTC and WebM. It is very efficient at low bitrates.
  • MP3 is the format everyone can play. Nobody should pick it for new encodes when AAC or Opus is available.

Converting one format to another

Most conversions are one of two jobs. Either the box changes and the streams are copied, or the streams are encoded again into a new codec. The AVI to MP4 guide walks through both with ffmpeg commands. If you would rather not use a command line, the free video converter turns a file into MP4, WebM, MKV, MOV or AVI from your browser.

Before you convert anything for VideoBB, check the list of supported formats and size limits. The file you already have may be fine as it is. The uploading video hub covers what happens next, from export settings to big-file uploads.

Rules of thumb that survive contact with real files

None of these are laws, but they settle most day-to-day decisions.

  • If a file must play in a browser, on a phone and on a television, encode H.264 in MP4 with AAC audio and stop worrying.
  • If a file is an archive master with several audio languages and subtitle tracks, MKV is the container that keeps them all in one place.
  • If you receive an AVI, convert it. The format predates every codec you would choose today.
  • If you are changing only the container, use a stream copy (remux). Re-encoding is for changing the codec, the resolution or the bitrate.

Frequently asked questions

Does converting MKV to MP4 lose quality?

Not if you remux. A remux copies the compressed video and audio streams into the new container without decoding them, so the picture is bit-identical. Quality is only at risk when you transcode, which means decoding and encoding again. Even then, a sensible bitrate keeps the loss invisible. Tools such as ffmpeg with the -c copy option do a remux in seconds.

Which format is best for uploading to VideoBB?

MP4 with H.264 video and AAC audio is the safest choice. It uploads reliably, and the transcoder starts at once. The small renditions come first, so the video can play while the larger ones are made. VideoBB also accepts MKV, AVI, MOV, WebM and several others up to 4 GB per file. So you do not have to convert first if the file you have is already high quality.

Why does my video play but have no sound?

Usually the player cannot decode the audio codec, while the video codec is fine. AC-3 or DTS audio inside an MP4 or MKV is a common cause in browsers. So is Opus inside an MP4 on older players. Re-encoding only the audio track to AAC, while copying the video, fixes it without touching picture quality.

Sources