QtAVPlayer: Unable to play media on Qt6.3
I followed your example code but seems the media won’t start. This is what I made:
QVideoWidget w(baseWidget);
w.show();
QAVPlayer p;
QAVAudioOutput audioOutput;
connect(&p, &QAVPlayer::audioFrame, [&audioOutput](const QAVAudioFrame& frame) {
qDebug() << "AudioFrame";
audioOutput.play(frame);
});
connect(&p, &QAVPlayer::videoFrame, [&](const QAVVideoFrame& frame) {
qDebug() << "VideoFrame";
QVideoFrame videoFrame = frame.convertTo(AV_PIX_FMT_RGB32);
w.videoSink()->setVideoFrame(videoFrame);
});
p.setSource("PATH-TO-VIDEO");
p.play();
At least I expect to see debug messages, but this is the only output:
Debug vp9 : supported hardware device contexts:
Debug dxva2
Debug d3d11va
Debug cuda
Debug Creating hardware device context: d3d11va
Debug Using hardware device context: d3d11va
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (7 by maintainers)
QT_AVPLAYER_NO_HWDEVICE=1 to prevent using d3d11va does it help?