VideoControl Issues
-
Since I keep running my head into the wall on this, could use some direction from the QT community.
I'm attempting to play mp4 video via QML via a video control, via a very simplistic setup:
qml:
import QtQuick 2 import QtQuick.Controls 1.2 import QtQuick.Window 2.2 import QtMultimedia 5.6 import QtWebView 1.1 Item { id: root width: 1280 height: 800 Item { MediaPlayer { id: mediaPlayer source: "assets/_0/4.mp4" onError: { if (MediaPlayer.NoError != error) { console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString) root.fatalError() } } } VideoOutput { id: videoOutput anchors.fill: parent source: mediaPlayer } MouseArea { anchors.fill: parent onPressed: mediaPlayer.play() } } }
I've (un)installed the Windows Media Codec Pack, the K-Lite Codec Pack, and the Hallali (spelling?) codec. I've tested using both 32bit and 64bit QT5.6, 5.7, and 5.8, all from binary releases. , I've also tried all available types of hardware and software rendering for each of the installed codecs.
All attempts to play mp4 files using all of these end in the same result:
shell\osshell\lmui\ntshrui\dll\shrengine.cpp(1487)\ntshrui.dll!00007FFDECDD8800: (caller: 00007FFDECDFC6FF) ReturnHr(1) tid(ed0) 80004005 Unspecified error
I've also tried rerunning it against all the installed codecs, 32bit and 64bit, while embedding the movie into an HTML5 document and playing out via WebView :
qml:
import QtQuick 2 import QtQuick.Controls 1.2 import QtQuick.Window 2.2 import QtMultimedia 5.6 import QtWebView 1.1 Item { id: root width: 1280 height: 800 WebView { id: flashView anchors.fill : parent url : Qt.resolvedUrl("movie_base.html") } }
html:
<!doctype "html"> <html> <body style="width:600; height:600; margin:0"> <video id="video1" width="600" height="600" autoplay> <source src="assets/_0/4.mp4" type="video/mp4"> </video> </body> </html>
Which results in the following error:
[10180:18588:0404/103041:ERROR:dxva_video_decode_accelerator_win.cc(395)] EGL_EXT_device_query missing
The test movie works under multiple separate applications, including straight from browser.
While researching this, I found that the DirectShow backend is supposed to be deprecated, but it appears to be what the binary distribution uses, and there does not appear to be a way to force it to attempt the WMF backend instead, so I can at least try testing with that.
So two questions:
-
Is there any way to force a QML/Quick app to use the WMF backend over the DirectShow one?
-
Is there any known way to actually play an mp4 via QML/Quick with QT 5.6, 5.7, or 5.8?
-
-
Hi and welcome to devnet,
Are you using the QtWebEngine module ?
-
I added QtWebEngine, and switched to the following:
qml:
import QtQuick 2.0 import QtQuick.Controls 1.2 import QtQuick.Window 2.2 import QtMultimedia 5.6 import QtWebEngine 1.0 Item { id: root width: 1280 height: 800 Item { WebEngineView { anchors.fill: parent url: Qt.resolvedUrl("movie_base.html") } } }
cpp:
#include <qguiapplication.h> #include <qquickview.h> #include <QtWebEngine\qtwebengineglobal.h> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QtWebEngine::initialize(); QQuickView view; view.setSource(QUrl::fromLocalFile("scene/playout.qml")); view.show(); return app.exec(); }
And ran through the tests again with K-Lite Codec pack and Haali Splitter.
Unfortunately, the results, regradless of codec, were still:
[9632:20732:0405/110738:ERROR:dxva_video_decode_accelerator_win.cc(395)] EGL_EXT_device_query missing
I did very much appreciate the suggestion, however. Thanks!
-
Take a look at the Audio and video codecs part of the QtWebEngine features.
This is a proprietary format, so you have to re-build the module to enable it and provide the codec with all licensing requirements that comes with it.
If you are providing the files you may want to use a free codec like webm.
-
Ideally, this app is to play user contributed video combined with additional overlay data, so I was hoping to simply be able to play the movie within a widget, without the overhead of embedding it into a web page first, then rendering via the web engine. Given how long file conversion can take, it's not an ideal path.
Having said that, I'm finding that it's not just mp4, but all video types that are having issues on output. Webm won't render natively, with what I'm interpreting as a "missing codec" (Unknown exception starting with 0x800) error, and won't render under a WebEngineView due to a "Requires MFPlat.dll to render" error.
MKV, dies horribly in the exact manner as MP4.
OGG, when attempting a VideoOutput control results in :
DirectShowPlayerService::doRender: Unresolved error code 0x80040218 (IDispatch error #24)
Trying to play OGG via a WebEngineView:
[23192:22924:0406/102506:ERROR:dxva_video_decode_accelerator_win.cc(395)] EGL_EXT_device_query missing
Given that I've seen plenty of other people posting that they've been able to play video via various Qt/Quick methods, it seems as though there's either:
- A major configuration issue on the machine I'm developing on
- A serious incompatibility between QtMultimedia and DirectX 12 under Windows 10
Ideally, I'd love to be able to test with the WMF interface as opposed to the DirectShow that the documentation claims is deprecated to help determine if it's a compatibility issue or not. Especially since multiple other players and playback mechanisms support all manner of video without issue, which would point to it being a QT issue, not an issue with my machine.
Sadly, several days of hunting around have yielded nothing useful about how to attempt that.
@SGaist - thanks for the tips, I appreciate the assistance!
-
Quick update, this appears to be a bug or issue with QML/Quick somewhere, again making me wonder if it's not DirectShow vs. WMF.
The following code:
m_player = new QMediaPlayer(this); m_video = new QVideoWidget(this); m_player->setVideoOutput(m_video); m_video->show(); const QUrl path = QUrl::fromLocalFile("4.mp4"); m_player->setMedia(path); m_player->play();
Plays MP4 and OGG movies with absolutely no problems or errors with the proper codecs installed. With the same codecs, QML/Quick still gives errors.
-
I actually switched to QtAV for video output, and so far it's been working flawlessly under standard QT App setup.
If I could ever get the QML/Quick setup to acknowledge it's been installed I'd test that end of things, but for now it's accomplishing exactly what I need.
Thanks again for the assistance!.