Video Codec

A video codec is a method used to encode and decode digital video. Most codecs compress the enormous amount of data in uncompressed footage so it can be recorded, edited, stored, uploaded, streamed, and played on practical devices.

The word comes from coder-decoder or compressor-decompressor. An encoder turns source frames into a coded bitstream. A decoder reconstructs images from that bitstream for editing or playback.

Common video codecs include H.264/AVC, H.265/HEVC, VP9, AV1, Apple ProRes, Avid DNxHR, and various camera RAW formats.

Codec vs. container vs. file extension

These terms are related but not interchangeable.

Term What it describes Examples
Codec How a video or audio track is encoded and decoded H.264, HEVC, VP9, AV1, ProRes, AAC, Opus
Container Package that holds tracks and metadata MP4, MOV, MKV, WebM
File extension Name suffix that often identifies the container .mp4, .mov, .mkv, .webm
Format Broad term that may refer to codec, container, specification, or delivery system "MP4 format," "HDR format," "YouTube format"

An .mp4 file might contain H.264 video and AAC audio, but another MP4 can contain HEVC video. The extension alone does not reveal every encoding detail.

A container can also hold multiple audio tracks, captions, timecode, chapters, color metadata, thumbnails, and other information.

Why video needs compression

Uncompressed video produces extremely high data rates because every frame contains many pixels, channels, and brightness values. Resolution, frame rate, and bit depth multiply the amount of information.

Codecs reduce that data by exploiting patterns such as:

  • Similar pixels within one frame.
  • Areas with little visible detail.
  • Similarities between consecutive frames.
  • Limits of human visual sensitivity.
  • Repeated colors and motion.
  • Information that can be represented more efficiently through mathematical transforms and prediction.

The goal is to preserve acceptable visual quality while reducing storage and transmission needs.

Lossy and lossless compression

Lossless compression reconstructs the encoded source exactly. It preserves all represented data but often produces larger files.

Lossy compression discards or approximates selected information to achieve much smaller files. Most delivery video is lossy.

Lossy does not automatically mean bad. A well-encoded file can look visually indistinguishable from the source at normal viewing conditions. Problems appear when compression is too aggressive, repeated many times, or poorly matched to the footage.

Common lossy artifacts include:

  • Blocking and smearing.
  • Banding in gradients.
  • Ringing around edges.
  • Loss of grain and texture.
  • Muddy motion.
  • Color breakup.
  • Flickering detail between frames.

Intraframe vs. interframe codecs

Compression type How it works Strength Limitation
Intraframe Compresses each frame largely as an independent image Responsive editing and frame-accurate access Larger files at similar quality
Interframe Stores some complete frames and predicts changes across nearby frames Efficient storage and delivery More decoding work and less responsive editing

ProRes and DNxHR are commonly used as intraframe editing or intermediate codecs. H.264, HEVC, VP9, and AV1 commonly use interframe compression for recording or delivery, although their specifications can support varied structures.

An interframe sequence may include:

  • I-frames or keyframes: Independently decodable reference frames.
  • P-frames: Predict from earlier frames.
  • B-frames: Can use information from frames before and after.
  • GOP: Group of pictures between keyframe structures.

Longer prediction structures can improve efficiency but increase decoding complexity and make damaged or incomplete streams harder to recover.

Common video codecs for creators

Codec Typical use Main advantage Main tradeoff
H.264 / AVC Cameras, uploads, streaming, social video Broad hardware and software compatibility Less efficient than newer codecs
H.265 / HEVC 4K, HDR, cameras, efficient delivery Better compression efficiency than H.264 Licensing and device/software compatibility vary
VP9 Web video and platform delivery Efficient open web playback Slower encoding and less common camera capture
AV1 Modern web delivery and some recording/streaming High compression efficiency and royalty-free design Encoding and older-device support can be demanding
ProRes Editing, acquisition, masters Smooth editing and strong quality Large files
DNxHR / DNxHD Editing, interchange, masters Editing-focused performance and predictable variants Larger than delivery codecs
Camera RAW High-end acquisition and grading Greater flexibility and sensor-level data Storage, processing, and workflow complexity

No codec is best for every stage. A creator may record in one codec, create proxies in another, export a high-quality master, upload H.264, and have the platform deliver several viewer-facing codecs.

H.264 / AVC

H.264, also called AVC, remains widely used because it balances quality, file size, encoding speed, and compatibility.

YouTube's current general upload recommendation specifies:

  • MP4 container.
  • H.264 video.
  • Progressive scan.
  • High Profile.
  • Variable bitrate.
  • 4:2:0 chroma subsampling.
  • A closed GOP with the recommended structure listed in its Help documentation.

H.264 is often a safe creator export when reliable playback and straightforward uploading matter more than maximum compression efficiency.

H.265 / HEVC

HEVC was designed to compress video more efficiently than H.264, especially at high resolutions. Cameras often use it for 4K, 10-bit, and HDR recording.

Advantages can include:

  • Smaller files at comparable visual quality.
  • Strong efficiency for 4K and HDR.
  • Support for modern bit depths and color formats.

Limitations can include:

  • Heavier decoding and editing load.
  • Inconsistent support on older devices and software.
  • Licensing considerations.
  • Hardware acceleration that depends on the exact profile, level, and bit depth.

A computer may play one HEVC file smoothly but struggle with another because "HEVC" covers multiple configurations.

VP9

VP9 is an open video codec developed for efficient web delivery and is widely associated with online video platforms. It supports high resolutions and HDR profiles.

Creators do not usually need to export VP9 for a routine SDR YouTube upload because YouTube accepts and re-encodes common high-quality sources. VP9 is more relevant when understanding web playback, platform processing, or specialized export workflows.

YouTube's upload page notes that a browser or device needs VP9 support to view new 4K uploads in 4K, but that does not mean the creator can guarantee a particular playback codec merely by changing the upload resolution.

AV1

AV1 is a modern royalty-free codec designed for efficient internet video. It can deliver strong quality at lower bitrates than older codecs in many situations.

Potential benefits include:

  • Efficient web delivery.
  • Growing hardware decode and encode support.
  • Use in high-resolution and bandwidth-sensitive playback.
  • Support in YouTube's current live-ingest options for suitable SDR configurations.

Potential limitations include:

  • Slow software encoding at high-quality settings.
  • Uneven support on older hardware.
  • Editing applications that may depend on hardware decoding.
  • Different feature support for SDR, HDR, live ingest, and upload workflows.

The newest codec is not automatically the best export choice if the creator's editor, client, device, or deadline cannot support it efficiently.

ProRes and DNxHR

ProRes and DNxHR are families of high-quality codecs designed for production and post-production. Their intraframe structure generally makes timeline seeking and editing easier than highly compressed long-GOP delivery codecs.

They are useful for:

  • Camera acquisition.
  • Intermediate renders.
  • Visual-effects handoffs.
  • Color-grading masters.
  • Archival mezzanine files.
  • Cross-application interchange.

Their files can be much larger than H.264, HEVC, VP9, or AV1. A large editing codec is not inherently higher resolution; it preserves data with less aggressive compression and a workflow-friendly structure.

Codec profiles, levels, and settings

A codec name alone is incomplete. Important configuration details include:

  • Profile: Set of coding features, bit depth, and color capabilities.
  • Level: Limits such as resolution, bitrate, and decoding complexity.
  • Bit depth: Commonly 8-bit, 10-bit, or higher.
  • Chroma subsampling: Such as 4:2:0, 4:2:2, or 4:4:4.
  • GOP and keyframe interval: Prediction structure across time.
  • Entropy and reference settings: Compression tools and complexity.
  • Hardware or software encoder: Implementation used to create the stream.

A device might support H.264 8-bit 4:2:0 but not a less common H.264 10-bit or 4:2:2 profile. "The codec is supported" does not guarantee every variation is supported.

Codec and bitrate work together

A codec determines how the data is compressed; video bitrate describes how much data is allocated over time. A more efficient codec may reach a similar quality at a lower bitrate, but results vary by content, encoder, preset, and metric.

High motion, film grain, foliage, confetti, and detailed game footage are harder to compress than a static presenter against a clean background.

Bitrate should therefore be evaluated together with:

  • Resolution.
  • Frame rate.
  • Source noise.
  • Codec and profile.
  • Encoding speed or preset.
  • Intended viewing conditions.

Editing performance and proxy media

Highly compressed interframe footage can be difficult to edit even when the file is small. The computer must decode frame relationships to display an arbitrary timeline position.

Creators can improve editing by:

  • Using hardware-accelerated decoding.
  • Recording in an editing-friendly codec when practical.
  • Transcoding to ProRes or DNxHR.
  • Creating lower-resolution proxy files.
  • Reducing intensive effects during the edit.
  • Keeping source and cache files on fast storage.

Proxy files do not replace the originals. The editor uses lightweight copies for performance and reconnects to full-quality media for export.

YouTube upload codec guidance

For routine uploads, YouTube currently recommends H.264 video in an MP4 container. It also accepts many other formats and re-encodes uploaded material.

YouTube's HDR guidance lists tested containers including MOV/QuickTime, MP4, and MKV, and recommends codecs such as VP9 Profile 2, AV1, and HEVC/H.265 for suitable 10-bit HDR files. It also lists high-quality production codecs that can work at much larger bitrates.

The best upload file is not simply the smallest file that YouTube accepts. YouTube encourages high-quality source material because every upload is processed again.

Upload codec vs. playback codec

YouTube always re-encodes uploads to optimize playback. It creates versions for different resolutions, network conditions, device capabilities, and delivery systems.

Therefore:

  • Uploading H.264 does not mean every viewer receives H.264.
  • Uploading AV1 does not force AV1 playback on unsupported devices.
  • Renaming a file extension does not change the codec.
  • Upscaling solely to chase a rumored codec is not a guaranteed platform rule.
  • Playback information shown in diagnostic tools describes that viewing session, not necessarily every rendition of the video.

Creators should optimize the upload source rather than trying to control an undocumented allocation decision.

Codec vs. container errors

Common compatibility problems include:

  • A supported MP4 container holding an unsupported codec profile.
  • A file extension that was renamed without re-encoding.
  • Missing audio because the audio codec is unsupported.
  • 10-bit or 4:2:2 footage that lacks hardware decoding.
  • Variable-frame-rate recordings causing sync or editing issues.
  • Corrupt metadata or incomplete file writing.
  • An editing application supporting playback but not export for the same codec.

A media-inspection tool can reveal the actual container, codec, profile, frame rate, color metadata, and bitrate.

Choosing a codec

Ask:

  1. Is the file for recording, editing, mastering, upload, livestreaming, or long-term storage?
  2. Which devices and applications must decode it?
  3. Is small file size or fast editing more important?
  4. Does the system support hardware encoding and decoding for the exact profile?
  5. Is HDR or 10-bit color required?
  6. How much quality loss is acceptable?
  7. Are licensing or client-delivery requirements involved?
  8. What bitrate and processing time are practical?

A common creator workflow is to record the highest practical quality, edit with originals or proxies, archive a strong master, and export a compatible delivery file for YouTube.

Common video codec mistakes

  • Calling MP4 a codec rather than a container.
  • Assuming all .mp4 files contain H.264.
  • Renaming .mov to .mp4 and expecting a conversion.
  • Choosing the newest codec without checking decode support.
  • Editing highly compressed long-GOP footage on underpowered hardware without proxies.
  • Comparing file sizes without comparing codec, bitrate, resolution, or frame rate.
  • Assuming 10-bit support means every profile and chroma format will work.
  • Using a delivery codec as the only long-term master.
  • Re-encoding several times at low quality.
  • Believing an upload codec forces YouTube to use the same viewer-facing codec.
  • Confusing an audio codec with the video codec inside the same container.

Creator finances handled by someone who gets YouTube.

Tax prep and bookkeeping built for YouTubers — every income stream, every deduction, done right.

Tax Services for Creators   Bookkeeping for Creators

Frequently asked questions

Is MP4 a video codec?

No. MP4 is a container. It can hold video encoded with codecs such as H.264 or HEVC, plus audio and metadata.

Which codec is best for YouTube uploads?

YouTube's current general recommendation is H.264 video in an MP4 container. Other high-quality supported sources can also work, and YouTube re-encodes every upload.

Is H.265 better than H.264?

HEVC can provide better compression efficiency, especially for 4K and HDR, but it may be harder to edit and less compatible with older systems. H.264 remains a strong choice when broad support matters.

Does YouTube use the codec I upload?

The upload codec becomes the source for processing. YouTube then creates its own playback versions, so viewers may receive different codecs depending on the video, device, and playback conditions.