H.265 (HEVC) vs H.264 (AVC) Compression: Explained!

Hi, it's HandyAndy Tech Tips here. And today I'm going to tell you why H.265
HEVC, the latest video compression standard, is so awesome! Now, you know, video encoding has evolved
a lot through the years. From the very early MPEG-2, which was used
on DVDs way back in 1996, to the most recent H.264. But every new standard seems to promise the
same thing: identical quality to the previous one, but at half the bitrate. So how does H.265 achieve this? Well, there's two main methods used in video
compression. One is called "interframe", which means that
the previous and future frames are compared to the current one, and we only encode what's
changed. To do this, we start on an I-frame, which
is stored as a full image, much like a JPEG. Then, we divide it into small 16 x 16 pixel
areas – which, in the previous standard, were called "macroblocks". Now, we're going to advance to the next frame,
and compare its macroblocks with that of the I-frame. If there are several blocks which are roughly
the same, then we give the new frame the status of a P-frame: that is, a predicted frame. This means that what we can easily do is intercode
block A – so, because it's identical, we can just bring the pixel values directly across
– and then we can intracode block B. In other words, give it entirely unique pixel values
that are only for this frame. Now here is the H.265 difference. Macroblocks have now been renamed to "coding
tree units", and they can range from the original 16 x 16 size way up to 64 x 64. Now, why is this such a big improvement? Well, you've got to remember that, when H.264
was first standardized back in 2003, 1080p video was the height of technology! Now, of course, we've got 4K, and more efficient
encoding is needed. And this is exactly what larger macroblocks
give you. Now, the second big improvement has to do
with intra-frame compression – in other words, comparing areas within the same frame and
looking for redundancy. And the improvement is… wait for it… the
increase in prediction directions! What? Well, remember these things? Coding tree units, also called macroblocks? They can actually be split further, into things
called coding units, which can go down to 8 x 8 pixels. And these – get this – they can be partitioned
even further, cut up different ways into prediction units. Why would we bother doing this? So we can mathematically generate pixel values
in a block, instead of storing them. And, therefore, we can massively reduce the
size of each frame. Here's how it works – I've got my tiny little
prediction unit here, a little 4 x 4, and it's surrounded by two groups of pixels, which
I'll call Block A and Block B. Now, I can actually use various intra-prediction modes
on this structure. I can use, for example, DC, which will basically
fill this with the average of the surrounding pixels. This would be good on an outdoor scene, with
a blue sky, where there's no real pattern to it, it's more of a, just a single colour. Alternatively, I can use an angular function. So, say for example, if I have a line coming
down here, and I want to continue it through the block. Using my angular function, I simply point
to the direction where the line is coming from, and it will extrapolate, or continue,
that trend. Now, here again, there is a difference with
H.265, and it's a good one. Back in the old days, I only had 9 prediction
modes, but now I have access to – wait for it – 35 different modes! Now, the advantages to this are many, including
far greater accuracy when larger block sizes are used – say, for example, in 4K video – and
generally much better quality compression. So, they are the main reasons why H.265 is
better. Bit exhausting, hey? But they're all theoretical, and what you
might want to know is: when can you use it? And the answer to that, unfortunately, is
"not as often as you'd like". I mean, you can't upload videos encoded with
it to YouTube, and most web browsers don't support playing H.265 natively. But, it's been adopted as the default codec
on 4K Blu-Ray, and, of course, you can play it back on your PC, but you might need to
use software decoding. Anyway, I'm HandyAndy and thank you very much
for watching my video on H.265. Please subscribe to my channel for more tech


  1. Brian Fong said:

    0:04 hay-ch dot 265
    Love the accent!
    We say eigh-ch in Canada.

    June 30, 2019
  2. Andy Boa said:

    ok, h.265 or DivX, which is better?

    June 30, 2019
  3. John Stockton said:

    So which cameras record in H.265 HVEC?

    June 30, 2019
  4. Patrick Wilcox said:

    Thank you Andy. You rock man.

    June 30, 2019
  5. Elvis Van said:


    June 30, 2019
  6. Elvis Van said:

    ⛅4PM Jun 9 2019~

    June 30, 2019
  7. Julian Leung said:

    These patent-infested codec will not be there in the future.

    June 30, 2019
  8. Jason Evan Baldwin said:





    IS "STEALING", YOU SHOULD ALL GET JAIL.                                                                                                                      The Most Corn, listen to sample's and full track's ?, 



    June 30, 2019
  9. damon mcdonald said:

    Loving the content , Keep up the good work!

    June 30, 2019
  10. Iamdonald duck said:

    Can h.264 be converted to h.265 ?

    June 30, 2019
  11. M said:

    I'm looking to buy a nas enclosure. The syonolgy ds918+ in description says h.265 4k transcoding but the one I want qnap ts 653b says 4k h.264 transcoding. So is synology the better one. It don't have a HDMI port for direct tv plug in nor is it able to connect to computer via usb… this is what was pushing me to qnap. Will this h.265 vs h.264 effect my 4k experience? If this synology that's advertised as h.265 transcoding is the better one then it's going to save me about £300 it will just be minus 2 bays, the HDMI port which will mean I'll need to use a plex app on my tv or connect it to my nvidia shield and it's minus the feature of being able to connect straight to my pc by usb port to transfer files. Some of my movie files actually say they are h.265 too. Sorry if i sound like a noob but im new to this.

    June 30, 2019
  12. VariTimo said:

    Really off framing. FYI 4K video viewing doesn’t yield benefits compared to 2K. Look at the resolution demo on Yedlin.net

    June 30, 2019
  13. Tyler Warren Ellis said:

    Hetch.265 is definitely the future but most places still use Hetch.264

    June 30, 2019
  14. rashonmyeed said:

    I understood more in 4 minutes than 4 weeks from my prof

    June 30, 2019
  15. 01eg.art said:

    Phone camera apps that record in HEVC produces cleaner sky videos in 4k. Other camera apps makes the sky pixelated in 4k.

    June 30, 2019
  16. Justice Moody said:

    I understood everything. 😳

    June 30, 2019
  17. REPATH ATHYALA said:

    Hi Andy, Thank you for the video, as the comments indicate as well.
    can you please suggest .264 player or any convertor from .264 to mp4, I tried with many online, and failed miserably including VLC.

    June 30, 2019
  18. degacci said:

    Very informative thank you, I purchased a HIK vision H.265 4mp camera and it wasn’t cheap, to be honest I’m not happy with the resolution but it might just be from the setting or cause it’s plugged into a TV that isn’t 4K. I’m waiting to call tech support when they open tomorrow. Anyway thanks!

    June 30, 2019
  19. Sean Sean said:

    Great video !

    June 30, 2019
  20. tredstone said:

    What's it like to be so clever ? Dam

    June 30, 2019
  21. Udarnik Ratko said:

    At the end, everything is more or less the same, our eye or ear can't see or hear the difference(neither the size is significantly smaller), but you are forced to buy a new tv (no matter your Samsung or LG is still under warranty) with a box where the biggest letters say "H265 SUPPORT" or you can loose hours and nights to recode to x264 because process is slower then a recording itself.

    June 30, 2019

Leave a Reply

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