How to make hardware-accelerated h264/hevc encoding work on Intel HD GPUs


#1

Hello everyone!

I figured out a way to make a real-time encoding of h264 fullHD video on Intel HD GPUs (HD3000 and newer), or possibly on newer cards also h265/hevc (not tested) in Shotcut, by using Intel Quicksync technology. I could not find any reliable tutorial and generally there has been a pessimism that this cool feature is not working in Shotcut. NOT TRUE ANYMORE! It works for me so it must work for others too :-)) If Shotcut developers included a qsv-compiled build of ffmpeg to their binary install packages and automagically added the right parameters if these codecs are used, it would work almost out of the box for everybody.

The full guide is published on my blog https://www.brozkeff.net/2017/11/12/how-to-encode-hardware-accelerated-h264-video-in-shotcut-with-intel-gpu-quicksync/

Anyway a tl;dr summary is this:

Download alternative ffmpeg version (https://ffmpeg.zeranoe.com/builds/ - shared linking) with qsv codecs support and copy all dlls and exes from the bin folder to the Shotcut Program files folder (as admin account, confirming UAC dialog), replacing the Shotcut-supplied version of ffmpeg with this enhanced one.
In Codecs now you will see h264_qsv and similar _qsv codecs! For me I had to manually enter values

preset=slow
look_ahead=0
init_hw_device=qsv:hw

to Other tab, to make rendering succesful, otherwise only audio was exported.
Also reduce the Quality value to 10-20% instead of the default 60% to make the bitrate reasonable, because this codec interprets the values in a different way than the x264 codec. Save this as your custom preset and use it.