What Is a Video Codec?

A codec (compressor-decompressor) is the algorithm that compresses raw video data into a manageable file size and decompresses it for playback. The container format (MP4, WebM, MKV) is the file wrapper; the codec is the actual compression method inside it.

The same video encoded with different codecs produces different file sizes, visual quality levels, and compatibility profiles. Choosing the right codec is one of the most impactful decisions in video production.

H.264 (AVC): The Universal Standard

H.264 is the most widely supported video codec in existence. Released in 2003, it has had over two decades of optimization and is supported by virtually every device, browser, and media player.

  • Compression efficiency: Good. Baseline for comparison.
  • Encoding speed: Fast. Decades of optimization make H.264 encoders very efficient.
  • Browser support: Universal. Every browser supports H.264.
  • Hardware acceleration: Ubiquitous. Virtually every GPU and mobile SoC includes H.264 decode hardware.
  • Container: MP4, MKV
  • Licensing: Patented, royalties required for commercial use (though free for internet video delivery).

Best for: Maximum compatibility. Short clips, social media content, any situation where you need confidence that the video will play everywhere.

H.265 (HEVC): Better Compression, Less Compatibility

H.265 succeeds H.264 with roughly 40-50% better compression at equivalent quality. The trade-off is more complex licensing, slower encoding, and narrower browser support.

  • Compression efficiency: Very good. ~40-50% smaller files than H.264 at equivalent quality.
  • Encoding speed: Moderate. 2-5x slower than H.264 depending on settings.
  • Browser support: Partial. Safari has native support. Chrome and Edge support it on systems with hardware decoders. Firefox support is limited.
  • Hardware acceleration: Common on modern devices but not universal.
  • Container: MP4, MKV
  • Licensing: Complex patent landscape with multiple licensing pools.

Best for: Apple ecosystem delivery, high-resolution video where file size matters, and contexts where you know the playback device supports HEVC.

VP8: Google's First Open Codec

VP8 was released by Google in 2010 as a royalty-free alternative to H.264. It offers comparable compression to early H.264 profiles. While largely superseded by VP9, it remains relevant for WebM video in contexts requiring broad compatibility with older browsers.

  • Compression efficiency: Comparable to H.264 baseline profile.
  • Encoding speed: Fast.
  • Browser support: Chrome, Firefox, Edge, Opera. Not Safari.
  • Container: WebM
  • Licensing: Royalty-free.

Best for: WebM delivery where VP9 encoding is too slow, or targeting older browser versions that support VP8 but not VP9.

VP9: YouTube's Workhorse

VP9 is Google's successor to VP8, offering compression efficiency comparable to H.265 while remaining royalty-free. It is the codec YouTube uses for most of its video delivery.

  • Compression efficiency: Very good. Comparable to H.265, ~30-40% better than H.264.
  • Encoding speed: Slow. VP9 encoding is notably slower than H.264.
  • Browser support: Chrome, Firefox, Edge, Opera. Safari added VP9 support in recent versions.
  • Hardware acceleration: Common on modern devices, especially those designed for YouTube playback.
  • Container: WebM, MKV
  • Licensing: Royalty-free.

Best for: Web video delivery where file size matters and H.264 is too large. The go-to choice for WebM format output.

AV1: The Future Standard

AV1 is developed by the Alliance for Open Media (whose members include Google, Mozilla, Apple, Microsoft, Amazon, and Netflix). It offers the best compression efficiency of any widely supported codec, at the cost of very slow encoding.

  • Compression efficiency: Excellent. ~30% better than VP9/H.265, ~50% better than H.264.
  • Encoding speed: Very slow. Encoding can be 10-20x slower than H.264. Real-time encoding requires hardware support.
  • Browser support: Chrome, Firefox, Edge, Opera, and Safari (recent versions). Growing rapidly.
  • Hardware acceleration: Decode hardware is becoming common in chips released after 2022. Encode hardware is still emerging.
  • Container: WebM, MP4, MKV
  • Licensing: Royalty-free.

Best for: Maximum compression when encoding time is not a constraint. Video streaming services, bandwidth-sensitive applications, and archival encoding.

Side-by-Side Comparison

For a typical 1080p, 30fps video clip:

  • H.264: 100% (baseline file size)
  • VP8: ~95-100% of H.264
  • H.265: ~50-60% of H.264
  • VP9: ~55-65% of H.264
  • AV1: ~40-50% of H.264

These are rough averages. Actual results vary with content type, encoder settings, and target bitrate.

Choosing a Codec: Decision Framework

  • Need universal playback? H.264 in MP4. Nothing else comes close to compatibility.
  • Need small files, royalty-free? VP9 in WebM. The best balance of compression, compatibility, and licensing.
  • Targeting Apple devices? H.265 in MP4. Native hardware acceleration on all Apple devices.
  • Maximum compression, time is no object? AV1 in WebM or MP4. Best compression available.
  • WebM with fast encoding? VP8. When VP9 encoding is too slow for your workflow.

Encoding in the Browser

FastEdit supports all five codecs (H.264, H.265, VP8, VP9, AV1) for browser-based encoding via WebAssembly. This means you can convert between codecs, trim video, apply effects, and export in any codec/container combination without installing software or uploading files to a server.

Encoding speed in the browser depends on your device hardware. H.264 and VP8 encode quickly on most machines. VP9 and H.265 are noticeably slower. AV1 is the slowest but produces the smallest files. FastEdit exposes encoding parameters (CRF, bitrate, preset) so you can tune the speed/quality trade-off for your needs.