Comparison between H264(x264) and H265(x265/HEVC)

posted in: 2160p, ffmpeg, H264, HEVC, VLC | 0

    A while back when the first UHD televisions surfaced, the original questions we had, my Colleagues and I, was how were the TV service providers going to deliver UHD content to viewers at such a high cost in bandwidth. This was way before AT&T acquired DirecTV. Beaming a signal from space in UHD to a dish on top of a house appeared impossible, the distance, it was not enough surely? Fiber/Coaxial to the house was more of a solid option to go with for such demanding needs. Even with fiber/coaxial, the numbers do not impress. Currently ranked(U.S) top speeds are at 3.80Mbps for 1080p(as of 12/5/15- Netflix Index).
    Word has it that NetFlix encodes their UHD content at 15Mbps(Source). To take advantage of that quality, you need a connection rated at that same minimum bitrate. So how does NetFlix plan on delivering 15Mbps? Maybe its adaptive bitrate, you get what your speed can take. One UHD set will eat around 60% of a 25/25Mbps connection, if you add other devices on the same house, suddenly your connection gets saturated. This is the beginning because UHD quality can go upwards of 100Mbps+, we have to start somewhere.
    As of now H264 is the major player around the world. It is everywhere, mobile streaming, youtube, many online sites utilize it. H265 is the successor to H264. H265 was designed to be efficient at video encoding by utilizing about half of the bitrate(kbps), matching and improving on the fidelity of a H264 image. H264 maxed out at 4K/60fps, while H265 maxes out at 8K, has improved image quality, better color space, better dynamic range and supports up to 300fps.
    Even with its advancements in encoding, x265(HEVC/H265) requires more compute power to decode, devices using batteries will run out of power faster(Source) and it is expensive to license. It cost Apple ~$25million for iPhone 6 to use H265 in Facetime(Source). Google has also added decoders to Android 5 and beyond. Windows 10 supports HEVC natively too. The cost will get passed down to consumers especially when it comes to Netflix, Amazon, Hulu, regular tv service. You will probably need a new set top box(DVR) that has hardware decoding capabilities with more muscle than your current one. Remember the encoding efficiency we were just talking about, the sacrifice is compute power. I think all Samsung UHD models have built-in RVU(Receiver box) for DirecTV service, that probably means the quad-core processor that resides inside the display will be doing the heavy lifting. Vizio has a hexa-core inside their UHD sets. Sharp, Sony, LG, Panasonic may also have processors inside to assist in decoding.
    This is what I’ve tried on the different brands in terms of UHD playback. Early Q1 2015, I tried H264 2160p, playback was unsuccessful. H264(2160p) with AC3 audio failed, same for MP3 audio. The sets follow a very strict compliance when it comes to 2160p decoding. The content has to be HEVC(H265/x265) with AAC audio. Samsung displays can play HEVC without audio but throw out an audio error. Vizio, LG, Sharp playback fine even if audio is missing in the content.
————————————————————————————————————–
Some revisions were done as of December 18, 2015 :: HEVC Advance Releases Revised Licensing Terms
————————————————————————————————————–
OK. Time for some comparisons. At anytime you may open images in new tab.
The first set is a 400kbps quality comparison.
H265 is on the right. Codec details shown :: 30.8MB/H264 :: 32MB/H265


————————————————————————————————————–
Second set is a 800kbps quality comparison. You should start noticing quality improvements by now.
H265 is on the left. ** Heads up ** :: 69.5MB/H264 :: 61.3MB/H265

————————————————————————————————————–
Third set is a 1200kbps quality comparison.
H265 is on the left. :: 94.5MB/H264 :: 91.7MB/H265

————————————————————————————————————–
Fourth set is a 2000kbps quality comparison.
H265 is on the left. :: 153MB/H264 :: 152MB/H265

————————————————————————————————————–
Final set is a doozy. ** I compared H264 @ 4000kbps VS H265 @ 2000kbps
H265 is on the right(making sure you are awake). Results speak for themselves. :: 312MB/H264 :: 152MB/H265


———————————END TEST———————————————————————

    As you can see H265 encoding capabilities are far superior to that of H264. You should also know that it takes longer to encode to H265(Source) and it also requires more compute power to playback. In theory a service could stream at 4000kbps to a consumer that has a 10Mbps connection with good results. A better connection would yield better results, a better UHD set would show better colors. Some of the manufactures are starting to offer 10-bit displays.
    10-bit displays offer more color range for each primary color. A traditional 8-bit panel, uhd or not, offers 256 shades of red, blue, green. 10-bit offers 1024 shades for red, blue, green. Meaning less likely chance of color banding, a blue sky will have many shades, from the lightest blue to the deepest of blue. Simply put 16-Million to 1-Billion colors. There is also a matter of High Dynamic Range(Soon TM), an image shot at multiple exposures, exposures merged for maximum luminosity. These are features that will add even more bandwidth requirement for UHD content.

There is of course a chance this page might contain errors.
These are just little experiments nothing more.

———————————INFO————————————————————————–
ffmpeg was used to do the tests and conversions. A combination of ultrafast and veryslow modes used, parameters matched for each set/section.
ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v libx264 -preset ultrafast -b:v 4000k -minrate 4000k -maxrate 4000k -an BBB_H264_NOAUDIO_2160P_4000k.mkv
ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v libx265 -preset ultrafast -b:v 2000k -minrate 2000k -maxrate 2000k -an BBB_H265_NOAUDIO_2160P_2000k.mkv
——2 Pass——
ffmpeg -y -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v libx265 -preset veryslow -b:v 7501k -minrate 7501k -maxrate 7501k -pass 1 -an -f matroska NUL && \
ffmpeg -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v libx265 -preset veryslow -b:v 7501k -minrate 7501k -maxrate 7501k -pass 2 -an BBB_HEVC_VERYSLOW_NOAUDIO_2PASS_7501k.mkv

———————————LINKS————————————————————————-
ffmpeg
Big Buck Bunny
VLC
VP9 encoding/decoding performance vs. HEVC/H.264
HEVC Patent List
New Patent Pool Wants
Moscow State HEVC Comparison
List of video services using H.264/MPEG-4 AVC
HEVC
Files generated from the experiment :: 1.31GB




Leave a Reply

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