aliakseis / FFmpegPlayer

Simple FFmpeg video player
MIT License
151 stars 44 forks source link

FFmpeg dxva2 block when h265 #28

Open ChuLiqiang opened 3 years ago

ChuLiqiang commented 3 years ago

I used old version ffmpeg_dxva2.cpp。 when i used it to h265. i find my runing exe is block. do you know this problem。it is WaitForSingleObject and block.

00 104af0c8 74c01194 00002f68 000003e8 00000000 ntdll_777c0000!NtWaitForSingleObject+0x15 01 104af0e0 74c01148 00002f68 000003e8 00000000 kernel32!WaitForSingleObjectEx+0x43 02 104af0f4 62245d12 00002f68 000003e8 0000004a kernel32!WaitForSingleObject+0x12 03 104af11c 6224695a 00000007 0000004a 24bab118 nvd3dum+0x7b5d12 04 104af138 62257133 0000004a 11baf6f0 104af190 nvd3dum+0x7b695a 05 104af148 69bd1dee 4932c000 104af17c 24a5a444 nvd3dum+0x7c7133 06 104af190 69bd1956 24bab118 00000003 24a73d60 d3d9!Direct3DCreate9+0x138c 07 104af1cc 69e77b64 24a73d60 11baf6f0 00000003 d3d9!Direct3DCreate9+0xef4 WARNING: Unable to verify checksum for avcodec-58.dll 08 104af7f8 6562ec58 037b7a98 00000003 40c5b354 dxva2!OPMGetVideoOutputsFromIDirect3DDevice9Object+0x2851 09 104af9f0 65631118 41211a80 583761c0 40a12f00 avcodec_58!ff_dxva2_common_end_frame+0x498 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\dxva2.c @ 1025] 0a 104afa1c 657a9476 41211a80 222244c0 41211a80 avcodec_58!dxva2_hevc_end_frame+0x58 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\dxva2_hevc.c @ 413] 0b 104afa34 655dfa48 00000000 222244c0 104afabc avcodec_58!hevc_decode_frame+0xa6 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\hevcdec.c @ 3333] 0c 104afac8 655df5ab 41211a80 222244c0 104afae8 avcodec_58!decode_simple_internal+0x1e8 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\decode.c @ 327] 0d (Inline) -------- -------- -------- -------- avcodec_58!decode_simple_receive_frame+0x37 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\decode.c @ 526] 0e 104afaf8 655ded61 2ed00a80 222244c0 48e9e090 avcodec_58!decode_receive_frame_internal+0xbb [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\decode.c @ 546] WARNING: Unable to verify checksum for stream_addin.dll 0f (Inline) -------- -------- -------- -------- avcodec_58!avcodec_send_packet+0xb8 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\decode.c @ 608] 10 104afb18 6c3345f9 41211a80 40d1e2c0 104afba4 avcodec_58!compat_decode+0x151 [c:\src\vcpkg\buildtrees\ffmpeg\src\n4.4-5002d86a54.clean\libavcodec\decode.c @ 791] 11 104afbc4 6c343bb8 104afc63 104afbe0 4c0248e8 stream_addin!FDecoder::Decode+0x2d9 [e:\xlplayer\xlwebcontrol\streamaddin\streamaddin\fdecoder.cpp @ 273] 12 104afbe0 6c34a89e 104afc63 00000000 00000001 stream_addin!CChannal::onNextFrame+0x148 [e:\xlplayer\xlwebcontrol\streamaddin\streamaddin\channal.cpp @ 442] 13 104afc64 6c347fc4 104afc7c 6c348cb4 6c34a690 stream_addin!FrameCache::HandleSmooth+0x20e [e:\xlplayer\xlwebcontrol\streamaddin\streamaddin\framecache.cpp @ 126] 14 104afc6c 6c348cb4 6c34a690 41846e00 104afc8c stream_addin!std::_Invoker_pmf_pointer::_Call<void (thiscall FrameCache::)(void),FrameCache >+0x14 [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\type_traits @ 16707566] 15 104afc7c 6c348034 41846e04 41846e00 104afcb4 stream_addin!std::invoke<void (thiscall FrameCache::)(void),FrameCache >+0x24 [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\type_traits @ 16707566] 16 104afc8c 6c34ba0f 41846e00 00000010 a2e8b49a stream_addin!std::_LaunchPad<std::unique_ptr<std::tuple<void (thiscall FrameCache::)(void),FrameCache >,std::default_delete<std::tuple<void (thiscall FrameCache::)(void),FrameCache > > > >::_Execute<0,1>+0x34 [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\thr\xthread @ 238] 17 104afcb4 6c34b6a0 0014f330 0014f330 104afccc stream_addin!std::_LaunchPad<std::unique_ptr<std::tuple<void (thiscall FrameCache::)(void),FrameCache >,std::default_delete<std::tuple<void (thiscall FrameCache::)(void),FrameCache > > > >::_Run+0x5f [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\thr\xthread @ 245] 18 104afcc4 6c33e79f 104afd08 6c1fda5f 0014f330 stream_addin!std::_LaunchPad<std::unique_ptr<std::tuple<void (thiscall FrameCache::)(void),FrameCache >,std::default_delete<std::tuple<void (__thiscall FrameCache::)(void),FrameCache > > > >::_Go+0x10 [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\thr\xthread @ 230] 19 104afccc 6c1fda5f 0014f330 a2e8b05d 00000000 stream_addin!std::_Pad::_Call_func+0xf [c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\include\thr\xthread @ 209] 1a 104afd08 74c0343d 48e9e090 104afd54 777f9802 ucrtbase!oCIpow+0x4f 1b 104afd14 777f9802 48e9e090 65de1c1f 00000000 kernel32!BaseThreadInitThunk+0x12 1c 104afd54 777f97d5 6c1fda20 48e9e090 00000000 ntdll_777c0000!RtlInitializeExceptionChain+0x63 1d 104afd6c 00000000 6c1fda20 48e9e090 00000000 ntdll_777c0000!RtlInitializeExceptionChain+0x36

微信图片_20210608205043 微信图片_20210608205051

aliakseis commented 3 years ago

It does not seem to be heavily connected to my stuff. However on the first glance it looks strange that Direct3DCreate9 is called during decoding. The initialization should be done beforehand.

ArtistZhou commented 2 years ago

It does not seem to be heavily connected to my stuff. However on the first glance it looks strange that Direct3DCreate9 is called during decoding. The initialization should be done beforehand.

I got the same error,the graphic card is Nvida GT720 ,when switch play and destroy the video the error is absolutely reproducible。 I also tryed intel hd4600 the same error too.upgrade the driver is not help,So Can you have some attentiob to this question

Screenshot-9fe375e6-3004-4428-812a-55e49725884d

ChuLiqiang commented 2 years ago

It does not seem to be heavily connected to my stuff. However on the first glance it looks strange that Direct3DCreate9 is called during decoding. The initialization should be done beforehand.

I got the same error,the graphic card is Nvida GT720 ,when switch play and destroy the video the error is absolutely reproducible。 I also tryed intel hd4600 the same error too.upgrade the driver is not help,So Can you have some attentiob to this question

Screenshot-9fe375e6-3004-4428-812a-55e49725884d

it happed in nvd card

ArtistZhou commented 2 years ago

Yes, Nvida GT720 ,Nvida gtx1650 ,gtx 750 have this problem all I found this For NVIDIA, we wait to avoid those GPUs with Feature Set E for HEVC decoding, since that's hybrid. It appears that Kepler GPUs also had some hybrid decode support (per DXVA2 Checker) so we'll blacklist those too. https://en.wikipedia.org/wiki/Nvidia_PureVideo https://bluesky23.yukishigure.com/en/dxvac/deviceInfo/decoder.html http://envytools.readthedocs.io/en/latest/hw/pciid.html (missing GM200)

in moonlight-stream/moonlight-qt](https://github.com/moonlight-stream/moonlight-qt)/ app/streaming/video/ffmpeg-renderers/dxutil.h