Videos · Glossary
What is a video codec?
A video codec is the method used to compress video into a much smaller stream and decompress it again for playback. H.264, H.265, VP9 and AV1 are codecs. A codec is different from the file format, or container, such as MP4 or WebM, which holds the compressed video together with audio and other information.
People say MP4 when they mean H.264, and that confusion produces files that open on one device and fail on another. Knowing which part is the codec and which is the container makes those failures quick to diagnose.
Nuwan Madhusanka · Co-founder
5 min read · Published
| Codec | Also called | Common containers | Licensing and browser support |
|---|---|---|---|
| H.264 | AVC, MPEG-4 Part 10 | MP4, MOV, 3GP | Patent licensed; plays in all major browsers |
| H.265 | HEVC, MPEG-H Part 2 | MP4, MOV | Patent licensed; browser support depends on hardware and platform |
| VP9 | Video Processor 9 | WebM, MP4 | Open and royalty free; all major browsers |
| AV1 | AOMedia Video 1 | WebM, MP4 | Royalty free; Safari needs a hardware decoder |
Compression, separate from the file
Uncompressed video is enormous. A single 1080p frame with 8 bits for each of three colour channels is about 6 megabytes, so one second at 30 frames would be close to 190. A codec, short for coder and decoder, shrinks that by describing what changes instead of storing every pixel of every frame. The common codecs are published standards. The ITU publishes H.264, known as Advanced Video Coding, and H.265, known as High Efficiency Video Coding, while the Alliance for Open Media publishes AV1. The container is a separate layer on top. An MP4 file can hold H.264, HEVC, VP9 or AV1 video, and the file extension alone never tells you which codec is inside it.
How a codec compresses
Most video codecs share one design. Some frames are stored whole as key frames, and most of the rest are stored as predictions: this block of pixels matches a block in an earlier frame, shifted slightly, plus a small correction. MDN's reference describes AVC as a motion compensation based codec for exactly this reason. Newer codecs add larger and more flexible blocks, better predictions and cleverer ways to discard detail the eye will not miss. MDN notes that HEVC can in theory produce files half the size of AVC at comparable quality, and that AV1 achieves compression as much as 50 percent better than AVC. The trade is effort: newer codecs take more computing power to encode, and smooth playback often needs hardware decoding.
When the choice matters
It matters for compatibility first. H.264 plays in all major browsers and on almost every device, which is why it remains the safe choice for a file that will be uploaded, emailed or embedded by someone else. It matters for licensing. MDN describes AVC and HEVC as proprietary formats covered by patents, with licensing managed through patent pools, while VP9 and AV1 are royalty free. It matters for file size at high resolutions, where HEVC and AV1 save the most. And it matters for how long the encode takes, since the most efficient codecs are also the slowest to produce. For uploads to platforms that re-encode everything anyway, compatibility usually beats efficiency, because the platform decides what viewers finally receive.
Common mistakes
Treating the file extension as the codec is the first, and it explains most files that play on a laptop but not on a phone. Check the codec with a media information tool before blaming the file. The second is sending HEVC to a client or a platform without checking their playback, since support still varies by device, operating system and browser. The third is converting again and again between codecs, losing a little detail at every generation. The fourth is using an editing codec, a large intermediate format built for smooth scrubbing on a timeline, as the delivery file. Such files are excellent in the edit and far too heavy to send, stream or upload over an ordinary connection. The fifth is choosing a codec for the smallest possible file without testing playback on a modest, older phone, which is often where a new codec first fails in front of a real viewer.
Where it shows up in the product
The video builder here exports H.264 video in an MP4 container at 30 frames per second, with no codec choice to make. That is the most widely playable combination, so the file can go straight to a social platform, a website or an email. Uploaded clips are accepted as MP4, WebM or MOV files up to 200 MB, and can be trimmed and set to cover or fit their box. Because the builder plays clips in the browser, a clip using a codec the browser cannot decode is the likely cause of one that refuses to play, and re-exporting it as an H.264 MP4 is the dependable fix. The presentation recorder in the slides module is the one place that writes WebM, using VP9 or VP8 video with Opus audio.
Questions people ask
Is MP4 a codec?
No. MP4 is a container, a file format that packages video, audio and information such as duration and subtitles. The video inside an MP4 is most often H.264, but it can also be HEVC, VP9 or AV1. Two MP4 files can therefore behave differently on the same device, because the codecs packed inside them are different.
Should I export in H.265 to save space?
Only when you know every place the file will play supports it. HEVC can produce smaller files than H.264 at similar quality, but playback support still varies with hardware, operating system and browser. For a file you send to other people, or upload to a platform that re-encodes it, H.264 remains the lower risk choice.
What is AV1 designed for?
The Alliance for Open Media designed AV1 specifically for internet video, as an open and royalty free codec with stronger compression than VP9 and HEVC. It suits large scale delivery, where smaller files save bandwidth. Encoding it is slower than older codecs, and on Apple devices Safari plays it only where the hardware includes an AV1 decoder.
Why is my exported file so large?
Usually the export used an editing codec rather than a delivery one, or a data rate far higher than the content needs. Delivery codecs such as H.264 are designed for compact files. If the export settings list an intermediate format or a very high bitrate, switch to an H.264 MP4 at a sensible quality setting and compare the results.
Does the codec affect picture quality?
Yes, at a given file size. A more efficient codec keeps more detail in the same number of bits, which is why newer codecs look better at low bitrates. At generous bitrates the difference shrinks, and a well encoded H.264 file can look indistinguishable from HEVC. Detail lost in an earlier encode cannot be restored by a better codec.
Make one with videos
The button opens the generator with this use case already described. Change the wording to match your own.
Create a video with OneCraftRelated questions
- MP4 vs MOV vs WebM: which video file should you use?MP4 vs MOV vs WebM: how the three video containers differ in origin, codecs and playback support, and which one to use for editing, uploading and the web.
- What is video bitrate?What is bitrate in video? How Mbps affects quality and file size, constant versus variable bitrate, recommended upload rates, and common export mistakes.
- What is frame rate?What is frame rate? What 24, 30 and 60 fps each look like, why the rate should stay constant from shoot to export, and which rate suits which video.
Step by step in the builder: Export one video for YouTube, Reels and TikTok.
Written and checked by the OneCraft team. Last checked .