Ruslan-B / FFmpeg.AutoGen

FFmpeg auto generated unsafe bindings for C#/.NET and Core (Linux, MacOS and Mono).
GNU Lesser General Public License v3.0
1.37k stars 323 forks source link

use Intel GPU Decode,Error initializing an MFX session: -3 #283

Closed huanyi00 closed 1 year ago

huanyi00 commented 1 year ago

I need use Intel GPU decode,chosse AV_HWDEVICE_TYPE_QSV,but initializing error .show API version error .I install intel media sdk,but still error.

Current directory: D:\FFMPEG\FFmpeg.AutoGen-6.0.0.2\FFmpeg.AutoGen.Example\bin\Debug\net6.0 Running in 64-bit mode. FFmpeg binaries found in: D:\FFMPEG\FFmpeg.AutoGen-6.0.0.2\FFmpeg\bin\x64 FFmpeg version info: 6.0 Use hardware acceleration for decoding?[n] y Select hardware decoder:

  1. AV_HWDEVICE_TYPE_CUDA
  2. AV_HWDEVICE_TYPE_DXVA2
  3. AV_HWDEVICE_TYPE_QSV
  4. AV_HWDEVICE_TYPE_D3D11VA
  5. AV_HWDEVICE_TYPE_VULKAN Selected [2] 3 Decoding... [tcp @ 000002257bd26cc0] Starting connection attempt to 192.168.1.24 port 554 [tcp @ 000002257bd26cc0] Successfully connected to 192.168.1.24 port 554 [rtsp @ 000002257bd26500] SDP: v=0 o=- 2310377286153 2310377286153 IN IP4 192.168.1.24 s=Media Presentation e=NONE b=AS:5050 t=0 0 a=control:rtsp://192.168.1.24:554/h264/ch1/main/av_stream/ m=video 0 RTP/AVP 96 c=IN IP4 0.0.0.0 b=AS:5000 a=recvonly a=x-dimensions:1920,1080 a=control:rtsp://192.168.1.24:554/h264/ch1/main/av_stream/trackID=1 a=rtpmap:96 H264/90000 a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z0IAKY2NQDwBE/LNwEBAUAAAcIAAFfkAQA==,aM48gA== a=Media_header:MEDIAINFO=494D4B48010300000400000100000000000000000000000000000000000000000000000000000000; a=appversion:1.0

[rtsp @ 000002257bd26500] setting jitter buffer size to 500 [h264 @ 000002257bd27a80] Reinit context to 1920x1088, pix_fmt: yuvj420p WARNING: defaulting child_device_type to AV_HWDEVICE_TYPE_DXVA2 for compatibility with old commandlines. This behaviour will be removed in the future. Please explicitly set device type via "-init_hw_device" option. [AVHWDeviceContext @ 000002257c9a5e00] Using D3D9Ex device. [AVHWDeviceContext @ 000002257c9a5f80] Use Intel(R) Media SDK to create MFX session, API version is 1.35, the required implementation version is 1.3 [AVHWDeviceContext @ 000002257c9a5f80] Error initializing an MFX session: -3.

Ruslan-B commented 1 year ago

Not a binding issue or bug, firstly you are using precompiled ffmpeg binaries from repo which might be assembled with some flags musing or other call need done before initializing HW context. It how to setup environment as it based on tom old version of MFX. Just out of curiosity - why do you need outdated HW support for DXVA aka MFX?

Ruslan-B commented 1 year ago

I don't have Intel CPU with integrated GPU at reach so can help you much here, but the rest of options seems to be working fine - it same code for all codecs it not binding defiantly - besides you are using ffmpeg native binaries from repo it simply might be build without this feature or environment problem.