问题
Using Qt Version 5.4.2
Error code returned : DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d
A QML file has been written with the Video QML type as below. I have added the below in the project file (.pro)
Qt+= multimedia
Snippet of code as below in the QML file.
Video {
id: video
width : 800
height : 600
source : "Video.mp4"
MouseArea {
anchors.fill: parent
onClicked: {
video.play();
}
}
focus: true
Keys.onSpacePressed: video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play()
Keys.onLeftPressed: video.seek(video.position - 5000)
Keys.onRightPressed: video.seek(video.position + 5000)
}
Any pointers regarding this error would be helpful.
回答1:
I faced the same issue, fixed it by:
changing
source: "file://D:/Temp/video/ccc.wmv"
to
source: "file:///D:/Temp/video/ccc.wmv"
as the message mentioned doSetUrlSource
indicates may using the wrong URL.
回答2:
Have you searched through the bug tracker? I found QTMOBILITY-1461, for example:
The default directshow filters on Windows7 are not enough for playback of the m4a file. It is not the AAC codec problem, but no filter to identify the m4a container.
The "K-Lite Codec Pack" provides "MPC - MP4 Splitter" filter which could be used to connect the m4a source to the Microsfot codec filter "Microsoft DTV-DVD Audio Decoder" to be able to play the file.
Windows Media Player 12 on Windows7 uses Media Foundation instead of DirectShow to play .m4a .m2ts, .mp4, and .mov formats (for other formats it uses DirectShow filters). This explains why we could not do it with the current directshow backend implementation for QMediaPlayer without a third-party filters.
We might consider adding Media Foundation support in the futrure, but for now you have to install third-party filter to have it work on Windows7.
So, installing the K-Lite Codec Pack might help.
You could also try the suggestions in this mailing list thread.
来源:https://stackoverflow.com/questions/32436138/video-play-returns-directshowplayerservicedoseturlsource-unresolved-error-cod