Skip to content

Codec

Also called H.264, H.265, HEVC, AV1, video codec

What is a codec?

A codec is a method, or the software that implements it, for compressing and decompressing video or audio. The name joins coder and decoder. H.264 (AVC) is the most widely supported video codec, H.265 (HEVC) and AV1 compress more efficiently, and AAC is the common audio codec for online video.

A codec is not the same as a container. MP4, MOV and WebM are containers: files that hold encoded video, audio and subtitles together. An MP4 can hold H.264, H.265 or AV1 video. When a file will not play, the cause is often an unsupported codec inside a familiar container.

Newer codecs give the same quality at a lower bitrate, but they take more processing to encode and not every device or app supports them. Editing codecs such as ProRes keep more quality and are easier to edit, at the cost of very large files.

Why a codec matters

The right codec means a video plays everywhere and uploads without errors. H.264 in an MP4 is accepted by Instagram, TikTok, YouTube, LinkedIn, X and nearly every browser and phone, which is why it remains the safe default for marketing video.

Codec choice also affects how fast your site loads when you embed video. Efficient codecs like AV1 or HEVC can cut file sizes for web playback, which helps page speed, as long as you provide a fallback for devices that cannot play them.

How to pick a video codec

  1. For social uploads, export H.264 video with AAC audio in an MP4.
  2. For editing and archiving masters, use a high-quality codec such as ProRes or a high-bitrate H.264.
  3. For web embeds, consider AV1 or HEVC with an H.264 fallback.
  4. If a platform rejects a file, re-export as H.264 MP4 before trying anything else.

Codec FAQ

What is the difference between H.264 and H.265?

H.265 (HEVC) gives similar quality to H.264 at a noticeably smaller file size, but it is slower to encode and has patchier support in browsers and older devices. H.264 plays almost everywhere.

Is MP4 a codec?

No. MP4 is a container format. The codec is what compresses the video inside it, most often H.264.

What codec does YouTube use?

YouTube accepts many codecs on upload and re-encodes videos into its own formats, including VP9 and AV1 for playback. Uploading H.264 MP4 is the simplest option.

Related terms

Back to the glossary

Put the terms to work

OpenPromo reads your website and makes on-brand posts, reels and videos. It is open source: start online in a minute, or run it on your own server.