Play HEVC/H.265 Videos and Embed HEVC Streams into MP4 and TS Files with openHEVC and GPAC

I wrote an introduction to H.265 (aka HEVC) at the end of last year, including instructions showing how to encode videos to HEVC using the reference implementation. It worked but since it was not optimized for speed, it was extremely slow. Today I’ve stumbled across openHEVC, a open source compliant HEVC video decoder written in C, created as a fork of Libav. This is supposed to work pretty well as the implementation was used at Roland Garros Tennis tournament to playback an 720p50 HEVC stream transmitted over DVB-T2, IPTV, and MPEG DASH.

Create MP4 and TS files with HEVC / H.265 Codec

If the file extension is .hevc FMT=HEVC argument is not needed, in all other case you need to add this argument or MP4Box will detect the input file is corrupt. You also need to indicate the fps, which is conveniently the number right after the resolution in the filenames of BCC samples.

Now let’s play the video

./MP4Client output.mp4

It works. Perfect! The last step is to convert the MPE$ video into a transport stream, and play it back:

./mp42ts -prog=output.mp4 -dst-file=hevc.ts
./MP4Client hevc.ts

Success as well! My CPU usage is currently quite high (150%) when playing the “cactus” video, but the code may not be fully optimized yet, although I can see files with SSE/SSE4 instructions for x86 HEVC implementation, and there are some development branches called hm10.1_simd and hm10.1_simd2. There’s no directory for arm support just yet in openHEVC, and no reference either to HEVC or H.265 in libavcodec arm directory, so for HEVC on ARM (ARMv7 with NEON and/or possibly GPGPU), you may be limited to commercial solutions for now, unless you implement your own HEVC decoder.

@Vivekanandhan
No this won’t work, and it won’t build if there’s still no ARM optimization.
If ARM support has been added, you may be able to play some videos with a low resolution like 320×240 or maybe lower, and the frame rate will also be low. This needs to be tested for accurate numbers.