
Video transcoding decodes an uploaded video and re-encodes it into new renditions, each with its own codec, resolution and bitrate. H.264, H.265 (HEVC) and VP9 are the three codecs you most often pick between at that step. They trade compression against licensing and device support.
The codec that compresses best on paper is not always the one you should ship. Licensing, hardware decoders and browser support decide as much as engineering does, and this guide walks you through each of them.
TL;DR:
Updated Oct 29, 2026: a shorter answer-first opening, shorter sentences, a codec comparison table, a labelled transcoding diagram and a "How AIOZ Stream handles it" section with the codec settings from the Video API docs.
Transcoding is more than a format swap: your upload is fully decoded back to raw frames, then encoded again from scratch for every rendition your ladder needs. A 240p H.264 stream, a 1080p H.264 stream and a 4K H.265 stream are three separate encodes, each with its own compression decisions.
That is why encoding cost grows with every rung and every codec you add, and why you choose the codec at this re-encoding step. The same source can therefore come out as several quite different streams. Our upload-to-playback walkthrough shows where this step sits in AIOZ Stream's pipeline.

H.264, formally Advanced Video Coding, dates from the early 2000s. Almost every device you will meet can decode it in hardware, from a decade-old smart TV to a current flagship phone. That reach, not its compression, is the reason H.264 still matters to your ladder in 2026.
Hardware decode matters because software decoding drains batteries and can stutter on weak devices, while a dedicated decode chip plays the same stream at a fraction of the power. So the lowest rungs of most ladders stay on H.264, even when H.265 sits higher up. Those rungs are the ones most likely to reach an old or budget phone, and a stream the device cannot decode is worse than one that is a little larger.
HEVC compresses better than H.264, as the 4K and 8K encoding guide covers. What slowed it down was licensing: its patents ended up in three separate pools instead of one, per Fora Soft:
Some large patent holders, including Nokia, Microsoft and TI, joined none of the pools, so if you wanted to ship HEVC with full legal clarity, you might have to negotiate with each group separately. That split is widely cited as the reason browser vendors were slow to add native HEVC support.
H.264 went the other way: MPEG LA's single pool meant one negotiation, which made it easy for chip makers to build H.264 decoding in by default. That is a large part of why H.264 support became universal.
Google built VP9 as an answer to that licensing problem. It bought On2 Technologies, the original VPx developer, for $124.6 million in February 2010, and released VP9 in June 2013, per Ant Media.
The WebM Project's patent grant calls VP9 "no-charge, royalty-free." It carries one defensive condition: if you sue Google or another implementer over VP9 patent claims, your own rights under the grant end. There is no ongoing fee and no per-device royalty.
YouTube is VP9's largest user and encodes its 4K output in VP9 by default. Bitmovin, citing CanIUse, puts VP9 browser support at roughly 96% of desktop and mobile traffic. Safari added VP9 decoding with iOS 14 and macOS Big Sur, years after Chrome, Firefox and Edge.
Royalty-free did not make VP9 a universal replacement, though, because its hardware decoders arrived years after H.264's. Many older phones and budget TVs decode it in software, if at all, which is why YouTube still serves H.264 alongside VP9.
Use H.264 for reach, H.265 or VP9 for smaller files at the top of your ladder, and keep H.264 underneath either one. The table sums up the trade-offs from the sections above.
| H.264 (AVC) | H.265 (HEVC) | VP9 | |
|---|---|---|---|
| Compression | Baseline | Better than H.264 | Better than H.264 |
| Hardware decode | Almost every device | Narrower than H.264 | Arrived years after H.264's |
| Licensing | One MPEG LA pool | Three pools plus independent holders | Royalty-free grant with a defensive clause |
| Browsers | Universal | Native support came slowly | About 96% (Bitmovin, citing CanIUse) |
| On AIOZ Stream | Yes, up to 4K | Yes, up to 8K | No |
If you are weighing a newer codec too, our guide to AV1 covers how its hardware rollout compares with VP9's. The codec is also separate from the container your renditions are wrapped in, which video container formats explains.
AIOZ Stream transcodes your upload into the qualities you request, and you set the codec per quality. The Video API reference is direct: "Only H.264 and H.265 are currently supported. (H.264 maximum resolution is 4K and H.265 is 8K)". Audio is AAC only. VP9 is not an option, and the docs do not give a reason, so you would need a separate pipeline for VP9 output.
Each quality takes a video_config with a codec of "h264" or "h265", plus a container type: mpegts or mp4 for HLS, fmp4 for DASH. This is one quality from the docs' example request:
{
"resolution" : "1080p" ,
"type" : "hls" ,
"container_type" : "mpegts" ,
"video_config" : { "codec" : "h264" , "bitrate" : 5000000 , "index" : 0 },
"audio_config" : { "codec" : "aac" , "bitrate" : 192000 , "channels" : "2" , "sample_rate" : 48000 , "language" : "en" , "index" : 0 }
}One note matters if you choose H.265. The docs say Apple platforms (Safari, iOS, tvOS) play HEVC over HLS only in fMP4/CMAF segments, not in MPEG-TS, while H.264 works with both. They also say a quality set higher than the source resolution is ignored. Next step: read the AIOZ Stream Video API docs.
What is the difference between transcoding and converting a file format?
Transcoding fully decodes a source file and re-encodes it into several independent renditions, each with its own compression decisions. It is not a single reformatted copy of the original.
Why is H.264 still used if H.265 compresses better?
Device compatibility: H.264 has near-universal hardware decode support built up over two decades, so it stays the safe fallback even on a ladder that includes newer codecs.
Why did HEVC adoption lag behind its technical advantages?
Its patents are split across three licensing pools (MPEG LA, Access Advance, Velos Media) plus large independent holders. That split is widely cited as the reason browsers were slow to add native support.
Is VP9 free to use?
Yes, Google's published grant charges no royalty, and its only condition is defensive: your rights under the grant end if you sue over VP9 patent claims.
Does AIOZ Stream support VP9?
No, the Video API supports H.264 (up to 4K) and H.265 (up to 8K) for video, and AAC for audio.
Which container should I use for H.265 on Apple devices?
Use fMP4/CMAF segments, since AIOZ Stream's docs note that Apple platforms do not play HEVC in MPEG-TS segments over HLS.
What about AV1?
AV1 is a newer royalty-free codec with its own adoption story, covered in our AV1 guide.

Video streaming protocols move video from encoder to viewer. See how RTMP, SRT, HLS, DASH and WebRTC differ in latency, transport and where each one fits.

Decentralized live streaming sends a real-time broadcast through independently run nodes instead of one company's servers. Here's how each stage of it works.

A video streaming glossary of 114 terms, from AAC and ABR to WebRTC and Widevine, each defined in plain English with sources and links to the deep posts.

Read the AIOZ Stream Statistics panel: bitrate in and out, FPS in and out and current viewers, plus the documented rules for each and what the docs leave out.

Embed an AIOZ Stream livestream with the Share button's iframe or send the Public Playback URL as a link. Covers API fields, public access limits and doc gaps.

Learn how a stream key differs from a streaming session on AIOZ Stream, what each one stores, and what to preconfigure before you go live. Docs-based guide.