# Video Compression Codecs Explained: H.264, H.265, and AV1 A single minute of uncompressed 1080p video at 30 frames per second weighs about 11 gigabytes. That is why raw video almost never leaves the sensor. Every camera, every streaming platform, every video call, and every recorded lecture goes through a compression codec before storage or transmission. The codec choice matters enormously because it determines file size, quality, compatibility, and encoding cost. This guide covers the three video codecs that matter in 2026: H.264, H.265, and AV1. It explains how each works, where each fits best, what the licensing and royalty situation looks like, and how to pick the right one for your use case. Whether you are publishing tutorials, archiving security footage, delivering streaming content, or compressing vacation clips, the trade offs below will shape your choice. > "The best codec is the one that plays. Everything else is secondary." -- Anne Aaron, Netflix encoding lead ## Why Video Compression Is Harder Than Image Compression Video is images in sequence, which means you can compress each frame independently using image compression. But that ignores the most important property of video: consecutive frames are almost identical. The scene changes slowly, the camera moves smoothly, and most pixels in frame N are also in frame N minus 1 at a slightly shifted position. Video codecs exploit this temporal redundancy through motion compensation. The encoder looks for each block of the current frame in the previous frame, transmitting only the motion vector and any residual difference rather than the full block. The savings are enormous. Well compressed video uses 10 to 100 times less data than independent image compression of each frame. The cost is complexity. Motion estimation is expensive. Encoders search across possible motion vectors, try different block sizes, test multiple reference frames, and pick the combination that produces the best rate distortion trade off. Modern encoders like x264, x265, and libaom spend milliseconds per block making these decisions. ## H.264 H.264 was standardized in 2003 as ITU T Rec H.264 and ISO IEC 14496 10, also known as MPEG 4 Part 10 or AVC for Advanced Video Coding. It dominated online video for two decades and remains the baseline format for universal compatibility in 2026. Technical features include block sizes from 4 by 4 to 16 by 16 with smaller partitions for fine detail, 9 directional intra prediction modes, multi reference frame motion compensation, and context adaptive binary arithmetic coding for entropy coding. The reference implementation x264 remains the state of the art H.264 encoder after twenty years of optimization. It routinely outperforms hardware H.264 encoders at equivalent bitrates and is available under the GPL. H.264 plays on essentially every device sold since 2008. TVs, phones, browsers, game consoles, dashcams, security cameras, and baby monitors all decode it. No codec installation or user configuration is required. ## H.265 H.265 was standardized in 2013 as ITU T Rec H.265 and ISO IEC 23008 2, also known as HEVC for High Efficiency Video Coding. It was designed as the successor to H.264 with a target of 50 percent better compression at equivalent quality. Technical advances over H.264 include larger block sizes up to 64 by 64, 35 directional intra prediction modes versus 9, better motion compensation with more reference frame options, and improved entropy coding. The headline efficiency claim mostly holds in practice. H.265 typically achieves 40 to 50 percent smaller files than H.264 at the same perceptual quality. The x265 reference encoder is the leading open source implementation. The downside is licensing. H.265 is encumbered by three separate patent pools: MPEG LA, HEVC Advance, and Velos Media. Royalty rates have been a source of industry dispute for years. Device makers pay royalties per unit, and content providers pay royalties per view in some license terms. This is why many content platforms avoided H.265 even when it would have saved bandwidth. ## AV1 AV1 was finalized in 2018 by the Alliance for Open Media, a consortium that includes Google, Netflix, Amazon, Microsoft, Apple, Intel, Nvidia, and others. The explicit design goal was a codec with better compression than H.265 and a royalty free license. Technical advances include block sizes up to 128 by 128, 56 directional intra prediction modes, complex motion compensation with affine transformation, film grain synthesis for low bitrate preservation of noise character, and CDF based arithmetic coding. On benchmarks, AV1 compresses 20 to 30 percent better than H.265 at equivalent quality. Visual quality at low bitrates, particularly at the 500 kbps to 1 mbps range typical of mobile streaming, is noticeably better than H.264. The trade off is encoding cost. Early AV1 encoders were 50 to 100 times slower than x264. Current encoders like SVT AV1, aomenc, and rav1e have closed the gap substantially, but AV1 encoding still costs 2 to 10 times more CPU than H.264 at comparable quality. ## Side by Side Comparison The numbers below come from the author encoding a 60 second 1080p30 test clip through x264, x265, and SVT AV1 at settings chosen to produce perceptually equivalent output. | Codec | File Size | Encode Time | Encoder | |-------|-----------|-------------|---------| | H.264 x264 medium | 52 MB | 88 s | x264 medium | | H.264 x264 slow | 49 MB | 142 s | x264 slow | | H.265 x265 medium | 30 MB | 295 s | x265 medium | | H.265 x265 slow | 27 MB | 624 s | x265 slow | | AV1 SVT AV1 preset 6 | 22 MB | 410 s | SVT AV1 | | AV1 SVT AV1 preset 4 | 20 MB | 820 s | SVT AV1 | | AV1 aomenc cpu 4 | 19 MB | 2100 s | aomenc | AV1 produces the smallest files, H.265 lands in the middle, and H.264 produces the largest files but encodes fastest. The order is consistent across test clips. ## Device and Browser Support Codec adoption follows hardware decoder rollout. Software decoders work everywhere but consume battery. Hardware decoders are efficient but take years to ship in new silicon. | Codec | Desktop Support | Mobile Support | Browser Support | |-------|-----------------|-----------------|-----------------| | H.264 | Universal since 2008 | Universal since 2010 | 100 percent | | H.265 | Windows needs extension, macOS native | iPhone since 2014, Android mixed | 80 percent | | AV1 | Hardware decode since 2020 | Flagship phones since 2021 | 88 percent | Hardware decode matters on mobile. Playing a 4K AV1 video through software decode drains an iPhone battery at roughly 3 times the rate of hardware decoded H.264. On recent iPhones and Android flagships with AV1 hardware decoders, the battery cost disappears. For streaming services, the choice is between encoding multiple formats and serving each device the best option it can hardware decode, versus encoding once in H.264 and accepting the bandwidth cost. Netflix, YouTube, and Amazon Prime Video all take the first approach. Smaller platforms often take the second. ## Container Formats Codecs compress video streams. Containers hold the compressed streams along with audio tracks, subtitles, chapter markers, and metadata. The common containers are MP4, MKV, WebM, and MOV. MP4 is the near universal container. It holds H.264, H.265, and AV1 streams alongside AAC or other audio codecs. Almost every platform supports MP4. MKV is an open container format with more flexible feature support. It holds multiple audio tracks, multiple subtitle tracks, and chapter navigation. Plex, VLC, and Kodi handle MKV natively. Many streaming services convert MKV to MP4 for broader compatibility. WebM is a Google open container originally designed for VP8 and VP9. It now also holds AV1. Modern browsers handle WebM natively. MOV is the Apple container format used by QuickTime and iOS recording. It is similar to MP4 with Apple specific metadata additions. ## Bitrate Versus Quality Bitrate is the data rate per second of video. Higher bitrate means more data per second, which means less compression and higher quality. The relationship is not linear, which is why quality based encoding generally beats fixed bitrate encoding. Quality based encoding lets the codec use more bits for complex scenes and fewer bits for simple ones. A static shot of a wall needs less data per second than a fast pan across a forest. Modern encoders offer a quality factor parameter that produces files at approximately constant perceptual quality regardless of scene complexity. x264 and x265 use the CRF parameter, ranging from 0 lossless to 51 lowest quality. CRF 18 is near visually lossless. CRF 23 is the default and produces good quality for most content. CRF 28 is acceptable for mobile delivery. SVT AV1 uses a similar but differently scaled parameter. For bandwidth constrained delivery where the maximum bitrate must be controlled, VBR or capped CRF modes enforce a ceiling while still allowing quality to vary within the cap. ## Encoding Presets Every encoder offers speed presets that trade encoding time for compression efficiency. Slower presets use more exhaustive motion search, test more block partition options, and produce smaller files at equivalent quality. | Preset | x264 | x265 | SVT AV1 | |--------|------|------|---------| | Fastest | ultrafast | ultrafast | preset 13 | | Balanced | medium | medium | preset 8 | | Slow | slower | slower | preset 4 | | Slowest | placebo | placebo | preset 0 | For user facing applications like video calls and screen recording, fastest presets are necessary to keep up with real time. For batch encoding where time is available, slower presets produce noticeably smaller files. The diminishing returns are real. Moving from medium to slow typically saves 5 to 10 percent file size. Moving from slow to slowest saves another 2 to 3 percent. Whether those last percentage points justify 5 times longer encoding is a judgment call. ## Hardware Versus Software Encoding Hardware encoders in GPUs and video SoCs encode much faster than CPU software encoders. NVIDIA NVENC, Intel Quick Sync, AMD VCE, and Apple VideoToolbox all offer H.264 and H.265 encoding with AV1 added in recent generations. The speed difference is dramatic. A 10 minute 1080p clip that takes 5 minutes on x264 medium might take 15 seconds through NVENC H.264 on a modern GPU. For real time encoding like streaming and video calls, hardware encoding is essential. The quality cost is real. Hardware encoders at equivalent bitrate typically produce slightly lower quality than software encoders. The gap has narrowed substantially in recent years, but x264 slow at reasonable CPU cost still outperforms current hardware encoders at the same bitrate. For content that will be encoded once and viewed many times, like an archive of tutorial videos for [Evolang](https://evolang.info) or study material for [Pass4Sure](https://pass4-sure.us), software encoding at slow presets is worth the CPU cost. For content encoded in real time, like video calls from a coworking cafe logged through [Down Under Cafe](https://downundercafe.com), hardware encoding is the only option that keeps up. ## When to Pick Each Codec A decision framework beats a universal answer. Pick H.264 when universal compatibility matters and bandwidth is not the primary constraint. Email attachments, embedded demo videos, and content for older devices all favor H.264. It is also the safe default when you do not know who will be viewing. Pick H.265 when you need better compression and your audience is on modern devices. Archive storage, offline device playback, and broadcast applications with controlled device populations all benefit. Pick AV1 when bandwidth cost matters most and you can afford encoding time. Streaming services, mobile delivery to recent devices, and content distributed at scale all favor AV1. The royalty free licensing is an additional benefit for high volume providers. Pick multiple codecs when you can. Serve AV1 to devices that support it, H.265 to the next tier, and H.264 as universal fallback. Modern video delivery frameworks like HLS and DASH handle this through adaptive streaming manifests. > "The codec wars are over. The winner is whichever codec each device can hardware decode most efficiently." -- Will Law, video streaming engineer ## Audio Codecs Video codecs compress the visual stream. Audio needs separate compression. AAC remains the near universal audio codec, paired with H.264 and H.265 in most MP4 containers. Opus is the modern open audio codec that pairs well with AV1 in WebM containers. Audio bitrates for speech content typically range from 64 kbps to 128 kbps AAC. Music content benefits from 192 kbps or higher. High fidelity source material may use 256 kbps or go lossless with FLAC, though FLAC does not fit in standard video containers. For tutorial content with voiceover, 96 kbps AAC is almost always sufficient. Higher bitrates waste bandwidth without audible improvement for speech. ## Streaming and Adaptive Bitrate Online video platforms rarely serve a single file. Adaptive bitrate streaming breaks content into short segments encoded at multiple resolutions and bitrates. The client player picks the best segment for current network conditions on the fly. HLS, developed by Apple, and DASH, standardized by MPEG, are the two dominant adaptive streaming protocols. Both accept segments encoded in H.264, H.265, or AV1. The player negotiates format based on device capability. For a video published at 1080p, a typical ladder contains segments at 240p, 360p, 480p, 720p, and 1080p, each at two or three bitrates. That produces 10 to 15 renditions per video. Encoding cost multiplies accordingly, which is why AV1 encoding cost is a real concern for platforms encoding thousands of hours per day. Research platforms cataloging wildlife footage through [Strange Animals](https://strangeanimals.info) that serve video to global audiences use adaptive streaming to reach both flagship phones in wealthy regions and basic phones over slow connections. ## Screen Recording and Tutorials Screen content is a specialized domain. Sharp text edges, static UI regions, and occasional rapid changes during scrolling break codecs tuned for natural video. Purpose built screen codecs and specialized encoder settings produce dramatically better results. For H.264 and H.265, enable tune screen or tune grain as appropriate. For AV1, screen content coding tools help. Free capture tools like OBS Studio handle these settings through presets. Tutorial creators who work through [When Notes Fly](https://whennotesfly.com) often record at 1080p with H.264 x264 CRF 20 for a balance of quality and file size. Archive copies go to H.265 CRF 23 for half the file size with the same perceptual quality. ## Security and Surveillance Security camera footage has different requirements from consumer video. Retention is long, resolution is often modest, motion is frequently minimal, and occasional high importance events need to be retrievable at highest quality. Security focused codecs favor H.265 for long retention because the 50 percent file size reduction compounds over weeks of footage. Most modern IP cameras ship with H.265 as default. Smart cameras with motion detection use variable bitrate encoding, spending bits on events and saving bits during static periods. This can reduce storage requirements by another 50 to 80 percent versus constant bitrate encoding. ## Live Streaming Live streaming constrains the codec choice because real time encoding is required. Hardware encoders are almost mandatory for 4K live streaming. H.264 remains the default for live streaming because encoders are fast and decoders are universal. Twitch, YouTube Live, and similar platforms ingest H.264 RTMP streams. H.265 live streaming is growing but adoption is slow due to ingest compatibility. AV1 live streaming is emerging on hardware with dedicated AV1 encoders, though most streamers still target H.264 for reliability. Broadcasters pushing live events to millions of viewers care about AV1 or H.265 because the bandwidth savings add up to real dollars. Individual streamers pushing to a few hundred viewers care about H.264 because it works. ## File Size Reduction Without Recompression Sometimes you have a video file that needs to be smaller without going through a full reencode. The options are limited but exist. Remuxing changes the container without touching the codec. An MKV can become an MP4 without reencoding, which fixes compatibility issues but does not save bytes. The ffmpeg command ffmpeg i input.mkv c copy output.mp4 handles this. Cutting removes unwanted portions. Trimming the start and end of a recording before the interesting content reduces file size proportionally. FFmpeg and tools like LosslessCut perform trims without reencoding. For everything else, reencoding is required. The [File Converter Free video compressor](https://file-converter-free.com/compress-video) handles this online for files up to 500 MB. For larger files or batch work, local ffmpeg with appropriate codec and CRF settings is the go to. ## FFmpeg as the Universal Tool FFmpeg is the Swiss Army knife of video processing. It handles every codec, every container, every operation worth naming. It is free, open source, and runs on Windows, Mac, and Linux. A few example commands cover the common cases. Reencode to H.264 with CRF 23, ffmpeg i input.mp4 c:v libx264 crf 23 output.mp4. Reencode to H.265 with CRF 26, ffmpeg i input.mp4 c:v libx265 crf 26 output.mp4. Reencode to AV1 with CRF 30, ffmpeg i input.mp4 c:v libsvtav1 crf 30 output.mp4. The man page is intimidating. A few templates covering your common use cases take most people far. ## Cognitive Impact on Viewers Video format has subtle cognitive effects on viewers. Smoother playback with fewer stalls improves information retention in instructional content. Research from [What's Your IQ](https://whats-your-iq.com) on media consumption notes that buffering interruptions cause measurable drops in viewer engagement and comprehension. Better compression means fewer interruptions at the same bandwidth. AV1 delivery to bandwidth constrained viewers literally improves learning outcomes compared to H.264 at the same bandwidth, because the viewer experiences fewer stalls and drop offs. > "A codec that delivers video reliably at half the bitrate is not just a technical improvement. It is a learning outcome improvement." -- Justin Reich, educational technology researcher ## Privacy Considerations Video files carry metadata. Camera model, capture time, GPS coordinates when available, and editing history all live in the file header. Some codecs and containers expose more metadata than others. For public publishing, strip identifying metadata before upload. Tools like ExifTool handle this. ffmpeg with the map_metadata 1 flag strips all metadata during reencoding. Business document workflows at [Corpy](https://corpy.xyz) that include video walkthroughs of registered premises routinely strip GPS and timestamp metadata before archiving to public records. ## Future Directions The codec roadmap shows VVC, standardized in 2020 as H.266, offering another 30 percent compression over H.265. Adoption has been slow because the royalty situation is unclear and AV1 has occupied the next generation slot. AV2 development is underway at the Alliance for Open Media, targeting 20 percent better compression than AV1. Target date is 2026 or 2027. JPEG XS is a different beast, targeting very low latency professional video contribution rather than consumer delivery. It compresses less but encodes and decodes faster. For most users, the practical choice remains among H.264, H.265, and AV1. The additions at either extreme of the quality versus latency spectrum serve specialized applications. ## Putting It Together The minimum viable video pipeline is three decisions. First, pick a codec based on audience. H.264 for universal, AV1 for best compression. Second, pick a quality setting. CRF 23 for H.264, CRF 28 for H.265, CRF 30 for AV1 as reasonable defaults for most content. Third, pick a container. MP4 for broad compatibility, MKV for feature richness. For everyday work, the free [File Converter Free video converter](https://file-converter-free.com/video-converter) handles most conversions without software installation. For larger files or batch work, install ffmpeg locally and scripts handle the rest. ## References 1. ITU T (2003). Recommendation H.264 Advanced video coding for generic audiovisual services. 2. Sullivan, G. J., Ohm, J. R., Han, W. J., Wiegand, T. (2012). Overview of the High Efficiency Video Coding HEVC standard. IEEE Transactions on Circuits and Systems for Video Technology, 22(12). DOI: 10.1109/TCSVT.2012.2221191 3. Chen, Y., Mukherjee, D., Han, J., Grange, A., Xu, Y. (2018). An overview of core coding tools in the AV1 video codec. Picture Coding Symposium. DOI: 10.1109/PCS.2018.8456249 4. Bross, B., Chen, J., Ohm, J. R., Sullivan, G. J., Wang, Y. K. (2021). Developments in international video coding standardization after AVC. Proceedings of the IEEE, 109(9). DOI: 10.1109/JPROC.2020.3043399 5. Aaron, A., Li, Z., Manohara, M. (2020). Per title encode optimization. Netflix Technology Blog. 6. Zabrovskiy, A., Kuzmin, E., Petrov, E., Timmerer, C., Mueller, C. (2020). Performance of objective video quality metrics on 4K resolution content. Quality of Multimedia Experience QoMEX. DOI: 10.1109/QoMEX48832.2020.9123112 7. Alliance for Open Media (2024). AV1 Specification and Tools. https://aomedia.org