softworkz / ffmpeg_dx11

Mirror of git://source.ffmpeg.org/ffmpeg.git
https://ffmpeg.org
Other
0 stars 1 forks source link

Switching between DX9 and DX11 #3

Open softworkz opened 4 years ago

softworkz commented 4 years ago

One typical with explicit (DX9) device selection is like that:

-qsv_device 3 -c:v:0 h264_qsv -hwaccel:v:0 qsv -hwaccel_device:v:0 hw4 -i input.mkv ...

The Intel patch suggests to use

-init_hw_device qsv:,child_device_type=dxva2

for switching between DX9 and DX11.

The downside of that approach is that it is forcing the use of init_hw_device, which is somewhat limiting with regards to the possible syntax and I don't think that it allows to select a specific adapter at the same time.

Our approach is a little different - we're using a global parameter qsv_use_dx11 for this (nobody will ever mix DX9 and DX11). That allows to use the same command line syntax for both DX9 and DX11 and you can switch between both, by adding the global option or not:

qsv_device 1 -qsv_use_dx11 -c:v:0 h264_qsv -hwaccel:v:0 qsv -hwaccel_device:v:0 hw2 -i input.mkv ...