H.264 is a lossy video compression standard that reduces raw video file sizes by up to 80% compared to uncompressed formats while preserving visual fidelity. The ITU-T Video Coding Experts Group and ISO/IEC Moving Picture Experts Group jointly released H.264 in May 2003 as the successor to MPEG-2. H.264 is also called Advanced Video Coding (AVC) and MPEG-4 Part 10. These 3 names refer to the same compression technology.
Over 90% of all streaming video delivered globally uses H.264 encoding. According to Bitmovin research from their Video Developer Report, in 2024, H.264 maintains 98.23% browser compatibility across desktop and mobile platforms. This universal reach makes H.264 the default codec for live streaming, video conferencing, surveillance, and on-demand video delivery.
Despite newer codecs like H.265, VP9, AV1, and VVC (H.266) offering 35-65% better compression efficiency, H.264 dominates because of 3 factors: universal hardware decoder support in devices manufactured since 2010, real-time encoding speed that outperforms all successor codecs by 3x to 40x, and mandatory support in HLS, WebRTC (per RFC 7742), and RTMP, plus universal compatibility with DASH and CMAF.
This guide breaks down H.264 compression mechanics, profile configurations, bitrate requirements across resolutions, protocol compatibility, and encoding best practices for live streaming infrastructure with Ant Media Server.
Table of Contents
What is H.264 (AVC)?

H.264 is a block-oriented, motion-compensated video compression standard developed jointly by the ITU-T Video Coding Experts Group (VCEG) and ISO/IEC Moving Picture Experts Group (MPEG). The ITU-T designated the standard as H.264. MPEG designated the same standard as MPEG-4 Part 10 Advanced Video Coding (AVC). H.264 and AVC refer to identical compression technology used interchangeably across the streaming industry.
The H.264 standard defines the compressed bitstream format and the decoding process. H.264 does not specify how encoding must be performed. This design allows hardware and software manufacturers to create their own H.264 encoder implementations. Notable H.264 encoder implementations include x264 (open-source, used in FFmpeg and OBS Studio), NVIDIA NVENC (GPU-accelerated hardware encoder), Intel Quick Sync (CPU-integrated hardware encoder), and Apple VideoToolbox (macOS/iOS hardware encoder).
H.264 replaced MPEG-2 as the primary broadcast and streaming video codec by delivering equivalent visual quality at 50% lower bitrates. A 1080p stream encoded with MPEG-2 requires approximately 12,000 kbps. The same 1080p stream encoded with H.264 achieves equivalent quality at 4,500-6,000 kbps. This 50% bitrate reduction translates directly into lower bandwidth costs and broader viewer reach.
Every device category manufactured since 2010 includes dedicated H.264 hardware decoders: smartphones (iOS and Android), tablets, smart TVs, streaming sticks, gaming consoles, set-top boxes, desktop computers, and laptops. The H.264 codec for Windows 10/11 is included in the operating system. macOS natively supports H.264 decoding and encoding. This universal hardware acceleration means H.264 playback requires minimal CPU resources across all platforms.
How Does H.264 Compression Work?
H.264 compression operates through 3 core techniques: inter-frame prediction, intra-frame prediction, and entropy coding. These 3 techniques work together to eliminate redundant visual data from raw video.
How Does Inter-Frame Prediction Remove Temporal Redundancy?
Inter-frame prediction analyzes motion between consecutive frames. H.264 divides each frame into macroblocks of 16×16 pixels. The codec identifies which macroblocks moved between frames and stores only the motion vectors instead of complete pixel data. A 10-second clip at 30 fps contains 300 frames. Inter-frame prediction compresses these 300 frames by storing the reference frame (I-frame) plus motion difference data for subsequent predicted frames (P-frames and B-frames).
H.264 supports variable block sizes from 16×16 down to 4×4 pixels for motion estimation. Smaller block sizes capture fine motion detail at higher computational cost. Larger blocks work well for uniform motion like camera pans.
How Does Intra-Frame Prediction Compress Individual Frames?
Intra-frame prediction compresses individual frames by referencing neighboring pixel blocks within the same frame. H.264 supports 9 directional prediction modes for 4×4 luma blocks and 4 modes for 16×16 blocks. Each mode predicts pixel values based on adjacent decoded samples, storing only the prediction residual.
What Role Does Entropy Coding Play in H.264 Compression?
Entropy coding applies mathematical compression to the prediction residuals and motion data. H.264 offers 2 entropy coding methods. Context-Adaptive Variable-Length Coding (CAVLC) provides moderate compression with lower computational cost. Context-Adaptive Binary Arithmetic Coding (CABAC) delivers 10-15% better compression than CAVLC at higher processing requirements.
How Does GOP Structure Affect H.264 Streaming Performance?
The Group of Pictures (GOP) structure defines how I-frames, P-frames, and B-frames are arranged. A typical live streaming GOP of 2 seconds at 30 fps contains 60 frames: 1 I-frame, 29 P-frames, and 30 B-frames. Shorter GOP intervals increase video bitrate but improve error recovery and reduce channel-change latency. Longer GOPs reduce bitrate but increase switching delay.
What are H.264 Profiles and Levels?
H.264 profiles define which compression tools the encoder uses, while levels set maximum resolution, frame rate, and bitrate constraints. Selecting the correct profile-level combination determines device compatibility, encoding efficiency, and playback reliability.
What are the 4 Primary H.264 Profiles?
The following table compares the 4 primary H.264 profiles by compression tools, efficiency, and target applications. The table displays encoding capabilities across Baseline, Main, High, and High 10 profiles with 10 feature dimensions.
| Feature | Baseline Profile | Main Profile | High Profile | High 10 Profile |
|---|---|---|---|---|
| I and P slices | Yes | Yes | Yes | Yes |
| B slices | No | Yes | Yes | Yes |
| CABAC entropy coding | No | Yes | Yes | Yes |
| Weighted prediction | No | Yes | Yes | Yes |
| 8×8 transform | No | No | Yes | Yes |
| Quantization scaling matrices | No | No | Yes | Yes |
| Bit depth | 8-bit | 8-bit | 8-bit | 10-bit |
| Compression gain vs Baseline | Reference | +10-15% | +15-25% | +20-30% |
| Primary use case | Mobile, video calls | Broadcast TV | HD/4K streaming | HDR content |
Baseline Profile excludes B-frames and CABAC, making Baseline Profile streams decodable on the lowest-power processors. Mobile video calls and legacy device playback use Baseline Profile encoding.
Main Profile adds B-frames and CABAC entropy coding. Broadcast television and standard streaming workflows use Main Profile. The B-frame support in Main Profile provides 10-15% bitrate reduction compared to Baseline Profile at equivalent quality.
High Profile enables 8×8 integer transforms and custom quantization matrices. High Profile achieves 15-25% bitrate savings over Baseline Profile. Modern streaming platforms, Blu-ray discs, and HD broadcast systems default to High Profile encoding. All devices manufactured after 2012 support High Profile Level 4.1 decoding.
What H.264 Levels Define Resolution and Bitrate Limits?
Levels constrain maximum resolution, frame rate, and bitrate within each profile. The following table shows 5 common H.264 levels with specific parameter limits for streaming applications across 5 columns.
| Level | Max Resolution | Max Frame Rate | Max Bitrate (High Profile) | Typical Application |
|---|---|---|---|---|
| 3.0 | 720×480 | 30 fps | 10 Mbps | SD mobile streaming |
| 3.1 | 1280×720 | 30 fps | 14 Mbps | HD mobile, tablets |
| 4.0 | 2048×1024 | 30 fps | 20 Mbps | HD broadcast |
| 4.1 | 2048×1024 | 30 fps | 50 Mbps | Full HD streaming |
| 5.1 | 4096×2304 | 30 fps | 300 Mbps | 4K delivery |
Encoding at High Profile Level 4.1 provides compatibility with all devices manufactured after 2012 while maximizing compression efficiency for 1080p content.
What Bitrate Does H.264 Require for Each Resolution?
H.264 bitrate requirements vary by resolution, frame rate, and content complexity. The following table lists recommended H.264 bitrate ranges for 6 common streaming resolutions with 4 columns including typical file size per minute. These values apply to High Profile encoding with a 2-second GOP at the specified frame rate.
| Resolution | Frame Rate | Recommended Bitrate Range | Typical File Size (per minute) |
|---|---|---|---|
| 426×240 (240p) | 30 fps | 300-700 kbps | 2.2-5.2 MB |
| 640×360 (360p) | 30 fps | 400-1,000 kbps | 3.0-7.5 MB |
| 854×480 (480p) | 30 fps | 500-2,000 kbps | 3.7-15 MB |
| 1280×720 (720p) | 30 fps | 1,500-4,000 kbps | 11-30 MB |
| 1920×1080 (1080p) | 30 fps | 4,500-6,000 kbps | 33-45 MB |
| 3840×2160 (4K) | 30 fps | 13,000-34,000 kbps | 97-255 MB |
Fast-motion content like sports or gaming requires bitrates at the upper range. Static content like presentations or surveillance footage operates well at the lower range. YouTube specifies 4,500-6,000 kbps for 1080p at 30 fps with H.264 encoding as the recommended upload specification.
Adaptive bitrate streaming eliminates the single-bitrate guessing game. An adaptive bitrate ladder with 4-6 renditions (240p through 1080p) covers the full range of viewer bandwidth conditions. The player automatically selects the highest quality rendition that plays without buffering based on real-time network measurement.
Which Streaming Protocols Support H.264?
H.264 works with every major streaming protocol in active deployment. This universal protocol compatibility is one of the primary reasons H.264 remains the dominant streaming codec.
RTMP (Real-Time Messaging Protocol) uses H.264 as the primary video codec for ingest. Standard RTMP supports only H.264 video. Enhanced RTMP extends support to H.265, VP9, and AV1, but H.264 remains the default ingest codec for OBS Studio, vMix, Wirecast, and all major encoder software.
HLS (HTTP Live Streaming) requires H.264 as the mandatory video codec. Apple’s HLS specification mandates H.264 support. While HLS also accepts H.265 through the hvc1 codec tag, H.264 remains the only codec guaranteed to play on every HLS-compatible device.
WebRTC specifies H.264 and VP8 as mandatory codecs according to RFC 7742. Chrome, Firefox, Edge, and Safari all support H.264 in WebRTC sessions. Safari on iOS exclusively uses H.264 for WebRTC video due to Apple’s WebKit implementation. This makes H.264 essential for cross-browser WebRTC video streaming compatibility.
DASH (Dynamic Adaptive Streaming over HTTP) and CMAF (Common Media Application Format) both support H.264 alongside H.265 and AV1. DASH-based workflows typically include H.264 renditions to ensure backward compatibility with older player implementations.
SRT (Secure Reliable Transport) carries H.264 encoded video as the most common payload. SRT streaming acts as a transport wrapper and does not mandate specific codecs, but H.264 dominates SRT-based contribution workflows for broadcast and professional streaming.
How Does H.264 Compare to H.265, VP9, AV1, and VVC?
Each codec generation improves compression efficiency at the cost of encoding complexity and device compatibility. The following table compares H.264 against 4 successor codecs across 7 performance dimensions with specific numeric values.
| Metric | H.264/AVC | H.265/HEVC | VP9 | AV1 | VVC/H.266 |
|---|---|---|---|---|---|
| Release year | 2003 | 2013 | 2013 | 2018 | 2020 |
| 1080p30 bitrate (equal quality) | 4,500-6,000 kbps | 2,700-3,600 kbps | 2,400-3,200 kbps | 2,000-2,800 kbps | 1,800-2,400 kbps |
| Compression gain over H.264 | Reference | 35-50% | 30-40% | 40-55% | 50-65% |
| Browser compatibility | 98.2% | 18% | 96.3% | 74.9% | 0% (2026) |
| Hardware decoder availability | Universal (post-2010) | Post-2015 devices | Post-2016 devices | Post-2020 devices | Not available (est. 2028+) |
| Encoding CPU cost (relative) | 1x | 3-5x | 5-10x | 15-30x | 20-40x |
| Licensing | VIA LA patent pool | Multiple patent pools | Royalty-free (Sisvel disputes) | Royalty-free (Sisvel disputes) | Multiple patent pools |
H.264 encoding speed outperforms every successor codec by 3x to 30x. This speed advantage makes H.264 the preferred codec for live streaming and real-time encoding where latency matters more than bandwidth savings.
H.265 delivers 35-50% bitrate reduction over H.264 at equivalent quality. This compression advantage becomes significant for 4K content, where H.264 requires 13-34 Mbps compared to 8-20 Mbps with H.265. For 1080p and lower resolutions, the H.264 bandwidth requirement falls within acceptable ranges for most internet connections.
VP9 matches H.265 compression performance while remaining royalty-free. YouTube uses VP9 for desktop video delivery. VP9 encoding speed trails H.264 by 5-10x, limiting VP9 adoption in live streaming workflows.
AV1 provides the best widely deployed compression but demands 15-30x more CPU resources than H.264 for encoding. AV1 adoption grows in on-demand workflows where encoding time is less critical. Real-time AV1 encoding for live streaming remains impractical without dedicated hardware acceleration.
VVC (Versatile Video Coding), also designated H.266, is the newest standard from the same ITU-T and MPEG partnership that created H.264 and H.265. The Joint Video Experts Team finalized VVC in July 2020. VVC achieves 50-65% bitrate reduction over H.264, meaning a 4K stream requires 12-16 Mbps with VVC compared to 20-34 Mbps with H.264. Consumer devices with VVC hardware decoders are not expected before 2028 based on typical silicon development cycles. Zero browsers support VVC playback in 2026.
What Container Formats Work with H.264?
H.264 encoded video functions inside 6 primary container formats, including MP4, MPEG-TS, FLV, MOV, MKV, and WebM. Each container combines video, audio, subtitles, and metadata into a single file.
MP4 (.mp4) is the most common H.264 container. MP4 supports H.264, H.265, and AV1 video with AAC audio. All browsers, mobile devices, and media players support MP4 playback. MP4 recording is the default format for streaming server recording features.
MPEG-TS (.ts) wraps H.264 video for HLS delivery and broadcast transmission. HLS players receive content as a sequence of TS segments. MPEG-TS supports error recovery features that MP4 lacks, making TS segments more resilient to network packet loss.
FLV (.flv) carries H.264 video for RTMP transmission. RTMP encoders package H.264 frames into FLV containers before sending to streaming servers. FLV is a transport-only format.
MOV (.mov) stores H.264 video in Apple’s QuickTime container format. Professional video editing workflows use MOV containers for H.264 intermediate files. MOV and MP4 share the same underlying ISO base media file format structure.
MKV (.mkv) provides an open-source container supporting H.264 alongside virtually every other video codec. MKV supports unlimited audio tracks, subtitles, and chapter markers. Native browser support for MKV remains limited.
WebM (.webm) primarily supports VP8, VP9, and AV1 codecs for web-optimized delivery. While the WebM container specification focuses on royalty-free codecs, some implementations allow H.264 packaging. Streams requiring broad browser playback through WebM typically use VP8 or VP9 encoding.
What are the Limitations of H.264?
H.264 has 3 primary limitations that drive adoption of newer codecs for specific use cases.
Compression efficiency trails newer codecs by 35-65%. A 4K stream encoded with H.264 at 20 Mbps achieves the same perceived quality as an H.265 stream at 12 Mbps, an AV1 stream at 10 Mbps, or a VVC stream at 8 Mbps. For platforms delivering millions of concurrent streams, this bandwidth difference translates directly into CDN cost reduction.
Patent licensing adds cost and complexity for commercial deployment. The VIA Licensing Alliance manages the H.264 device patent pool. Devices and services distributing H.264 content above 100,000 units per year owe royalties to VIA LA. Free internet video streams delivered without charge are exempt from H.264 royalties. H.264 patent holders include Panasonic, Sony, Apple, Microsoft, Samsung, LG Electronics, and 25+ other companies.
H.264 faces a simpler patent structure than H.264 successors. Two new content royalty pools launched in 2023-2025 targeting streaming content encoded with newer codecs: Avanci Video (launched October 2023) and Access Advance Video Distribution Patent pool (launched January 2025). Avanci Video and Access Advance VDP charge royalties on streaming content encoded in H.265, VP9, AV1, and VVC, but neither pool charges royalties on H.264 encoded content.
HDR support exists but remains rarely used. H.264 technically supports HDR through Dolby Vision Bitstream Profile 7. Content producers encode HDR content with H.265 or AV1 because these codecs handle wider color gamuts and higher bit depths more efficiently than H.264.
For 1080p and lower resolutions with broad device compatibility requirements, H.264 remains the most practical codec choice.
How Does H.264 Work in Ant Media Server?
Ant Media Server receives H.264 encoded streams from publishers, processes those streams through media server infrastructure, and delivers H.264 encoded streams to viewers across protocols and devices. H.264 sits at the center of the Ant Media Server workflow because H.264 serves as the common codec between ingest and delivery.
Ingest accepts H.264 streams via RTMP, SRT, or WebRTC from encoder software or hardware devices. Ant Media Server validates the incoming H.264 stream parameters including profile, level, resolution, and bitrate.
Transcoding in Ant Media Server converts the single incoming H.264 stream into an adaptive bitrate ladder. The Ant Media Server transcoder generates renditions at 240p, 360p, 480p, 720p, and 1080p from one source stream. Each rendition uses H.264 encoding with appropriate bitrate settings. GPU-accelerated transcoding with NVIDIA NVENC or Intel Quick Sync processes H.264 encoding at 5-10x the speed of CPU-based software encoding.
Protocol conversion in Ant Media Server repackages H.264 video into different delivery formats without re-encoding. The same H.264 encoded video stream reaches HLS viewers as TS segments, WebRTC viewers as RTP packets, and DASH viewers as CMAF fragments. Ant Media Server H.264 compatibility across all delivery protocols eliminates the need for codec-specific transcoding at the output stage.
Recording in Ant Media Server stores H.264 streams as MP4 files for on-demand playback. Ant Media Server requires H.264 for MP4 recording. Streams encoded with VP8 record in WebM format.
Organizations evaluating Ant Media Server streaming infrastructure requiring validated sub-500ms latency performance with automatic H.264 transcoding across distributed edge networks benefit from Ant Media Server hands-on testing environment providing complete streaming access for latency measurement, adaptive bitrate validation, and codec transcoding performance assessment without implementation overhead or financial commitment.
What are the Best H.264 Encoding Settings for Live Streaming?
Optimal H.264 encoding settings in Ant Media Server balance quality, latency, and compatibility. These 6 parameters control the most impactful encoding configurations for live streaming with Ant Media Server.
Profile: High. High Profile provides the best compression-to-compatibility ratio for modern streaming. All devices manufactured after 2012 support High Profile decoding.
Level: 4.1. Level 4.1 supports up to 1080p at 30 fps with a maximum bitrate of 50 Mbps. Level 4.1 covers the most common live streaming resolution and frame rate combinations.
GOP size: 2 seconds. A 2-second keyframe interval balances compression efficiency with channel-change latency. HLS segment boundaries align with GOP boundaries, so a 2-second GOP matches the standard 2-second HLS segment duration.
B-frames: 2. Using 2 B-frames per GOP provides compression improvement with minimal encoding latency. For ultra-low latency WebRTC streaming under 500ms, set B-frames to 0 to eliminate the decoding delay introduced by B-frame reordering.
Entropy coding: CABAC. CABAC provides 10-15% better compression than CAVLC. All High Profile decoders support CABAC.
Rate control: CBR (Constant Bitrate). CBR maintains consistent network utilization for live streaming because network capacity allocation remains predictable. VBR (Variable Bitrate) suits on-demand encoding where file size optimization outweighs network consistency.
Technical teams deploying H.264 encoding pipelines with Ant Media Server adaptive bitrate requirements and multi-protocol delivery across WebRTC, HLS, and DASH simultaneously can validate codec configuration in Ant Media Server multi-protocol testing platform enabling concurrent protocol testing, H.264 transcoding performance measurement, and adaptive bitrate ladder verification with complete feature access for encoding decisions without infrastructure investment.
Frequently Asked Questions
What Does H.264 Stand For?
H.264 is a video compression standard designated by the ITU-T (International Telecommunication Union). The “H” prefix indicates an ITU-T standard in the audiovisual and multimedia systems series. The same standard is called Advanced Video Coding (AVC) or MPEG-4 Part 10 by ISO/IEC.
Is H.264 Better Than H.265?
H.264 provides broader device and browser compatibility (98.2% vs 18% browser support) and 3-5x faster encoding speed. H.265 delivers 35-50% better compression efficiency, making H.265 better for 4K content and bandwidth-constrained delivery. H.264 is better for maximum reach. H.265 is better for maximum compression at the cost of limited browser playback.
Is H.264 Lossy or Lossless?
H.264 is primarily a lossy compression standard that discards visually redundant data to achieve 80% file size reduction compared to uncompressed video. H.264 High 4:4:4 Predictive Profile supports lossless encoding, but lossless H.264 is used only in professional post-production workflows, not in streaming delivery.
What is the Difference Between H.264 and AVC?
H.264 and AVC are the same compression technology with 2 different names. The ITU-T designated the standard as H.264. The ISO/IEC Moving Picture Experts Group designated the same standard as MPEG-4 Part 10 Advanced Video Coding (AVC). Both names are used interchangeably.
Does WebRTC Support H.264?
WebRTC mandates H.264 and VP8 support according to RFC 7742. Chrome, Firefox, Edge, and Safari all decode H.264 in WebRTC sessions. Safari on iOS uses H.264 exclusively for WebRTC video. H.264 is the only video codec supported across all WebRTC-compatible browsers.
Conclusion
H.264 compression, protocol compatibility, encoding speed, and universal device support make H.264 the foundation codec for streaming infrastructure in 2026. The H.264 codec achieves 98.2% browser compatibility, plays on every connected device manufactured since 2010, and encodes 3-30x faster than H.265, VP9, and AV1.
For live streaming applications requiring real-time encoding, the H.264 codec is the most practical choice. H.264 High Profile Level 4.1 with CABAC entropy coding, 2-second GOP, and CBR rate control delivers the optimal balance of compression efficiency, device compatibility, and encoding performance for 1080p live streams.
Newer codecs like H.265, AV1, and VVC (H.266) complement H.264 for specific use cases: 4K delivery, HDR content, and high-traffic on-demand streaming where bandwidth savings justify encoding complexity and patent exposure. H.264 remains the mandatory baseline codec in HLS and WebRTC, the default ingest codec for RTMP, and universally supported in DASH, ensuring H.264 encoded streams reach every viewer on every device. The 2023-2025 content royalty pools from Avanci Video and Access Advance VDP charge royalties on H.265, VP9, AV1, and VVC content but exempt H.264, making H.264 the lowest-risk codec for licensing.
Streaming infrastructure built on Ant Media Server supports H.264 transcoding, adaptive bitrate streaming, and multi-protocol delivery (WebRTC + HLS + DASH) providing the flexibility to serve all viewer segments. Ant Media Server handles H.264 ingest, GPU-accelerated transcoding, and automatic protocol conversion as the core of modern live streaming architecture. Ant Media Server processes H.264 streams at sub-500ms latency with horizontal scaling across origin-edge cluster deployments.
Estimate Your Streaming Costs
Use our free Cost Calculator to find out how much you can save with Ant Media Server based on your usage.
Open Cost Calculator