QtAV icon indicating copy to clipboard operation
QtAV copied to clipboard

切换DXVA硬解码,视频播放黑屏

Open magicdmer opened this issue 7 years ago • 6 comments

版本 主干master版本,win7 x64

问题 用QtAV工程自带的player切换DXVA硬解码,播放器没有提示错误,但是在播放的时候一直黑屏

错误日志(截取关键部分) Debug: "**********trying video decoder: DXVA..." Debug: "set QtAV::VideoDecoderD3D() meta properties:" Debug: "threads=>1" Debug: "surfaces=>0" Debug: "copyMode=>0" Debug: "creating d3d9 device ex... dll: 0x659d0000" Debug: "IDirect3DDevice9Ex created" Debug: "DXVA2 description: DXVA2 (ATI Radeon HD 5500 Series, vendor 4098(ATI), device 26842, revision 0)" Debug: "OurDirect3DCreateDeviceManager9 Success!" Debug: "obtained IDirect3DDeviceManager9" Debug: - 'MPEG-2 inverse discrete cosine transform' is supported by hardware Debug: - 'H.264 variable-length decoder, no film grain technology' is supported by hardware Debug: - 'H.264 variable-length decoder, no film grain technology, Flash' is supported by hardware Debug: - 'VC-1 variable-length decoder' is supported by hardware Debug: - Unknown GUID = CA15D19A-2b48-43d6-97-9e-7a-6e-9c-80-2f-f8 Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: codec does not match to h264: mpeg2video Debug: codec does not match to h264: mpeg2video Debug: codec does not match to h264: mpeg1video Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: codec does not match to h264: none Debug: D3D found codec: H.264 variable-length decoder, film grain technology. Check runtime support for the codec. Debug: D3D found codec: H.264 variable-length decoder, no film grain technology (Intel ClearVideo). Check runtime support for the codec. Debug: D3D found codec: H.264 variable-length decoder, no film grain technology. Check runtime support for the codec. Debug: Check profile support: High Debug: NV12 is supported for output Debug: "using D3D9Ex: 1" Debug: "QtAV::VideoDecoderD3D thread type: Single, count: 1" Debug: "**************Video decoder found:0x562d358" Debug: "setCapture 0x5509f20" Debug: "stream: 0, duration=1260000 (42042 ms), time_base=0.000033" Debug: "codec: h264(H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)" Debug: "auto select clock: audio > external" Debug: "Using AudioClock" Debug: "Clock initial value: 0.000000" Debug: "Starting audio thread..." Debug: "Starting video thread..." Debug: "get av queue a/v thread = 0x562d010 0x562d3c8" Debug: "buffersrc_args=time_base=1/1000000:sample_rate=48000:sample_fmt=fltp:channel_layout=0x3" Debug: "available hardware decoder output format 53 (dxva2_vld)" Debug: "available hardware decoder output format 118 (d3d11va_vld)" Debug: "available hardware decoder output format 174 (d3d11)" Debug: "available software decoder output format 0 (yuv420p)" Debug: ScreenSaver::retrieveState Debug: Debug: >>>>>>>>>>>>>>>>>>>>>surfaces: 20, active_thread_type: 0, threads: 1, refs: 3 Succeed to enable screen saver (0) Debug: "IDirectXVideoDecoderService=0x4aa4834 nb_surfaces=20 surface 3840x2160" Debug: track found!!!!! Debug: "IDirectXVideoAccelerationService_CreateSurface succeed with 20 surfaces (3840x2160)" Debug: Decoder configurations: 2 Debug: configuration[0] ConfigBitstreamRaw 2 Debug: configuration[1] ConfigBitstreamRaw 2 Warning: [FFmpeg:?] No such filter: '' Warning: [FFmpeg:?] Error avfilter_graph_parse_ptr(filter_graph, options.toUtf8().constData(), &inputs, &outputs, 0) @160 filter\LibAVFilter.cpp: (0xffffffea) Invalid argument Warning: "setup audio filter graph error" Debug: "swr speed=1.00" Debug: "out: {cl: 3, fmt: flt, freq: 48000}" Debug: "in {cl: 3, fmt: fltp, freq: 48000}" Warning: "DXVA2 error@417. vs->CreateVideoDecoder(codec_guid, &dsc, &cfg, surface_list, nb_surfaces, &decoder): (0xffffffff8007000e) 存储空间不足,无法完成此操作。" Warning: "acceleration setup failure" Warning: "hardware acceleration is not available"

这里加黑的地方出现了错误,但是外面AVPlayer没有捕获这个错误的处理,能否在这里加入错误捕获,这样播放器可以和检测到硬解码不支持的情况下一样处理,切换回ffmpeg软解码进行播放

magicdmer avatar Aug 15 '18 07:08 magicdmer

同问! DXVA解码的判断确实有问题,这样会导致无法使用ffmpeg软解码进行播放。不知道有没人解决了?

qinko avatar Aug 23 '18 03:08 qinko

dxva失败会退回软解,https://github.com/wang-bin/QtAV/blob/master/src/codec/video/VideoDecoderFFmpegHW.cpp#L201

后面有什么log?

wang-bin avatar Aug 23 '18 06:08 wang-bin

下面的日志,接着就是我停止播放了 Warning: "acceleration setup failure" Warning: "hardware acceleration is not available" Warning: "no frame could be decompressed: Error number 16284 occurred 0/16284" Warning: "invalid video frame from decoder. undecoded data size: 0" Debug: "(repeat 139)invalid video frame from decoder. undecoded data size: 0\nQtAV::VideoRenderer::setInSize => calculating aspect ratio from converted input data(0.000000)" Warning: "(repeat 1)QtAV::VideoRenderer::setInSize => calculating aspect ratio from converted input data(0.000000)\nInvalid plane! Valid range is [0, 0)" Debug: "(repeat 2)Invalid plane! Valid range is [0, 0)\nall closed and reseted" Debug: "avformat_open_input: d->format_ctx:'0xae5a060', url:'D:/test/HD.Club-4K-Chimei-inn-20mbps.mp4'..." Debug: "avformat_open_input: url:'D:/test/HD.Club-4K-Chimei-inn-20mbps.mp4' ret:0" Debug: "avfmtctx.flags: 2097665, iformat.flags" Debug: "QtAV::VideoDecoderFFmpeg thread type: Frame, count: 9" Debug: "set QtAV::VideoDecoderFFmpeg() meta properties:" Warning: "invalid video frame from decoder. undecoded data size: 0" Debug: "AVCodecContext.h264 options:" Debug: "skip_loop_filter=>0" Debug: "skip_frame=>0" Debug: "set QtAV::VideoDecoderFFmpeg() meta properties:" Debug: "VideoFrameExtractor abort seek before decoding key frames" Debug: "AVCodecContext.h264 options:" Debug: "skip_loop_filter=>0" Debug: "skip_frame=>0" Debug: "set QtAV::VideoDecoderFFmpeg() meta properties:" Warning: "no frame could be decompressed: Error number 1251543 occurred 0/1251543" Warning: "Invalid plane! Valid range is [0, 0)" Warning: "(repeat 2)Invalid plane! Valid range is [0, 0)\nno frame could be decompressed: Error number 1251543 occurred 0/1251543" Debug: "VideoFrameExtractor abort seek after key frame before read" Warning: "Invalid plane! Valid range is [0, 0)" Warning: "(repeat 2)Invalid plane! Valid range is [0, 0)\ninvalid video frame from decoder. undecoded data size: 0" Debug: "AVCodecContext.h264 options:" Debug: "(repeat 4)invalid video frame from decoder. undecoded data size: 0\nskip_loop_filter=>0" Debug: "skip_frame=>0" Debug: "set QtAV::VideoDecoderFFmpeg() meta properties:" Debug: "VideoFrameExtractor abort seek before decoding key frames" Debug: "ExtractThread exiting..." Warning: "Can not copy codec properties when it's open" Debug: "closing d->format_ctx" Warning: "invalid video frame from decoder. undecoded data size: 0" Debug: "(repeat 134)invalid video frame from decoder. undecoded data size: 0\ntimer: 4, current thread: 0x43a5e8, player thread: 0x43a5e8"

magicdmer avatar Aug 23 '18 09:08 magicdmer

您好! 这个是我机器播放视频时完整日志,希望对解决这个问题有帮助! : Debug: QtAV 1.12.0(Aug 14 2018, 16:58:42) Multimedia framework base on Qt and FFmpeg. Distributed under the terms of LGPLv2.1 or later. Shanghai University->S3 Graphics->Deepin->PPTV, Shanghai, China Copyright (C) 2012-2018 Wang Bin (aka. Lucas Wang) [email protected] Donate: http://qtav.org/donate.html Source: https://github.com/wang-bin/QtAV Home page: http://qtav.org (file:QtAV_Global.cpp, line:131, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with Qt-5.11.1" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "FFmpeg/Libav configuration: --extra-version=QtAV --disable-doc --disable-debug --enable-shared --disable-static --enable-runtime-cpudetect --disable-iconv --enable-hwaccels --enable-libmfx --enable-avresample --disable-postproc --enable-pic --extra-ldflags='-static-libgcc -Wl,-Bstatic'" (file:QtAV_Global.cpp, line:135, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avutil-55.58.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avcodec-57.89.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avformat-57.71.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avfilter-6.82.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avdevice-57.6.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with avresample-3.5.0" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with swresample-2.7.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: "Build with swscale-4.6.100" (file:QtAV_Global.cpp, line:136, func: void __cdecl QtAV::Internal::print_library_info(void)) : Debug: Registered audio backends: ("XAudio2", "DirectSound", "null") (file:output\audio\AudioOutput.cpp, line:259, func: __thiscall QtAV::AudioOutput::AudioOutput(class QObject *)) : Debug: "XAudio2_9" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Warning: "Cannot load library XAudio2_9: 找不到指定的模块。" (file:output\audio\AudioOutputXAudio2.cpp, line:123, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "XAudio2_8" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Warning: "Cannot load library XAudio2_8: 找不到指定的模块。" (file:output\audio\AudioOutputXAudio2.cpp, line:123, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "XAudio2_7" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "Build with XAudio2 from Win8 or later SDK" (file:output\audio\AudioOutputXAudio2.cpp, line:130, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "Try inline function 'XAudio2Create' from DXSDK" (file:output\audio\AudioOutputXAudio2.cpp, line:151, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "xaudio2: 0x2730650" (file:output\audio\AudioOutputXAudio2.cpp, line:160, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "next id: 1613206256, name: OpenGLWindow" (file:output\video\VideoOutput.cpp, line:60, func: __thiscall QtAV::VideoOutputPrivate::VideoOutputPrivate(int,bool)) : Debug: "next id: 1613206253, name: OpenGLWidget" (file:output\video\VideoOutput.cpp, line:60, func: __thiscall QtAV::VideoOutputPrivate::VideoOutputPrivate(int,bool)) : Debug: "VideoFilterContext 0x32cb28 delete paint device in 0x30abbc" (file:filter\FilterContext.cpp, line:84, func: __thiscall QtAV::VideoFilterContext::-VideoFilterContext(void)) : Warning: "No gl context" (file:opengl\VideoShader.cpp, line:953, func: __thiscall QtAV::VideoMaterialPrivate::-VideoMaterialPrivate(void)) : Debug: Registered audio backends: ("XAudio2", "DirectSound", "null") (file:output\audio\AudioOutput.cpp, line:259, func: __thiscall QtAV::AudioOutput::AudioOutput(class QObject *)) : Debug: "XAudio2_9" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Warning: "Cannot load library XAudio2_9: 找不到指定的模块。" (file:output\audio\AudioOutputXAudio2.cpp, line:123, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "XAudio2_8" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Warning: "Cannot load library XAudio2_8: 找不到指定的模块。" (file:output\audio\AudioOutputXAudio2.cpp, line:123, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "XAudio2_7.dll" (file:output\audio\AudioOutputXAudio2.cpp, line:121, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "Build with XAudio2 from Win8 or later SDK" (file:output\audio\AudioOutputXAudio2.cpp, line:130, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "Try inline function 'XAudio2Create' from DXSDK" (file:output\audio\AudioOutputXAudio2.cpp, line:151, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: "xaudio2: 0x27344f8" (file:output\audio\AudioOutputXAudio2.cpp, line:160, func: __thiscall QtAV::AudioOutputXAudio2::AudioOutputXAudio2(class QObject *)) : Debug: Progman HWND100e6 (file:, line:0, func: ) : Debug: workerw HWND102ce (file:, line:0, func: ) : Debug: "OpenGL version: 4.5 hasGLSL: 1" (file:opengl\OpenGLVideo.cpp, line:229, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "GL_VERSION: 4.5.13417 Compatibility Profile Context 15.301.1901.0" (file:opengl\OpenGLVideo.cpp, line:233, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "GL_VENDOR: ATI Technologies Inc." (file:opengl\OpenGLVideo.cpp, line:234, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "GL_RENDERER: AMD Radeon HD 7400M Series" (file:opengl\OpenGLVideo.cpp, line:235, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "GL_SHADING_LANGUAGE_VERSION: 4.40" (file:opengl\OpenGLVideo.cpp, line:236, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "Is OpenGLES: 0" (file:opengl\OpenGLVideo.cpp, line:239, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "Is EGL: 0" (file:opengl\OpenGLVideo.cpp, line:241, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "GLSL version: 440" (file:opengl\OpenGLVideo.cpp, line:243, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "Has PBO: 1" (file:opengl\OpenGLVideo.cpp, line:245, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "16 bit texture depth: 16.\n" (file:opengl\OpenGLHelper.cpp, line:396, func: bool __cdecl QtAV::OpenGLHelper::test_gl_param(const QtAV::OpenGLHelper::gl_param_t &,bool *)) : Debug: "using gl_param_3r16" (file:opengl\OpenGLHelper.cpp, line:450, func: const QtAV::OpenGLHelper::gl_param_t *__cdecl QtAV::OpenGLHelper::get_gl_param(void)) : Debug: "Has 16bit texture: 1" (file:opengl\OpenGLVideo.cpp, line:247, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: "check gl3 rg: 0x822B" (file:opengl\OpenGLHelper.cpp, line:408, func: bool __cdecl QtAV::OpenGLHelper::hasRG(void)) : Debug: "Has RG texture: 1" (file:opengl\OpenGLVideo.cpp, line:249, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: QSurfaceFormat(version 4.5, options QFlagsQSurfaceFormat::FormatOption(DeprecatedFunctions), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, colorSpace QSurfaceFormat::ColorSpace(sRGBColorSpace), profile QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) (file:opengl\OpenGLVideo.cpp, line:250, func: void __thiscall QtAV::OpenGLVideo::setOpenGLContext(class QOpenGLContext *)) : Debug: recieved message 1124 (file:, line:0, func: ) : Debug: Loading QVariant(QString, "2.mp4") ... (file:AVPlayer.cpp, line:655, func: void __thiscall QtAV::AVPlayer::loadInternal(void)) : Debug: "all closed and reseted" (file:AVDemuxer.cpp, line:750, func: bool __thiscall QtAV::AVDemuxer::load(void)) : Debug: "avformat_open_input: d->format_ctx:'0x11cb200', url:'2.mp4'..." (file:AVDemuxer.cpp, line:806, func: bool __thiscall QtAV::AVDemuxer::load(void)) : Debug: "avformat_open_input: url:'2.mp4' ret:0" (file:AVDemuxer.cpp, line:808, func: bool __thiscall QtAV::AVDemuxer::load(void)) : Debug: "avfmtctx.flags: 2097665, iformat.flags" (file:AVDemuxer.cpp, line:853, func: bool __thiscall QtAV::AVDemuxer::load(void)) : Warning: "invalid index 0 (valid is 0-0) for stream type 2." (file:AVDemuxer.cpp, line:926, func: bool __thiscall QtAV::AVDemuxer::setStreamIndex(enum QtAV::AVDemuxer::StreamType,int)) : Debug: "notify_interval: 41" (file:AVPlayerPrivate.cpp, line:186, func: void __thiscall QtAV::AVPlayer::Private::updateNotifyInterval(void)) : Debug: "stream: 0, duration=441344 (10007 ms), time_base=0.000023" (file:AVPlayerPrivate.cpp, line:262, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "codec: aac(AAC (Advanced Audio Coding))" (file:AVPlayerPrivate.cpp, line:268, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "stream: 1, duration=899999 (9999 ms), time_base=0.000011" (file:AVPlayerPrivate.cpp, line:262, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "codec: h264(H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)" (file:AVPlayerPrivate.cpp, line:268, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "has audio" (file:AVPlayerPrivate.cpp, line:362, func: bool __thiscall QtAV::AVPlayer::Private::setupAudioThread(class QtAV::AVPlayer *)) : Debug: "QtAV::AudioDecoderFFmpeg thread type: Single, count: 1" (file:codec\AVDecoder.cpp, line:121, func: bool __thiscall QtAV::AVDecoder::open(void)) : Debug: "source_voice: 0x0, master: 0x0" (file:output\audio\AudioOutputXAudio2.cpp, line:219, func: bool __thiscall QtAV::AudioOutputXAudio2::close(void)) : Debug: AudioOutput format: QtAV::AudioFormat(44100Hz, 4Bytes, channelCount:2, channelLayout: "stereo", sampleFormat: "flt") ; requested: QtAV::AudioFormat(44100Hz, 4Bytes, channelCount:2, channelLayout: "stereo", sampleFormat: "fltp") (file:AVPlayerPrivate.cpp, line:399, func: bool __thiscall QtAV::AVPlayer::Private::setupAudioThread(class QtAV::AVPlayer *)) : Debug: "source_voice:0x273e198" (file:output\audio\AudioOutputXAudio2.cpp, line:210, func: bool __thiscall QtAV::AudioOutputXAudio2::open(void)) : Warning: "src audio parameters 'channel layout(or channels), sample rate and sample format must be set before initialize resampler" (file:AudioResamplerTemplate.cpp, line:124, func: bool __thiscall QtAV::AudioResamplerFF::prepare(void)) : Debug: "new audio thread" (file:AVPlayerPrivate.cpp, line:415, func: bool __thiscall QtAV::AVPlayer::Private::setupAudioThread(class QtAV::AVPlayer *)) : Debug: "demux thread setAudioThread" (file:AVPlayerPrivate.cpp, line:420, func: bool __thiscall QtAV::AVPlayer::Private::setupAudioThread(class QtAV::AVPlayer *)) : Debug: "output not changed: 0x31ec58" (file:AVPlayerPrivate.h, line:65, func: void __thiscall QtAV::AVPlayer::Private::setAVOutput<class QtAV::AudioOutput>(class QtAV::AudioOutput *&,class QtAV::AudioOutput *,class QtAV::AVThread *)) : Debug: "set AVThread output" (file:AVPlayerPrivate.h, line:88, func: void __thiscall QtAV::AVPlayer::Private::setAVOutput<class QtAV::AudioOutput>(class QtAV::AudioOutput *&,class QtAV::AudioOutput *,class QtAV::AVThread *)) : Debug: "stream: 0, duration=441344 (10007 ms), time_base=0.000023" (file:AVPlayerPrivate.cpp, line:262, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "codec: aac(AAC (Advanced Audio Coding))" (file:AVPlayerPrivate.cpp, line:268, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "**********trying video decoder: CUDA..." (file:AVPlayerPrivate.cpp, line:569, func: bool __thiscall QtAV::AVPlayer::Private::setupVideoThread(class QtAV::AVPlayer *)) : Warning: "can not load cuda!" (file:cuda\cuda_api.cpp, line:90, func: __thiscall cuda_api::context::context(void)) : Debug: "**********trying video decoder: D3D11..." (file:AVPlayerPrivate.cpp, line:569, func: bool __thiscall QtAV::AVPlayer::Private::setupVideoThread(class QtAV::AVPlayer *)) : Warning: "D3D11VA error@241. d3ddev.As(&mt): (0xffffffff80004002) 不支持此接口" (file:codec\video\VideoDecoderD3D11.cpp, line:241, func: bool __thiscall QtAV::VideoDecoderD3D11Private::createDevice(void)) : Debug: "**********trying video decoder: DXVA..." (file:AVPlayerPrivate.cpp, line:569, func: bool __thiscall QtAV::AVPlayer::Private::setupVideoThread(class QtAV::AVPlayer *)) : Debug: "creating d3d9 device ex... dll: 0x66210000" (file:utils\DirectXHelper.cpp, line:72, func: struct IDirect3DDevice9 *cdecl QtAV::DXHelper::CreateDevice9Ex(struct HINSTANCE *,struct IDirect3D9Ex **,struct _D3DADAPTER_IDENTIFIER9 *)) : Debug: "IDirect3DDevice9Ex created" (file:utils\DirectXHelper.cpp, line:101, func: struct IDirect3DDevice9 *cdecl QtAV::DXHelper::CreateDevice9Ex(struct HINSTANCE *,struct IDirect3D9Ex **,struct _D3DADAPTER_IDENTIFIER9 *)) : Debug: "DXVA2 description: DXVA2 (AMD Radeon HD 7400M Series, vendor 4098(ATI), device 26464, revision 0)" (file:codec\video\VideoDecoderDXVA.cpp, line:278, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDevice(void)) : Debug: "OurDirect3DCreateDeviceManager9 Success!" (file:codec\video\VideoDecoderDXVA.cpp, line:288, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDevice(void)) : Debug: "obtained IDirect3DDeviceManager9" (file:codec\video\VideoDecoderDXVA.cpp, line:290, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDevice(void)) : Debug: - 'MPEG-2 variable-length decoder' is supported by hardware (file:, line:0, func: ) : Debug: - 'MPEG-2 inverse discrete cosine transform' is supported by hardware (file:, line:0, func: ) : Debug: - 'H.264 variable-length decoder, no film grain technology' is supported by hardware (file:, line:0, func: ) : Debug: - 'H.264 variable-length decoder, no film grain technology, Flash' is supported by hardware (file:, line:0, func: ) : Debug: - Unknown GUID = 6719B6FB-5cad-4acb-b0-0a-f3-bf-de-c3-87-27 (file:, line:0, func: ) : Debug: - Unknown GUID = 9901CCD3-ca12-4b7e-86-7a-e2-22-3d-92-55-c3 (file:, line:0, func: ) : Debug: - 'VC-1 variable-length decoder' is supported by hardware (file:, line:0, func: ) : Debug: - Unknown GUID = CA15D19A-2b48-43d6-97-9e-7a-6e-9c-80-2f-f8 (file:, line:0, func: ) : Debug: - 'MPEG-4 Part 2 variable-length decoder, Simple&Advanced Profile, Avivo' is supported by hardware (file:, line:0, func: ) : Debug: - 'H.264 stereo high profile, mbs flag set' is supported by hardware (file:, line:0, func: ) : Debug: - 'H.264 stereo high profile' is supported by hardware (file:, line:0, func: ) : Debug: - 'MPEG-4 Part 2 variable-length decoder, Simple&Advanced Profile, no GMC' is supported by hardware (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: mpeg2video (file:, line:0, func: ) : Debug: codec does not match to h264: mpeg2video (file:, line:0, func: ) : Debug: codec does not match to h264: mpeg1video (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: codec does not match to h264: none (file:, line:0, func: ) : Debug: D3D found codec: H.264 variable-length decoder, film grain technology. Check runtime support for the codec. (file:, line:0, func: ) : Debug: D3D found codec: H.264 variable-length decoder, no film grain technology (Intel ClearVideo). Check runtime support for the codec. (file:, line:0, func: ) : Debug: D3D found codec: H.264 variable-length decoder, no film grain technology. Check runtime support for the codec. (file:, line:0, func: ) : Debug: Check profile support: High (file:, line:0, func: ) : Debug: NV12 is supported for output (file:, line:0, func: ) : Debug: "QtAV::VideoDecoderD3D thread type: Single, count: 1" (file:codec\AVDecoder.cpp, line:121, func: bool __thiscall QtAV::AVDecoder::open(void)) : Debug: "**************Video decoder found:0x315990" (file:AVPlayerPrivate.cpp, line:579, func: bool __thiscall QtAV::AVPlayer::Private::setupVideoThread(class QtAV::AVPlayer *)) : Debug: "setCapture 0x31b628" (file:VideoThread.cpp, line:77, func: class QtAV::VideoCapture *__thiscall QtAV::VideoThread::setVideoCapture(class QtAV::VideoCapture *)) : Debug: "stream: 1, duration=899999 (9999 ms), time_base=0.000011" (file:AVPlayerPrivate.cpp, line:262, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "codec: h264(H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)" (file:AVPlayerPrivate.cpp, line:268, func: void __thiscall QtAV::AVPlayer::Private::initCommonStatistics(int,class QtAV::Statistics::Common *,struct AVCodecContext *)) : Debug: "auto select clock: audio > external" (file:AVPlayer.cpp, line:1217, func: void __thiscall QtAV::AVPlayer::playInternal(void)) : Debug: "Using AudioClock" (file:AVPlayer.cpp, line:1222, func: void __thiscall QtAV::AVPlayer::playInternal(void)) : Debug: "Clock initial value: 0.000000" (file:AVClock.cpp, line:84, func: void __thiscall QtAV::AVClock::setInitialValue(double)) : Debug: "Starting audio thread..." (file:AVPlayer.cpp, line:1229, func: void __thiscall QtAV::AVPlayer::playInternal(void)) : Debug: "Starting video thread..." (file:AVPlayer.cpp, line:1233, func: void __thiscall QtAV::AVPlayer::playInternal(void)) : Debug: "get av queue a/v thread = 0x6644c20 0x66fd168" (file:AVDemuxThread.cpp, line:533, func: void __thiscall QtAV::AVDemuxThread::run(void)) : Debug: "swr speed=1.00" (file:AudioResamplerTemplate.cpp, line:165, func: bool __thiscall QtAV::AudioResamplerFF::prepare(void)) : Debug: "available hardware decoder output format 61 (dxva2_vld)" (file:codec\video\VideoDecoderFFmpegHW.cpp, line:168, func: enum AVPixelFormat __thiscall QtAV::VideoDecoderFFmpegHWPrivate::getFormat(struct AVCodecContext *,const enum AVPixelFormat *)) : Debug: "out: {cl: 3, fmt: flt, freq: 44100}" (file:AudioResamplerTemplate.cpp, line:188, func: bool __thiscall QtAV::AudioResamplerFF::prepare(void)) : Debug: "available hardware decoder output format 128 (d3d11va_vld)" (file:codec\video\VideoDecoderFFmpegHW.cpp, line:168, func: enum AVPixelFormat __thiscall QtAV::VideoDecoderFFmpegHWPrivate::getFormat(struct AVCodecContext *,const enum AVPixelFormat *)) : Debug: "in {cl: 3, fmt: fltp, freq: 44100}" (file:AudioResamplerTemplate.cpp, line:192, func: bool __thiscall QtAV::AudioResamplerFF::prepare(void)) : Debug: "available software decoder output format 0 (yuv420p)" (file:codec\video\VideoDecoderFFmpegHW.cpp, line:168, func: enum AVPixelFormat __thiscall QtAV::VideoDecoderFFmpegHWPrivate::getFormat(struct AVCodecContext *,const enum AVPixelFormat *)) : Debug: >>>>>>>>>>>>>>>>>>>>>surfaces: 20, active_thread_type: 0, threads: 1, refs: 4 (file:, line:0, func: ) : Debug: "IDirectXVideoDecoderService=0x123242c nb_surfaces=20 surface 544x960" (file:codec\video\VideoDecoderDXVA.cpp, line:362, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDecoder(enum AVCodecID,int,int,class QVector<struct QtAV::va_surface_t *> &)) : Debug: "Not playing-" (file:AVPlayer.cpp, line:1458, func: void __thiscall QtAV::AVPlayer::stop(void)) : Debug: "IDirectXVideoAccelerationService_CreateSurface succeed with 20 surfaces (544x960)" (file:codec\video\VideoDecoderDXVA.cpp, line:379, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDecoder(enum AVCodecID,int,int,class QVector<struct QtAV::va_surface_t *> &)) : Debug: Decoder configurations: 3 (file:, line:0, func: ) ConfigBitstreamRaw 2 (file:, line:0, func: ) ConfigBitstreamRaw 2 (file:, line:0, func: ) ConfigBitstreamRaw 2 (file:, line:0, func: ) : Debug: "IDirectXVideoDecoderService.CreateVideoDecoder succeed. decoder=0x1200844" (file:codec\video\VideoDecoderDXVA.cpp, line:418, func: bool __thiscall QtAV::VideoDecoderDXVAPrivate::createDecoder(enum AVCodecID,int,int,class QVector<struct QtAV::va_surface_t *> &)) : Debug: "Using DXVA2 (AMD Radeon HD 7400M Series, vendor 4098(ATI), device 26464, revision 0) for hardware decoding." (file:codec\video\VideoDecoderFFmpegHW.cpp, line:191, func: enum AVPixelFormat __thiscall QtAV::VideoDecoderFFmpegHWPrivate::getFormat(struct AVCodecContext *,const enum AVPixelFormat *)) : Warning: "no frame could be decompressed: Error number 12908 occurred 0/12908" (file:codec\video\VideoDecoderFFmpegBase.cpp, line:139, func: bool __thiscall QtAV::VideoDecoderFFmpegBase::decode(const class QtAV::Packet &)) : Warning: "invalid video frame from decoder. undecoded data size: 0" (file:VideoThread.cpp, line:517, func: void __thiscall QtAV::VideoThread::run(void)) : Warning: "no frame could be decompressed: Error number 926 occurred 0/926" (file:codec\video\VideoDecoderFFmpegBase.cpp, line:139, func: bool __thiscall QtAV::VideoDecoderFFmpegBase::decode(const class QtAV::Packet &)) : Warning: "invalid video frame from decoder. undecoded data size: 0" (file:VideoThread.cpp, line:517, func: void __thiscall QtAV::VideoThread::run(void)) : Debug: "AVClock started!!!!!!!!" (file:AVClock.cpp, line:164, func: void __thiscall QtAV::AVClock::start(void)) : Debug: "QtAV::VideoRenderer::setInSize => calculating aspect ratio from converted input data(0.562500)" (file:output\video\VideoRenderer.cpp, line:237, func: void __thiscall QtAV::VideoRenderer::setInSize(int,int)) : Debug: QtAV::VideoFormat(pixelFormat: 23 "nv12" alpha: false, channels: 3, planes: 2, bpc: 8, bpp: 12/12 -8-16) (file:opengl\VideoShader.cpp, line:545, func: void __thiscall QtAV::VideoMaterial::setCurrentFrame(const class QtAV::VideoFrame &)) : Debug: "(repeat 1)QtAV::VideoRenderer::setInSize => calculating aspect ratio from converted input data(0.562500)\npixel format changed: => nv12 23" (file:opengl\VideoShader.cpp, line:546, func: void __thiscall QtAV::VideoMaterial::setCurrentFrame(const class QtAV::VideoFrame &)) : Debug: material changed: "gl material 16to8bit: 0, planar: 0, has alpha: 0, 2d texture: 0, 2nd plane rg: 0, xyz: 0" => "gl material 16to8bit: 0, planar: 1, has alpha: 0, 2d texture: 1, 2nd plane rg: 1, xyz: 0" (file:opengl\OpenGLVideo.cpp, line:351, func: void __thiscall QtAV::OpenGLVideo::render(const class QRectF &,const class QRectF &,const class QMatrix4x4 &)) : Debug: "plane linesize 0: padded = 768, effective = 540. theoretical plane size: 540x960" (file:opengl\VideoShader.cpp, line:1066, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureResources(void)) : Debug: "plane linesize 1: padded = 768, effective = 540. theoretical plane size: 270x480" (file:opengl\VideoShader.cpp, line:1066, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureResources(void)) : Debug: "effective_tex_width_ratio=0.703125" (file:opengl\VideoShader.cpp, line:1083, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureResources(void)) : Debug: texture internal format: QVector(33321, 33323) (file:opengl\VideoShader.cpp, line:989, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: texture data format: QVector(6403, 33319) (file:opengl\VideoShader.cpp, line:990, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: texture data type: QVector(5121, 5121) (file:opengl\VideoShader.cpp, line:991, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: "///////////bpp 2, bpc: 8" (file:opengl\VideoShader.cpp, line:992, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: "texture width: 768 - 540 = pad: 228. bpp(gl): 1" (file:opengl\VideoShader.cpp, line:1000, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: "texture width: 384 - 270 = pad: 114. bpp(gl): 2" (file:opengl\VideoShader.cpp, line:1000, func: bool __thiscall QtAV::VideoMaterialPrivate::updateTextureParameters(const class QtAV::VideoFormat &)) : Debug: "creating texture for plane 0" (file:opengl\VideoShader.cpp, line:1123, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureTextures(void)) : Debug: "texture for plane 0 is created (id=3)" (file:opengl\VideoShader.cpp, line:1133, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureTextures(void)) : Debug: "creating texture for plane 1" (file:opengl\VideoShader.cpp, line:1123, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureTextures(void)) : Debug: "texture for plane 1 is created (id=4)" (file:opengl\VideoShader.cpp, line:1133, func: bool __thiscall QtAV::VideoMaterialPrivate::ensureTextures(void)) cache a new shader material type(26): gl material 16to8bit: 0, planar: 1, has alpha: 0, 2d texture: 1, 2nd plane rg: 1, xyz: 0" (file:, line:0, func: ) : Debug: "bind attribute: a_Position => 0" (file:opengl\VideoShader.cpp, line:457, func: bool __thiscall QtAV::VideoShader::build(class QOpenGLShaderProgram *)) : Debug: "bind attribute: a_TexCoords0 => 1" (file:opengl\VideoShader.cpp, line:457, func: bool __thiscall QtAV::VideoShader::build(class QOpenGLShaderProgram *)) : Debug: "uniform locations:" (file:opengl\VideoShader.cpp, line:227, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_Texture0: 3" (file:opengl\VideoShader.cpp, line:231, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_Texture1: 4" (file:opengl\VideoShader.cpp, line:231, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_Texture2: 5" (file:opengl\VideoShader.cpp, line:231, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_Matrix: 0" (file:opengl\VideoShader.cpp, line:233, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_colorMatrix: 1" (file:opengl\VideoShader.cpp, line:234, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: "u_opacity: 2" (file:opengl\VideoShader.cpp, line:235, func: void __thiscall QtAV::VideoShader::initialize(class QOpenGLShaderProgram *)) : Debug: input yuv limited range (file:, line:0, func: ) : Debug: target rect: QRectF(-1,1 2x-2) (file:opengl\OpenGLVideo.cpp, line:161, func: void __thiscall QtAV::OpenGLVideoPrivate::updateGeometry(class QtAV::VideoShader *,const class QRectF &,const class QRectF &)) : Debug: creating VBO... (file:, line:0, func: ) : Debug: creating VAO... (file:, line:0, func: ) : Debug: vao updated (file:, line:0, func: ) : Debug: geometry attributes changed, rebind vao... (file:, line:0, func: ) : Debug: geometry updated (file:, line:0, func: )

qinko avatar Aug 23 '18 09:08 qinko

这里补充两个完整日志,一个是DXVA+FFmpeg,一个是CUDA+FFmpeg,我的电脑支持DXVA,但是不支持CUDA,CUDA这个逻辑工作良好,DXVA这个就切换软解码失败,黑屏 1. log-Player-DXVA+FFmpeg.txt http://paste.openstack.org/show/729017/ 2. log-Player-CUDA+FFmpeg.txt http://paste.openstack.org/show/729018/ 另外经过测试发现,视频是1k的时候,工作还比较正常,可以硬解码无需切换,2k和4k就有问题了,那个失败的函数和显存有关?分辨率大,显存不够,所以报错? 我显卡是128M显存

magicdmer avatar Aug 29 '18 01:08 magicdmer

同样存在问题,但使用qtav自带的player显示正常。加上这几行就正常播放了 a.setAttribute(Qt::AA_UseOpenGLES); qputenv("QT_OPENGL", "angle"); qputenv("QT_ANGLE_PLATFORM", "d3d9");

Hlongyu avatar Dec 22 '23 07:12 Hlongyu