我使用Qt 5.4.2,我为播放视频创建了一个Qt Quick程序。
我的视频规范。是1920x1080,H.264,25f / s,12502kbps
代码是简单视频示例的复制
VideoOutput {
anchors.fill: parent;
source: mediaPlayer;
signal sizeChanged;
signal fatalError;
property alias duration: mediaPlayer.duration;
property alias mediaSource: mediaPlayer.source;
property alias metaData: mediaPlayer.metaData;
property alias playbackRate: mediaPlayer.playbackRate;
property alias position: mediaPlayer.position;
property alias volume: mediaPlayer.volume;
MediaPlayer {
id: mediaPlayer;
autoLoad: true;
autoPlay: true;
source: "file:///" + applicationDirPath + "/video/" + playVideoList.currItem();
onError: {
if (MediaPlayer.NoError != error) {
console.log("[qmlvideo] VideoItem.onError error " + error + " errorString " + errorString);
console.log(mediaPlayer.source)
}
}
onStopped: {
mediaPlayer.source = "file:///" + applicationDirPath + "/video/" + playVideoList.nextItem();
mediaPlayer.play();
}
}
onHeightChanged: sizeChanged();
function start() { mediaPlayer.play(); }
function stop() { mediaPlayer.stop(); }
}
该节目播放视频时总是滞后。
有什么建议吗?
感谢。
答案 0 :(得分:0)
好的,最后我知道Qt的MediaPlayer太弱而无法播放高质量的视频。
现在我使用第三方模块QtAV