Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20864 Discussions

ffmpeg 5.0 breaks QSV syntax for hardware aceceleration

BartZLederman
Novice
6,089 Views

I've just tried ffmpeg 5.0 and it breaks the syntax used for enabling QSV hardware acceleration for decoding and encoding.

 

ffmpeg  -init_hw_device qsv=qsv -hwaccel qsv -i "input file" -c:v h264_qsv [various filters and options] "output file.mp4"

 

used to work just fine.  As far as I could tell from GPU-Z this enabled aceleration on input and output.  But now it results in errors saying the syntax is deprecated and will be removed, it defaults to dxva2 for input and nothing for output.

-hwaccel_output_format qsv

 

is apparently now mandatory, which isn't a really big deal once you know that it's required: but getting the -init_hw_device syntax correct is quite difficult. There are apparently extra arguments now that are required.  The documentation at https://ffmpeg.org/ffmpeg.html is very far from clear on the subject, at least to me.

---qsv

device selects a value in ‘MFX_IMPL_*’. Allowed values are:

auto
sw
hw
auto_any
hw_any
hw2
hw3
hw4

If not specified, ‘auto_any’ is used. (Note that it may be easier to achieve the desired result for QSV by creating the platform-appropriate subdevice (‘dxva2’ or ‘d3d11va’ or ‘vaapi’) and then deriving a QSV device from that.)

Alternatively, ‘child_device_type’ helps to choose platform-appropriate subdevice type. On Windows ‘d3d11va’ is used as default subdevice type.

Examples:

-init_hw_device qsv:hw,child_device_type=d3d11va

Choose the GPU subdevice with type ‘d3d11va’ and create QSV device with ‘MFX_IMPL_HARDWARE’.

-init_hw_device qsv:hw,child_device_type=dxva2

Choose the GPU subdevice with type ‘dxva2’ and create QSV device with ‘MFX_IMPL_HARDWARE’.

 

---

 

Can anyone decode this into something all of us can use?  I have only one Intel processor on my system, so there should be a way to default to the only device available for decoding and encoding.  I'm sure many people will benefit from a clear explanation of how to do this.

 

 

10 Replies
BartZLederman
Novice
6,040 Views

I've just found out it also breaks the VPW accelerated video filter:

-vf "vpp_qsv=w=640:h=480"

[Parsed_vpp_qsv_0 @ 0000000005ecff00] The QSV VPP Scale option is not supported with this MSDK version.

0 Kudos
BartZLederman
Novice
5,939 Views

I've been doing some experimenting.

This much appears to work.

ffmpeg -hide_banner -init_hw_device qsv:hw,child_device_type=dxva2 -hwaccel qsv -hwaccel_output_format qsv [-vsync -1] -i "input"
-c:v h264_qsv -preset [rest of video and audio settings, filters, etc] "output.mp4"

This appears to enable both hardware decoding and encoding. There isn't a good way to measure this in Windows 7: I will try
on Windows 10, the Task Manager GPU page can differentiate between encode and decode.

However, the current QSV / Intel driver is missing an option to supply this information to Task Manager so it won't display the GPU page at all for the Intel CPU I have in my Windows 10 system. Perhaps something can be done to fix this. I can post more information if desired, but it should probably go into a separate topic.

The -vsync problem is bugging me. I thought -vsync vfr was giving me errors, but the most recent times I tried it, it worked.
However, specifying "auto" always fails, contrary to the documentation.  This may actually not be new, but it's more apparent now that ffmpeg tells you to never use a numeric value as input to -vsync .

The vpp_qsv filter error is also odd. Although I got an error message as I showed in my first post, it apparently did in fact
do the scaling properly.  I've tried it a couple of times, and it does appear to scale and crop, even after the warning is issued. So it's anybody's guess what's actually happening.

0 Kudos
David_G_Intel
Moderator
5,981 Views

Hello BartZLederman


Thank you for posting on the Intel️® communities. We are investigating this thread, we will post the updates here.


Regards, 

David G 

Intel Customer Support Technician 


0 Kudos
David_G_Intel
Moderator
5,930 Views

To continue please share with us the Intel® System Support Utility (Intel® SSU) results 


Best regards,  

David G  

Intel Customer Support Technician  


0 Kudos
David_G_Intel
Moderator
5,916 Views

Were you able to check the previous post?  

Let us know if you still need assistance.    


Best regards,  

David G.  

Intel Customer Support Technician 


0 Kudos
BartZLederman
Novice
5,889 Views

I did not see anything for a while, as gmail decided that everything from Intel is 'spam'.  I have (I hope) fixed that.

 

I have had very bad results running the Intel SSU utility in the past, and am reluctant to do so again: especially as the problems I am reporting are built into ffmpeg.  It's my understanding that they link the libraries in, and don't really depend upon what's on the system, in most cases.  This is especially true for various libraries and features.

 

If you are certain that what is installed on my system is relevant and you can't proceed without it, I will attempt to run SSU again.

 

In the mean time, this is the default output of ffmpeg, which shows what's been linked in.  (Should be in an attached file).

 

 

 

 

0 Kudos
David_G_Intel
Moderator
5,888 Views

@BartZLederman SSU will help us replicate the issue and get a better understanding of your current environment, if you get any issues running it let us know to help you out. If you have any questions let us know.


Regards, 

David G 

Intel Customer Support Technician 


0 Kudos
David_G_Intel
Moderator
5,871 Views

Were you able to get the report?  

Let us know if you still need assistance.  


Best regards,  

David G.  

Intel Customer Support Technician 


0 Kudos
BartZLederman
Novice
5,693 Views

I apologize for the delay, I had some issues to attend to that are not related to the issue here.

 

I have run the SSU, and am attaching the results to this note.

 

FYI, I also pressed the "submit" button to upload it directly, and got this:

=================

Server not found

Firefox can’t find the server at servicerequestmgmt.intel.com.

Check the address for typing errors such as ww.example.com instead of www.example.com
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

=================

 

As far as I know, I'm not blocking connections to Intel as I am obviously able to access this forum.  I downloaded SSU from the link given in a previous note only a few minutes ago, so it should be the current version.

0 Kudos
David_G_Intel
Moderator
5,663 Views

@BartZLederman thank you for the report, it seems that you're using an Intel® Core™ i7-3770 Processor (Intel® HD Graphics 4000) due to this product being discontinued, Intel Customer Service no longer supports inquiries for it. You can contact HP for support or you may also find the Discontinued Products website (https://www.intel.com/content/www/us/en/support/discontinued-products.html) website helpful to address your request.  

You can get the specifications and verify this product's discontinuance status at the Intel® Product Specifications website > Product Status > "Discontinued". https://ark.intel.com/ 

Please keep in mind that this thread will no longer be monitored by Intel. Thank you for your understanding.  


Regards, 

David G 

Intel Customer Support Technician 


0 Kudos
Reply