Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hardware decoders #23

Open
lashchev opened this issue Mar 8, 2021 · 4 comments
Open

Support hardware decoders #23

lashchev opened this issue Mar 8, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@lashchev
Copy link

lashchev commented Mar 8, 2021

ffmpeg supports hardware decoders and it would be nice to allow such support if compatible hardware is detected
Like HandBreak options:
image

@fifonik
Copy link
Owner

fifonik commented Mar 8, 2021

Decoding usually is quite fast process so I was not even investigated how to use it in ffmpeg.

@fifonik fifonik added the enhancement New feature or request label Mar 8, 2021
@lashchev
Copy link
Author

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:

  • Decoding through d3d11va, opencl uses GTX Video Decode but makes benchmark running 5 times slower!
  • Decoding through vulkan uses GTX Video Decode but makes benchmark running 2 times slower!

I tested this on 4K h.264 files.

More information can be found here

@fifonik
Copy link
Owner

fifonik commented Mar 11, 2021

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.

@mirh
Copy link

mirh commented Feb 16, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants