MediaSDK icon indicating copy to clipboard operation
MediaSDK copied to clipboard

I found that using MediaSDK-intel-mediasdk-21.3.5 version failed to decode on the machine (sample_decode.exe h264 -i 1.h264 -o 1.yuv), but using ffmpeg to use avcodec_find_decoder_by_name("h264_qsv"); the decoder can successfully decode normally

Open 1515guo opened this issue 4 years ago • 16 comments

System information

  • CPU information(cat /proc/cpuinfo | grep "model name" | uniq):
  • GPU information(lspci -nn | grep -E 'VGA|isplay):
  • Display server if rendering to display(X or wayland):

Issue behavior

Describe the current behavior

Describe the expected behavior

Debug information

  • What's libva/libva-utils/gmmlib/media-driver/Media SDK version?
  • Could you confirm whether GPU hardware exist or not by ls /dev/dri?
  • Could you attach dmesg log if it's GPU hang by dmesg >dmesg.log 2>&1?
  • Could you provide vainfo log if possible by vainfo -a >vainfo.log 2>&1?
  • Could you provide strace log if possible by strace YOUR_CMD >strace.log 2>&1?
  • Could you provide libva trace log if possible? Run cmd export LIBVA_TRACE=/tmp/libva_trace.log first then execute the case.
  • Media SDK tracer output (https://github.com/Intel-Media-SDK/MediaSDK/blob/master/tools/tracer/README.md)?
  • Do you want to contribute a PR? (yes/no):

1515guo avatar Nov 22 '21 06:11 1515guo

Snipaste_2021-11-22_15-00-54

1515guo avatar Nov 22 '21 07:11 1515guo

Snipaste_2021-11-22_15-03-38 Snipaste_2021-11-22_15-04-36

1515guo avatar Nov 22 '21 07:11 1515guo

No matter what h264 file is on this machine, sample_decode.exe always fails, but my machine uses sample_decode.exe to decode normally, and ffmpeg uses "h264_qsv" both machines are normal.

1515guo avatar Nov 22 '21 07:11 1515guo

I use Intel(R) Media SDK 2019 R1 to decode, can decode sucess,but the decoded data is often green screen

1515guo avatar Nov 22 '21 07:11 1515guo

Snipaste_2021-11-22_15-30-20

1515guo avatar Nov 22 '21 07:11 1515guo

@dmitryermilov

1515guo avatar Nov 22 '21 09:11 1515guo

Please try to add -hw: sample_decode.exe h264 -i 1.h264 -o 1.yuv -hw

dmitryermilov avatar Nov 22 '21 09:11 dmitryermilov

请尝试添加-hw: sample_decode.exe h264 -i 1.h264 -o 1.yuv -hw Snipaste_2021-11-23_14-25-17 hello,i add -hw has fails

1515guo avatar Nov 23 '21 06:11 1515guo

It's Ivybridge. Pretty old driver and HW. It's very hard to say what's wrong. I'd suggest you to experiment. Try -d3d9 vs d3d11. Try to collect msdk api traces (tracer is a part of MSDK Windows Dev kit) in case of ffmpeg and sample and compare. Try to remove MFXQueryAdapters call from the sample and hardcode some adapter value instead

dmitryermilov avatar Nov 23 '21 22:11 dmitryermilov

hello ,I commented out GetImpl and found that the decoding on some machines is normal, and the decoding on some machines is green screen.@dmitryermilov Snipaste_2021-11-30_15-56-42

1515guo avatar Nov 30 '21 07:11 1515guo

normal machines is i3 3210,the machines GetImpl is failed,MFX_ERR_NOT_FOUND(-9), MFXQueryAdapters failed

1515guo avatar Nov 30 '21 08:11 1515guo

What is the difference between normal and non-normal machine?

dmitryermilov avatar Nov 30 '21 08:11 dmitryermilov

Sorry, what I mean is that on the i3 3210 machine, GetImpl failed and it can’t be decoded. I commented out GetImpl and used initPar.Implementation = MFX_IMPL_HARDWARE_ANY; and the decoding was successful, and the decoded data was normal.

What is the difference between normal and non-normal machine?

1515guo avatar Nov 30 '21 08:11 1515guo

Snipaste_2021-11-30_16-51-32 Snipaste_2021-11-30_16-51-52 I mean is that on the i3 3210 machine, GetImpl failed and it can’t be decoded. I commented out GetImpl and used initPar.Implementation = MFX_IMPL_HARDWARE_ANY; and the decoding was successful, and the decoded data was normal.

1515guo avatar Nov 30 '21 08:11 1515guo

Ahh. Okay. Most likely old mediasdk run-time library doesn't support something which is needed by https://github.com/Intel-Media-SDK/MediaSDK/blob/510d19dcace1d8c57567fdd40b557155ab11ab8e/api/mfx_dispatch/windows/src/mfx_dispatcher.cpp#L542

dmitryermilov avatar Nov 30 '21 09:11 dmitryermilov

I guess ffmpeg simply doesn't use MFXQueryAdapters. MFXQueryAdapters is an optional function.

dmitryermilov avatar Nov 30 '21 09:11 dmitryermilov