3

我刚刚在我的 Debian Jessie linux 上安装了 gstreamer。我实际上计划在 QtMultimedia 框架中使用它。虽然我对 vlc 很熟悉......我是 gstreamer 世界的新手。

我尝试运行以下非常基本的 qml 程序:

Window {
    visible: true

    MediaPlayer {
        id: mediaplayer
        source: "file:///home/kai/Videos/testx264.mp4"
    }

    VideoOutput {
        anchors.fill: parent
        source: mediaplayer
    }

    MouseArea {
        id: playArea
        anchors.fill: parent
        onPressed:
        {

            mediaplayer.play()
            console.log("error = ", mediaplayer.errorString)
        }
    }
}

当我尝试播放视频时,我听到了声音,但没有视频。在应用程序输出中,我得到以下日志:

Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3.1, profile=(string)high, codec_data=(buffer)0164001fffe1001e6764001fac56240b435f9f016a040402800000030080000032478c18c4c001000668e88e1f2c8b, width=(int)720, height=(int)404, framerate=(fraction)50/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true'."
qml: error =  Cannot play stream of type: <unknown>

但是,如果我按以下方式启动 gstreamer 命令行,我可以正确播放视频:

gst-launch-1.0 filesrc location=/home/kai/Videos/testx264.mp4  ! decodebin name=decoder decoder. ! videoconvert ! xvimagesink decoder. ! audioconvert ! pulsesink

我真的不明白发生了什么。我想知道我的 Qt 版本是否可能与一些 gst 东西静态链接?我已经使用常规 Linux 安装程序安装了 Qt 5.5。

我应该设置一些特定的设置吗?我应该分别重新编译特定的 Qt 组件吗?

Z。

4

0 回答 0