H.264 Codec: Superior Video Coding (AVC) Defined
This text offers a fast overview of the H.264 codec: what it’s, the way it performs, what it prices, and what it’s good for. We’ll conclude with a piece on what you should know to successfully deploy the H.264 codec, notably throughout the Wowza Streaming Engine software program and the Wowza Streaming Cloud service.
What Is the H.264 Codec?
H.264 is a video coding commonplace or codec. It was created by two requirements our bodies, the ITU-T Video Coding Consultants Group, which referred to as the usual H.264, and the ISO/IEC JTC1 Transferring Image Consultants Group (MPEG), which referred to as the usual Superior Video Coding (AVC). H.264 and AVC confer with the identical know-how and are used interchangeably. Technically, AVC is outlined in Half 10 of the MPEG-4 commonplace, and is totally different from the MPEG-4 codec, which was outlined in Half 2 and by no means actually acquired traction within the market. H.264 first launched in Might 2003 because the successor to MPEG-2, primarily to be used in broadcast functions because the web was nascent.
As a video commonplace, there are a number of implementations of the H.264 codec, together with the x264 codec in FFmpeg, and the Beamr codec used within the Wowza Streaming Engine. Intel and NVIDIA each supply hardware-accelerated H.264 codecs that may be accessed from the Wowza Streaming Engine. As a result of H.264 is an ordinary, all video encoded by any H.264 codec ought to play on any H.264 decoder or participant, whether or not in a browser, smartphone, or Good TV.
Compatibility: H.264 vs. VP9, HEVC, and AV1
Codec Compatibility | Browser | Cellular | Good TV/OTT |
H.264 | Nearly all | All | All |
VP9 | Nearly all | Android, iOS | Most |
HEVC | Little or no | Android, iOS | All |
AV1 | Edge, Firefox, Chrome, Opera | Android | Nascent |
The streaming market was a lot less complicated when H.264 first launched, with computer systems comprising the dominating platform for streaming video and one plug-in, Adobe Flash, the dominant video participant for many web sites. As soon as Adobe added H.264 help to Flash, the pc browser market shifted nearly instantly to H.264. As we speak, the web site Can I Use experiences that H.264 playback is obtainable on over 98.23% of world browsers.
Apple began supporting H.264 with the primary iPod contact system and all subsequent iPod contact fashions, iPhones, and iPads. The Android platform added H.264 help with model 3, which shipped in 2011, wrapping up the 2 dominant cell gamers. As a broadcast commonplace, H.264 was supported by many tv units and/or set-top bins lengthy earlier than the video was delivered through IP.
Merely said, the first cause that H.264 continues to dominate the worldwide streaming markets is as a result of it performs in every single place. That mentioned, there are a number of submarkets the place different codecs are making severe inroads.
Efficiency: H.264 vs. VP9, HEVC, and AV1
When gauging codec efficiency, you contemplate two features: (1) encoding complexity or pace, and (2) encoding high quality. With most codecs, there’s an inverse relationship between the 2. That’s, the higher the encoding high quality, the longer it takes to encode. This interprets to greater encoding and transcoding prices. Since no codec can utterly exchange H.264 at this level, these encoding or transcoding prices are additive to present H.264 encoding-related prices.
Efficiency In comparison with H.264 | Encoding Complexity (Velocity) | Encoding High quality |
H.264 | Baseline | Baseline |
VP9 | 2–15x | ~35% |
HEVC | 2–15x | ~35% |
AV1 | 15–30x | ~50% |
To elucidate desk 2, encoding complexity is the encoding time as in comparison with H.264. So, for VP9, encoding ought to take between 2–15 instances longer than H.264. Encoding high quality describes the bitrate discount the codec can obtain whereas delivering the identical high quality as H.264. So, streams encoded with VP9 and HEVC at 65% the info fee of a stream encoded with H.264 ought to have about the identical high quality.
After all, higher encoding high quality supplied by VP9, HEVC, and AV1 decreases bandwidth prices for supply to appropriate gamers, which may in flip offset the extra encoding and storage prices. Nonetheless, most corporations (excluding the highest tier of streaming broadcasters) are likely to undertake new codecs solely after they allow entry into new markets, not as a cost-saving measure.
Suitability: H.264 vs. VP9, HEVC, and AV1
We see in desk 3 that codecs additionally differ in suitability for various features. H.264 excels in stay origination and transcode due to encoding pace; all different codecs want {hardware} help for each features. Understandably, H.264 has acquired the lion’s share of consideration in low-latency functions, whether or not HTTP-based or WebRTC.
Codec Suitability | Dwell Origination | Dwell Transcode | Low Latency | 4K | HDR |
H.264 | Wonderful | Wonderful | Wonderful | Poor | Poor |
VP9 | Poor | Poor | WebRTC | Wonderful | Poor |
HEVC | Good | Good | Nascent | Wonderful | Wonderful |
AV1 | Nascent | Nascent | WebRTC | Wonderful | Nascent |
However, for those who examine H.264 vs. H.265 high quality, you’ll be able to see why H.264 is a poor selection for 4K video, because the ~35% bandwidth financial savings delivered by H.265 is critical and might make or break supply to some properties. Because of this, although H.264 is technically able to HDR help and is included in a single Dolby Imaginative and prescient bitstream profile, the overwhelming majority of Dolby Imaginative and prescient and different HDR streams are encoded with HEVC.
Royalty Standing: H.264 vs. VP9, HEVC, and AV1
MPEG LA runs the H.264 patent pool, which prices for encoders and decoders in extra of 100,000 models per yr. There are royalties on subscription companies and pay-per-view; see the AVC Patent Portfolio License Briefing right here (web page 11).
Codec Royalty Standing | Encoder | Decoder | Paid Content material | Free Web Content material |
H.264 | Sure | Sure | Sure | No |
VP9 | No | Shopper system | No | No |
HEVC | Sure | Sure | Some | Unclear |
AV1 | No | Shopper System | No | No |
Although there have been a number of H.264 patent infringement fits by events not included within the MPEG LA patent pool, these concerned giant {hardware} platform corporations like Apple and Microsoft, not content material publishers. At this level, aside from the royalties charged by MPEG LA, there don’t look like any H.264 IP homeowners claiming royalties on content material.
What You Must Know to Produce H.264
Like all codecs, H.264 has dozens of configuration choices that only a few producers ought to ever contact. There are, nevertheless, three configuration choices that each one producers ought to perceive.
Profiles
First are profiles, that are units of encoding instruments or algorithms that can be utilized to encode a file. You see this in desk 5 from Wikipedia, which reveals the instruments and algorithms on the left and the profiles within the columns. The baseline profile (BP) makes use of comparatively few encoding instruments, making the bitstream decrease in high quality than the excessive profile (HiP) however simpler to decode.
Why create profiles? To permit system producers to deploy H.264 and nonetheless meet product value and efficiency necessities. For instance, within the first-generation iPod contact units, Apple built-in silicon able to enjoying the baseline profile to fulfill its goal value, dimension, and energy consumption targets. Publishers producing video for that era of units encoded utilizing the baseline profile; in any other case, the video wouldn’t play.
As we speak, nearly all newer smartphones, tablets, computer systems, OTT dongles, sensible TVs, recreation platforms and different video playback units can play the excessive profile, which is the best profile used for streaming. Nonetheless, for those who ship streams to viewers watching on older units it’s possible you’ll need to guarantee that you’ve got one or two decrease high quality streams in your encoding ladder within the baseline or principal (MP) profile. As a result of the profile is essential for playback compatibility, all H.264 encoders can help you specify the profile in its person interface or scripting language.
If you happen to’re delivering stay or video on demand (VOD) streams to a service like Wowza Streaming Engine or Wowza Streaming Cloud, or transcoding streams through that service, test the companies’ suggestions for profiles. For instance, right here’s what Wowza recommends in Arrange and run Transcoder in Wowza Streaming Engine:
Ranges
Ranges apply extra encoding limitations on the profiles, like these proven in desk 6, once more from Wikipedia. To adjust to Stage 4.2, for instance, the video can’t exceed 2048×1080@60fps or 50,000 Kbps. Within the early days of delivering video to cell units, ranges mattered. As we speak, although, most present units can play any stage you could ship to it.
The place ranges stay vital are necessities from service suppliers like Wowza. For instance, determine 2 is from Encoding greatest practices for Wowza Streaming Cloud. Right here you see that your incoming stream shouldn’t exceed stage 4.1 for 1080p30 or 4.2 for 1080p60.
In contrast to Profiles, which generally have a configuration choice within the encoder, you adjust to stage settings by configuring your video throughout the constraints of that stage. You see this within the encoding preset from Wirecast proven in determine 3. Whereas there’s a particular configuration choice for profile (set to excessive), there is no such thing as a choice for stage. As an alternative, it’s a must to set the decision, body fee, and knowledge fee parameters throughout the restrictions set by the extent. For the reason that parameters are 1080p30 @ 10000, the preset conforms to stage 4.1 and can work with Wowza Streaming Engine.
Presets/High quality
The ultimate H.264 encoding parameter that you need to find out about is the encoding preset, which is chosen through the standard setting in determine 3. Presets change the configuration of sure codec choices to permit streaming producers to decide on their desired tradeoff between encoding high quality and complexity. For VOD video, for instance, you may select a high-quality preset that lengthens encoding time however optimizes high quality. For stay video, you could have to sacrifice high quality to attain real-time encoding, and select a lower-quality preset.
Whereas profile and ranges are the identical for all H.264 encoders, presets differ by the precise codec. For instance, determine 3 reveals encoding with the x264 codec, which makes use of presets that vary from Ultrafast to Placebo. Different H.264 codecs, like these from MainConcept or Beamr might use totally different presets, or might not supply presets in any respect.
Now that you already know the fundamentals, you need to be capable to configure your streams for optimum high quality and compatibility. As at all times, when working with a service supplier like Wowza, test the service’s suggestions to make sure that you ship streams that adjust to its necessities.
Within the subsequent article on this collection, we’ll focus on the VP9 codec.
By no means Miss a Beat
Subscribe to Weblog
Further Sources:
- The Streaming Codec Panorama in 2021
- Video Codecs and Encoding: The whole lot You Ought to Know
About Jan Ozer
Jan Ozer is a number one professional on H.264, H.265, VP9, and AV1 encoding for stay and on-demand manufacturing. Jan develops coaching programs for streaming media professionals, offers testing companies to encoder builders, and helps video producers excellent their encoding ladders… View extra