When To Use H.264 vs. HEVC For Video Compression [u]

[ UPDATED: Dec. 27, 2020, with information on Apple M1 & T2 chips for media compression, along with a better explanation of when HEVC compression makes sense for media creators. ]

Richard Deeble recently asked:

I have a 2017 Retina iMac, running Mojave and have a question relating to H.264 and HEVC.

I created a 4K 30 fps project, 4:12 in duration, using Rec. 709 color space. When I use Compressor to compress the video:

I can’t see any obvious advantage of using HEVC. Can you advise me?

Larry replies: These are great questions, but the answer is complex. Let’s start with the easiest: compressed file size.

FILE SIZE

In general, file SIZE is almost totally determined by bit rate. So, two files with the same bit rate will be pretty much the same size, as Richard reported. However, while those files will be the roughly the same size, they won’t necessarily have the same image quality.

Because image QUALITY is based upon six factors:

For this reason, you can’t compare compressed files solely on final file size.

COMPRESSING 4K

This screen shot illustrates that Apple Compressor can create H.264 files for social media up to 4K in size.

NOTE: UHD is 3840 x 2160 pixels. “True 4K” is 4096 by up to 2304 pixels; though more generally 2160.

And this screen shows social media compression settings in Adobe Media Encoder.

Both these popular apps can compress 4K images using the H.264 codec.

So, why use HEVC?

HEVC CREATION STORY

HEVC was created to solve a problem with cellular networks – they were drowning in video. Cellular was first invented to carry voice (audio) and, a bit later, text. Both these files, when compared to video, are small.

However, as phones got smarter and video became more pervasive, we started watching more video. Not just on our TV sets or computers, but on mobile phones and iPads. This put a tremendous burden on the cell networks, which weren’t designed for this level of data traffic.

HEVC (originally called H.265) was invented to help solve this problem. HEVC was designed so that a file with 30% lower bit rate would display the same image quality as an H.264 file at the higher bit rate. This means that if everyone sending files over cell networks used HEVC for all their movies, the cell networks would have 30% more bandwidth available to support more users or more data traffic.

My research has shown this to be a reasonably true statement: a video created using HEVC at a lower bit rate has the same image quality as an H.264 video at a higher bit rate.

The problem is that, for most of us, this isn’t relevant.

Why? Because we are not supplying media directly to cell networks. Instead, we are uploading files to YouTube or Facebook or Vimeo or Twitter. Behind the scenes these social media giants are automatically converting the file we send them into a variety of different codecs and formats for all the different ways we view video today.

NOTE: A couple of years ago, I counted the number of codecs that YouTube converted our videos into. It came to 20 different formats for each video! This is what’s happening when YouTube displays its “Processing” dialog after you upload a file.

UPDATE: WHY USE HEVC – PART 2

There are, however, two good reasons to use HEVC, rather than H.264, when compressing media:

For these two reasons, especially as we move into greater distribution of HDR media, HEVC will become increasingly important.

WHY DOES IT TAKE SO LONG TO COMPRESS HEVC VIDEO?

HEVC is a highly-compressed format. This means that the math involved is very complex and takes a long time to calculate. It uses “asymmetrical compression,” meaning it takes a long time to compress so that playback can be viewed in real-time.

To speed this compression process, modern Intel CPUs support 8-bit hardware acceleration for both H.264 and HEVC video formats. What this means is that compression is done in hardware, which is about ten times faster than software. But, 8-bit doesn’t support HDR.

As well, HEVC is such a new format that older systems don’t support hardware acceleration because HEVC wasn’t invented when those chips were designed. Still, even with hardware acceleration, HEVC compression for both Compressor and AME takes anywhere from 10-40% longer than H.264, depending upon the source codec and compression settings.

NOTE: Here’s a detailed article comparing compression speeds for H.264 and HEVC using Apple Compressor and Adobe Media Encoder. (This chart was compiled prior to the release of the Apple T2 chip.)

UPDATE: APPLE CHANGES THE RULES WITH NEW CHIPS

Prior to Apple releasing the AfterBurner, T2 and M1 chips, hardware acceleration was limited to 8-bit H.264 files using Intel CPUs.

Afterburner, while it sped media transcoding is ProRes only.

However, the new M1 chip from Apple (part of the three new Macs launched in November, 2020) can accelerate encoding of H.264, 8-bit HEVC, and 10-bit HEVC using hardware. This vastly speeds compression of these codecs.

As well, recent Intel-based Mac computers that include the T2 chip can also use it to hardware accelerate both 8-bit HEVC and 10-bit HEVC encoding.  (The T2 chip architecture is included as part of the M1 chip.)

In Apple Compressor, hardware acceleration is always single pass. Enabling multi-pass turns off hardware acceleration. As well, make sure to select the “Faster” compression option.

Adobe Media Encoder has two Bit Rate settings that can turn off hardware acceleration: CBR and VBR 2-pass. For fastest compression be sure to always select VBR 1-pass.

NOTE: In the past, we used 2-pass software compression because it created files that looked better. Based on my observations, using today’s CPUs, hardware-accelerated compression looks as good as, or better than, media compressed using software. And it gets done a WHOLE lot faster!

WHAT SHOULD WE DO?

If you are sending files to social media, use H.264 at a high bit-rate – say 15 Mbps. Since your files will be recompressed once the upload is complete, there’s no reason to waste time compressing HEVC and the higher bit rate gives the social media platform extra data to work with during compression.

If you are sending files that will be delivered directly to viewers over the Internet and they are not on cellular devices, H.264 is also fine, because when computers access the web, they are not using cell networks in most cases.

You only need to create HEVC files if you need to create a compressed HDR file for distribution – or – when the files you create will be viewed directly on cellular devices, without first going through a social media site. And, unless you are running your own website, this second situation will be rare.

While using HEVC can save upload time by creating smaller files, the time we save uploading is more than likely offset by taking longer to compress the media files in the first place.

SUMMARY

HEVC is essential for final distribution of HDR media files or any files sent over cell networks. It reduces data traffic while maintaining image quality. All modern browsers support HEVC.

However, for media creators uploading files to social media, there’s no big benefit to using HEVC. Yes, the uploaded file is smaller, but the additional compression time may not be worth the trade off.

Files created for broadcast, cable, digital cinema or OTT services use codecs other than H.264 or HEVC, so for media creators producing files for these distribution outlets, the question of HEVC is not relevant.

As always, share your thoughts in the comments.


Bookmark the permalink.

10 Responses to When To Use H.264 vs. HEVC For Video Compression [u]

  1. My feeling is that HEVC has far more accurate color rendition. H264 generally leaves me wanting when I look at the result versus the original file. Not so with HEVC

  2. Clayton Moore says:

    More work then H264 to compress or encode but less work then H264 to decode and playback.

    Having said that, my Panasonic GH5 has a 4k HEVC record setting built right into the camera meant to create Hybrid Log-Gamma. It requires the camera to be re-started to use it …. but WOW highlight roll-offs and general dynamic range are smoooth and …. man it makes pretty files. I apply a LUT for that in FCP (using an OLD) mac and I have a 709 compliant file with NO rendering needed.

    • Clayton Moore says:

      oh yea I forgot to Larry’s point bandwidth wise, it does that (at 24fps in this case) at only just under 64 Mbit/s

  3. Cosmin says:

    I have a Fuji X-T3 setup with 4K DCI HEVC 10-bit internal recording. I am exporting from FCPX as Master File h264 and the exported video files are about 50 Mbit/s.

    Is my logic of shooting HEVC 10-bit and exporting h264 any good? My final clips are personal, family movies for archiving.

    • Larry says:

      Cosmim:

      Well, it isn’t bad. H.264 is only 8-bit, so you lose the value of 10-bit HEVC. On the other hand, you are creating family movies, which are not likely to need excessive effects or color grading.

      The purpose of family movies is to capture memories – any codec you choose will allow you to do that.

      Larry

  4. Pippa Jean Young says:

    Hi Larry,

    Thanks so much for your excellent articles, I have been saved many a time by your advice – your information on sound improvement is so helpful.

    My question is about videos I’m delivering for a client to be broadcast on Vimeo/Wistia. You said that HEVC is not necessary for “social media”, but does that include Vimeo/similar players?

    I’m wondering whether the compression on those players means HEVC is not needed.

    Many thanks!

    Pippa

    • Larry says:

      Pippa:

      See if Vimeo has any specific recommendations. Personally, compressing H.264 at a high bit rate will be faster and better than HEVC. HEVC is for the Vimeos of the world to use for distribution. Until HEVC is seriously hardware-accelerated, it isn’t worth our time to compress.

      Larry

  5. Norris Tidwell says:

    From this article and comments to, I find that my 2019 16″ MacBook Pro using FCP X cannot export HDR movie even though I have clips that are 4K. If so, I find this astounding that I can record 4K on both my iPhone 7 and GoPro Helo8 Black but can only export 8 bit movies.

    • Larry says:

      Norris:

      That’s not a completely true statement. ProRes, which is 10-bit, supports HDR images. In fact all HDR in distribution is 10-bit, even if the camera masters were 12-bit or greater.

      H.264 is only 8-bit, so it can’t be used for HDR. It may be that you have, by accident, selected H.264 for your export, which does not support HDR values.

      HEVC can be either 8- or 10-bit, but 10-bit is required to support the increased grayscale values of HDR. ANY computer can compress 10-bit HEVC. However, if it is done using software, the process is extremely slow. While hardware-accelerated 8-bit HEVC encoding has been around for a while, hardware accelerated, 10-bit HEVC encoding has only been possible in the last 2-3 years.

      Larry

Leave a Reply

Your email address will not be published. Required fields are marked *

Larry Recommends:

FCPX Complete

NEW & Updated!

Edit smarter with Larry’s latest training, all available in our store.

Access over 1,900 on-demand video editing courses. Become a member of our Video Training Library today!

JOIN NOW

Subscribe to Larry's FREE weekly newsletter and save 10%
on your first purchase.