Open lashchev opened 3 years ago
Decoding usually is quite fast process so I was not even investigated how to use it in ffmpeg.
I have Nvidia GTX 1650 and Intel onboard GPUs in my box. Here is how you can enable and test hardware acceleration works on your FFmpeg.
You can check what your FFmpeg supports hardware decoders by running this:
C:>ffmpeg.exe -hide_banner -hwaccels
Hardware acceleration methods:
dxva2
cuda
qsv
d3d11va
opencl
vulkan
Decoding through CUDA:
ffmpeg.exe -hwaccel cuda -i C:/Videos/MyTest.MP4 -f null - -benchmark
The test above uses GTX Video Decode and makes benchmark running faster on my box by 20-25%
Decoding through Direct-X Video Acceleration API v2:
ffmpeg.exe -hwaccel dxva2 -i C:/Videos/MyTest.MP4 -f null - -benchmark
The test above uses GTX Video Decode and makes benchmark running faster on my box by 10-15%
Decoding through Intel QuickSync:
ffmpeg.exe -hwaccel qsv -i C:/Videos/MyTest.MP4 -f null - -benchmark
The test above uses onboard Intel GPU, but I couldn't make it work on my box so far...
Probably because I have two GPUs and some RDP HW acceleration enabled...
I have not spent too much time on it because I guess GTX should be faster anyway.
Do not use:
I tested this on 4K h.264 files.
More information can be found here
I see. I thought you was talking not about hwaccel option, but about something different. The hwaccel option (as other ffmpeg specific options) is on my ToDo already.
Hardware decoders are kinda awful as far as precision goes. E.g. you could have certain colors on a pc, and others on another (if not even just the same but with different driver versions).
ffmpeg supports hardware decoders and it would be nice to allow such support if compatible hardware is detected Like HandBreak options: