Codec selection is the process of choosing a video or audio compression scheme for contribution, production, or delivery. Adjacent concepts include bitrate ladders, GOP structure, latency budget, error resilience, and decoder compatibility. For live streaming infrastructure engineers, codec choice determines CPU load on encoders, packetization behavior, CDN cache efficiency, and the failure modes you will debug at 3 a.m. It is not a checkbox in a transcoder profile. It is a decision that shapes your entire pipeline.

This article treats codec selection as a strategic decision. I will walk through the measurable tradeoffs between H.264, HEVC, AV1, and a few others, with attention to contribution, encoding, delivery, and failure forensics. Every claim here is tied to a packet capture, a command-line flag, or a metric you can reproduce.
Why Codec Choice Is a Business Decision Before It Is a Technical One
When you pick a codec, you are also picking a patent licensing posture, a hardware ecosystem, and a support burden. H.264 has broad decoder support and predictable licensing through MPEG LA. HEVC has better compression but fragmented licensing pools. AV1 is royalty-free but still maturing in hardware encode and low-latency use cases. These are not abstract concerns. They affect your per-stream cost, your device reach, and your ability to hire engineers who understand the failure modes.
For a live streaming infrastructure team, the strategic question is not “which codec compresses best?” but “which codec can we operate reliably at scale?” A 30% bitrate savings means nothing if your encoder farm needs 2.5x the CPU and your CDN edge caches cannot handle the new segment format.
Contribution: The First Mile Sets the Failure Budget
Contribution is the path from a camera or encoder to your ingest point. It is often the most fragile part of the pipeline because it runs over the public internet or a managed network with variable jitter and packet loss. Codec choice here affects how much damage a single lost packet can do.
H.264 in Contribution: Predictable, Dense, and Well Understood
H.264 remains the default for contribution because it is predictable. A 1080p60 H.264 feed at 12 Mbps is easy to reason about. You can inspect SPS and PPS in Wireshark, identify IDR frames by NAL unit type 5, and measure keyframe interval with a simple filter. If a packet is lost, the damage is usually contained to a single slice or frame, depending on your slicing configuration.
Command-line flags matter here. With x264, --sliced-threads changes how slices are packetized. With --tune zerolatency, you remove B-frames and reduce buffering, but you also lose some compression efficiency. These are not cosmetic choices. They change the packet size distribution and the burstiness of your contribution stream.
HEVC in Contribution: Better Compression, More Fragile Slices
HEVC can reduce contribution bitrate by 30–40% compared to H.264 at the same visual quality. But HEVC’s coding tree units and more complex slice structures mean a single lost packet can affect a larger spatial area. In a packet capture, you will see larger NAL units and more variable slice sizes. If your contribution path has 0.5% packet loss, HEVC may show visible artifacts where H.264 would not.
For contribution over SRT or RIST, HEVC is viable if you enable retransmission and have enough latency budget. But you must test with real packet loss patterns, not just clean lab conditions. I have seen HEVC contribution fail on a network that H.264 handled without issue, simply because the larger NAL units exceeded the path MTU and triggered fragmentation.
AV1 in Contribution: Not Yet a Default
AV1 is not a practical contribution codec for most live workflows today. Software encoding is too slow for real-time 1080p60 on commodity hardware. Hardware encoders exist but are not widely deployed in contribution encoders. If you are building a contribution pipeline, AV1 is a future consideration, not a current default.
Encoding: CPU, Latency, and the Bitrate Ladder
Encoding is where codec choice hits your infrastructure budget directly. A codec that requires 2x the CPU per stream doubles your encoder farm cost. A codec that adds 200 ms of encode latency may break your interactive use case.

H.264 Encoding: The Workhorse with Known Limits
H.264 encoding is fast and well optimized. On a modern x86 server, a single core can encode multiple 1080p30 streams in real time using x264 with --preset veryfast. The tradeoff is bitrate. H.264 needs more bits than HEVC or AV1 for the same quality, which increases your egress costs and CDN storage.
For live encoding, the bitrate ladder is a strategic artifact. A typical H.264 ladder for 1080p might be 8 Mbps, 5 Mbps, 3 Mbps, 1.5 Mbps, 800 kbps, 400 kbps. Each rung is a separate encode. If you switch to HEVC, you can lower each rung by 30–40% and keep the same quality. But you must verify that your CDN and players support HEVC in all target markets.
HEVC Encoding: The Cost of Efficiency
HEVC encoding is 2–4x more CPU-intensive than H.264 for the same resolution and frame rate. With x265, --preset medium is often too slow for live 1080p60 on a single core. You may need --preset ultrafast or hardware encoders like NVIDIA NVENC or Intel QSV. Hardware encoders reduce CPU load but give you less control over rate control and slice structure.
The strategic question is whether the bitrate savings justify the hardware cost. If you are delivering to millions of viewers, a 30% bitrate reduction can save significant CDN egress fees. If you are delivering to a few thousand viewers, the encoder hardware cost may dominate.
AV1 Encoding: The Long-Term Play
AV1 software encoding is still too slow for most live use cases. SVT-AV1 has improved, but real-time 1080p60 encoding on a single core is not realistic. Hardware AV1 encoders are appearing in newer GPUs and ASICs, but they are not yet ubiquitous. If you are building a pipeline that will last five years, AV1 is worth prototyping now. If you need to ship next quarter, H.264 or HEVC is the safer choice.
Delivery: CDN Caching, Packaging, and Player Reach
Delivery is where codec choice meets the real world of CDNs, players, and device fragmentation. A codec that works in your lab may fail on a three-year-old Android phone or a smart TV with a buggy decoder.
H.264 Delivery: The Compatibility Baseline
H.264 in an MPEG-TS or fMP4 container is the most compatible delivery format. Every modern browser, mobile device, and set-top box can decode it. If you are delivering to a broad audience, H.264 is the baseline you cannot abandon. The cost is higher bitrate for the same quality, which means higher CDN egress and more storage.
For HLS and DASH, H.264 is typically packaged with AAC audio. The segment duration and keyframe interval are set in the encoder. A 2-second segment with a 2-second keyframe interval is common. If you increase segment duration to 6 seconds, you reduce manifest overhead but increase latency and the impact of a lost segment.
HEVC Delivery: The Fragmented Middle Ground
HEVC delivery is supported on most modern devices, but not all. Some older Android devices and many web browsers lack native HEVC decoding. Safari supports HEVC in HLS, but Chrome on Windows does not without hardware support. This fragmentation means you often need to maintain both H.264 and HEVC ladders, which doubles your encoding and storage costs.
HEVC in HLS uses the hvc1 or hev1 sample entry. The difference matters: hvc1 stores parameter sets in the sample description, while hev1 stores them in-band. Some players only support one or the other. This is the kind of detail that shows up in a support ticket, not a spec sheet.
AV1 Delivery: The Emerging Option
AV1 delivery is growing, especially for VOD. YouTube and Netflix use AV1 for some content. For live, AV1 is still rare. The main benefit is bitrate savings of 30–50% compared to H.264. The main risk is decoder support. Many devices lack hardware AV1 decoding, and software decoding can drain battery and cause frame drops.
If you are delivering to a controlled device fleet, AV1 may be viable. If you are delivering to the open web, AV1 is a progressive enhancement, not a replacement for H.264.
Failure Forensics: What Breaks When the Codec Changes
Codec changes do not fail in the encoder. They fail in the field. A player that cannot decode a stream, a CDN that mangles a manifest, a decoder that crashes on a specific NAL unit type. These failures are often intermittent and hard to reproduce.
Packet Capture as Ground Truth
When a codec-related failure occurs, the first step is a packet capture. For H.264, you can filter on NAL unit types in Wireshark. For HEVC, the NAL unit types are different, and the slice structure is more complex. For AV1, the bitstream is even more opaque without specialized tools.
A common failure mode is a player that requests a segment but cannot decode it. The segment may be valid, but the player’s decoder does not support the profile or level. For H.264, this often shows up as a mismatch between the SPS in the stream and the codec string in the manifest. For HEVC, the hvc1 vs hev1 distinction can cause the same symptom.
Latency and Buffering: The Hidden Cost of Efficiency
More efficient codecs often require more buffering. HEVC and AV1 use larger coding units and more complex prediction, which can increase decoder latency. If your use case is interactive, this added latency may be unacceptable. A 200 ms encode latency plus 200 ms decode latency plus network jitter can push you past the threshold where users notice.
Measure latency end to end, not just in the encoder. Use a test signal with a visible timestamp, capture the output, and measure the delay. This is the only way to know if a codec change will break your latency budget.

Strategic Framework: How to Choose Without Regret
Codec selection is a decision under uncertainty. You cannot test every device, every network, every player. But you can reduce the risk by asking the right questions.
Question 1: What Is Your Primary Constraint?
If your constraint is CPU, H.264 is the default. If your constraint is bandwidth, HEVC or AV1 may be worth the CPU cost. If your constraint is latency, avoid codecs that add buffering. Write down the constraint before you evaluate codecs. Otherwise, you will optimize for the wrong thing.
Question 2: What Is Your Device Reach?
If you must reach every device, H.264 is non-negotiable. If you can require a minimum device spec, HEVC or AV1 becomes viable. The more control you have over the client, the more aggressive you can be with codec choice.
Question 3: What Is Your Failure Budget?
Every codec has failure modes. H.264 fails predictably. HEVC fails in more complex ways. AV1 fails in ways that are still being discovered. If your team cannot debug a complex codec failure, choose a simpler codec. The cost of a codec is not just the bitrate. It is the operational burden.
FAQ
Is H.264 still a good choice for live streaming in 2025?
Yes. H.264 remains the most compatible and operationally predictable codec for live streaming. It is not the most efficient, but it is the safest default when device reach and reliability matter more than bitrate savings.
When should I consider HEVC for live contribution?
Consider HEVC for contribution when you have a controlled network path with low packet loss and a latency budget that allows for retransmission. HEVC can reduce contribution bitrate by 30–40%, but it is more sensitive to packet loss and requires more CPU for encoding.
Is AV1 ready for live streaming infrastructure?
Not as a default. AV1 is promising for VOD and controlled device fleets, but real-time software encoding is still too slow for most live workflows, and hardware decoder support is not universal. Prototype AV1 now, but do not bet your production pipeline on it yet.
How do I measure the real-world impact of a codec change?
Use packet captures to inspect NAL unit structure and packet size distribution. Measure end-to-end latency with a visible timestamp. Test with real packet loss patterns, not clean lab conditions. And monitor decoder errors on real devices, not just reference players.
This article is part of a series on live streaming infrastructure decisions. The next article will examine bitrate ladder design as a strategic artifact, including how to build ladders that survive real-world network conditions.








