In the last days, I investigated the capabilities of FFmpeg to support hardware acceleration during video processing. In the following I give a rough overview about my results.
First of all, one has to know the different available hardware acceleration APIs in FFmpeg. The FFmpeg trac gives an overview about this: https://trac.ffmpeg.org/wiki/HWAccelIntro
Intel describes the possibilities with their hardware and FFmpeg:
„Get Fast Media Application Performance through Hardware Acceleration“
„Intel® Quick Sync Video and FFmpeg Installation and Validation“ (Installation guide)
Google describes the possibilities with their operating system and FFmpeg:
„Compatibility Definition – Android 6.0“ (includes an overview about supported video/audio codecs depending on the Android version)
Supported video codecs
In the following tables I list all special codecs which can be used for hardware accelerated video processing under the corresponding operating system. Additionally, I have marked each tested codec with green text color. The results will be updated while the ongoing tests.
The graphic cards are supported by the VideoToolBox modules.
NVIDIA cards are supported by the nvenc modules.
Intel cards are supported by the qsv and vaapi modules.
|MPEG 4||mpeg4_cuvid (Source)|
The embedded cards are supported by the MMAL modules.
Example for NVIDIA hardware
For a usual transcoding you would use a command like this to create H.264 video output:
ffmpeg -i big_buck_bunny_1080p_stereo.avi -c:v libx264 output_x264.mp4
Instead of the above, for a hardware accelerated encoding you can use the following command:
ffmpeg -i big_buck_bunny_1080p_stereo.avi -c:v h264_nvenc -profile high -pixel_format yuv420p -preset default output_nv264.mp4
Especially for the nvenc modules you can use the following commands to get a list of supported profiles and presets.
ffmpeg -h encoder=nvenc_h264
ffmpeg -h encoder=nvenc_hevc