Some Tech Adventures with HEVC

Toomas Römer
3 min readJan 16, 2018

--

My day to day is highly tech related but boils down to working with people rather than directly with software and hardware. So whenever I do have the chance to get my hands dirty I’ll wrestle in mud :)

Anywho. After stumbling on HEVC video compression standard, reading about it and the competing formats for 4K UHD I got quite excited. I was surprised that you need special hardware, mainly the 7th or later generation processors (Kaby Lake and Coffee Lake) just do decode it properly and some big players (Apple, GoPro to name a few) are already moving to the format.

Long story short. Unless you have a fresh system with latest software (High Sierra for Macs or Windows 10) and latest hardware (Kaby Lake, iPhone 7 or newer, Qualcomm Snapdragon 820 or newer etc.) you won’t be able to properly play the content. Properly meaning that high end versions of it won’t play smoothly if they play at all.

The easiest way to see if your system plays them is to try the test files from JellyFish Video Bitrate Test Files. Try downloading the 400mbps 4k uhd hevc 10bit file and see how your system handles it. Of course in real life you won’t stumble on that kind of content very often so trying a 140mbps file would be enough.

As my plan is to get my hands on a new GoPro I needed some upgrades. I picked up a Kaby Lake CPU for my Skylake system one evening and upgraded my machine (be sure to check compatibility with your motherboard and upgrade your BIOS before upgrading the CPU).

To my surprise the video still wasn’t playing smoothly. After a lot of googling and trying different stuff this is how I got it working on Linux. Mind that I had also a NVIDIA card that I use as my primary output.

  • Be sure you have multi monitor enabled in BIOS. Otherwise you cannot use the GPU on the CPU as your primary card is only activated (in my case the NVIDIA).
  • Be sure you know to which video card you have your screen hooked up to
  • I used mpv to play the file. My exact line was mpv --hw-dec=vaapi-copy jellyfish-400-mbps-4k-uh-hevc-10bit.mkv
  • For the vaapi-copy driver to exist I installed the Intel stuff for Linux from the INTEL® GRAPHICS FOR LINUX* page.
  • Result was that my NVIDIA card was outputting a smooth video stream while decoding was happening on the Kaby Lake embedded GPU. The CPU was nearly idle in the process
  • It took me some time to get everything right. If your CPU is at 100% something is still wrong. If mpv is telling you it is falling back to Software Decoding something is still wrong. If the 400-mbps file is not playing smoothly then something is still wrong.

On Windows it is a different story. My current solution is to manually put the HDMI cable into the motherboard output (rather than the NVIDIA) and the players start using the GPU on the CPU for decoding.

I wasn’t able to get it working on Windows with the same configuration as Linux where you have your screen hooked up to your other video card and decoding happening on the embedded one. The video players I tried just didn’t have that option. I did raise a question Superuser but no answer yet.

I guess I’m ready to pick up a new GoPro now. Unbelievable how difficult everything still is in 2017. I’m glad that I stumbled on Debian Potato in my teens, otherwise I wouldn’t have the chops to argue with Linux and the same goes for “fixing” computers in my youth so it doesn’t bother me fiddling with hardware until it “clicks”.

--

--

Toomas Römer
Toomas Römer

Written by Toomas Römer

VP of Eng @ Bolt Technology, Co-founder of ZeroTurnaround, Geek, Hackepreneur

No responses yet