What Is a Video Codec? H.264, HEVC and AV1 Explained
A video codec is the method used to squeeze a video's pictures into a file. Learn H.264, HEVC and AV1, and why a video sometimes won't play.
Published · 5 min read
A video codec is the method a camera or app uses to compress a video's pictures so they fit in a file, and the method a player uses to unpack them again. H.264, HEVC (H.265) and AV1 are the codecs you'll meet most. If a device doesn't know the codec inside a file, the video won't play, even when the file ends in .mp4. Our MOV to MP4 converter re-encodes such videos to H.264, the codec almost everything can play.
Codec vs container: two different things
Every video file has two layers, and mixing them up causes most "why won't this play?" confusion.
- The container is the file format you see in the name: .mp4, .mov, .mkv, .webm, .avi. It's a box that holds a video track, one or more sound tracks, sometimes subtitles, and details such as the length.
- The codec is how the pictures (and, separately, the sound) inside that box were compressed. The file name doesn't tell you which codec was used.
So an .mp4 can hold H.264 video or HEVC video. A .mov from an iPhone can hold either too. Two files with the same ending can behave completely differently on the same TV or laptop.
Why video needs a codec at all
Uncompressed video is enormous. One 1080p frame is 1920 × 1080 pixels, about 2 million pixels, and with three colour values each that's around 6 MB per frame. At 30 frames a second, one minute would be over 10 GB. A phone records the same 1080p minute in well under 100 MB because the codec:
- Keeps only the changes between frames. In a talking-head video, the wall behind the speaker barely changes, so it's stored once and reused.
- Drops detail your eye barely notices, the same idea as a JPG photo. That makes video codecs "lossy"; see lossy vs lossless compression for how that works in images.
The codecs you'll actually meet
| Codec | Also called | Where you see it | Plays on |
|---|---|---|---|
| H.264 | AVC | Most MP4 files, web video, older phones, cameras, screen recorders | Practically everything made in the last 15 years |
| HEVC | H.265 | iPhones set to High Efficiency, many newer Android phones, 4K cameras | Recent phones and Macs; some Windows PCs, browsers and TVs need extra support |
| AV1 | Streaming sites, some newer screen recorders and web downloads | Recent browsers and newer devices; older hardware may struggle | |
| VP9 | WebM files, web video, some downloads | Most browsers and Android; less common in editors |
The pattern is simple: newer codecs make smaller files at the same quality, and older codecs play in more places. HEVC is often described as giving similar quality to H.264 at roughly half the size, which is why phones use it, but support for it varies. H.264 is the safe choice when you don't know what the other person's device can handle.
Sound has codecs too. MP4 files usually carry AAC sound; WebM and MKV often carry Opus or Vorbis. A video that plays with a picture but no sound usually has a sound codec the player doesn't support.
Why a video "won't play"
When a video fails, the symptom hints at the cause:
- "File format not supported" or nothing happens. The device doesn't recognise the container, for example an MKV on a phone gallery app.
- Sound but a black or frozen picture. The container is fine, but the video codec (often HEVC or AV1) isn't supported on that device.
- Picture but no sound. The sound codec isn't supported.
- Plays on your phone, not on the office PC or the TV. Your phone has the decoder built in; the other device doesn't.
- An upload form rejects it. Many forms and learning platforms check for MP4 with H.264, the most widely accepted pairing.
Renaming the file (changing .mov to .mp4) only changes the label. The codec inside stays the same, so it usually doesn't fix anything.
How to fix it: convert to H.264 MP4
The reliable fix is to put the video into an MP4 container with H.264 video and AAC sound. The MOV to MP4 converter does exactly that, and it takes MOV, WEBM and most other formats your browser can open (MKV in Chrome or Edge), despite the name. AVI files usually can't be opened in a browser, so convert those another way first:
- Open MOV to MP4 and choose your video.
- Under Choose a file, pick your video (up to 1 GB and 30 minutes).
- Press Start, then Download result. Your MP4 is kept for 1 hour.
There are no settings because the converter looks at the codec for you. If the video is already H.264 at a sensible size, it's moved into an MP4 as it is, with no quality change. If it's HEVC, AV1, VP9 or anything else, it's re-encoded to H.264 at high quality, and anything larger than 1080p is scaled down to 1080p. Sound that MP4 doesn't usually carry is converted to AAC.
It's free for videos up to 5 minutes, with no daily limit; longer videos need Pro. The conversion runs on our servers: your video is uploaded, deleted as soon as it's converted, and the MP4 is deleted after 1 hour.
For iPhone videos specifically, see MP4 vs MOV and how to convert MOV to MP4. For MKV files with several sound or subtitle tracks, read MKV vs MP4 first.
Codecs and file size
A newer codec is the main reason a 4K HEVC clip can be smaller than a 1080p H.264 one. Converting HEVC to H.264 for compatibility can therefore make the file bigger. If you need a small file to send, the video compressor also outputs H.264 MP4, and its Compression setting (Smallest file, Balanced or Best quality) controls the size. See how to compress a video for WhatsApp and email.
Make it play everywhere
When a video refuses to play, convert it to an H.264 MP4 with MOV to MP4. Videos up to 5 minutes are free.
Frequently asked questions
- Is MP4 a codec?
- No. MP4 is a container, the file format. The codec is what's inside, most often H.264 or HEVC for the picture and AAC for the sound.
- Which video codec is best?
- For playing everywhere, H.264. For the smallest file at good quality, HEVC or AV1, as long as every device that needs to play it supports them.
- Why does my video play on my phone but not on my PC?
- Your phone probably recorded in HEVC and has a built-in decoder; the PC may not. Converting to H.264 MP4 fixes it.
- How can I tell which codec a video uses?
- Desktop players such as VLC show it under media or codec information. On a Mac, QuickTime's Movie Inspector shows it too.
- Does converting to H.264 lose quality?
- If the video is already H.264, our converter moves it into an MP4 unchanged. Otherwise it's re-encoded at high quality, which looks the same to most viewers.
Video tools
Try MOV to MP4
Free, no sign-up, no daily limit. Convert MOV to MP4, including iPhone videos, as well as MKV and WebM.
Also useful
- Compress VideoCompress a video to make the file smaller for email, messaging apps or uploading. Pick Smallest file, Balanced or Best quality and download an MP4 at up to 1080p. Works with MP4, MOV and WEBM videos.
- Trim VideoTrim a video to just the part you want: enter a start and end time, to a tenth of a second, and download the clip as an MP4. The cut lands exactly where you set it. Takes videos up to 1 GB and 30 minutes.