Update obsolete flag in Intel video decoder.#14775
Conversation
|
I have observed this on two different laptops with both an Nvidia and Intel iGPU
Even if this issue is only apparent on the two laptops I have tested the manual (mediasdk-man.pdf) for the minimum API version OpenCV currently supports is 1.19 (2017 R1) states
On two separate but related issues:
I cannot comment on encoding for (1) and (2) as I have not tested this but if the same holds then wouldn't it be better to have a minimum fully supported API of 1.19, request hardware decoding always and output some information to the user if it is not available, like below? |
|
CUDA stuff is here for many years. So it is fine to maintain some backward compatibility. MediaSDK backend is something new. So it is fine to target for the modern versions at first (it was added ~1 year ago, so 2027 is OK). Previous versions are not in our scope of interest currently (and also there are no OpenCV users which has MediaSDK backend working with MediaSDK previous releases). BTW, documentation link about the flag: https://github.com/Intel-Media-SDK/MediaSDK/tree/master/doc |
Old flag resulted in software implementation being selected when the Intel decoder is not the primary adapter.
|
Thank you alalek.
The API version affects the hardware OpenCV is run on not the version of the SDK it is compiled against, if any users have a 4th generation Intel CPU and the requested API version is left at 1.19 decoder initialization will fail even though the decoding performance on a 4K h264 file on the iGPU of a i5-4210U (low end dual core mobile CPU) is nearly as good as that on a GTX 980M and only half that on a GTX 1060. I understand that it is not in scope however adding support with the appropriate message as above "shouldn't" break anything and it would be a win for Intel vs Nvidia. Additionally do you think it would be a good idea to force the request of the hardware decoder and give the correct output if it is not available? For me it was a little frustrating when I was performing decoding on test machines and the software decoder was selected automatically. Every time I had to either examine the CPU/iGPU usage or the libmfxxxXX.dll module which was loaded. |
If you have tested it with 1.17 feel free to propose a patch with this change.
Idea behind |
On systems where the Intel GPU is not the primary device the obsolete flag MFX_IMPL_AUTO may cause a capture device created with the CAP_INTEL_MFX flag to use the software and not the hardware video decoder.
I can reproduce on a laptop with both an Nvidia and Intel GPU. Before the change the result of this was
impl == MFX_IMPL_SOFTWAREafter the change
impl == MFX_IMPL_VIA_D3D11 & MFX_IMPL_HARDWARE2Even if this does not effect every multiple device/monitor setup the obsolete flag should probably still be updated