2

我试图在运行时以非常流畅的方式更改视频的播放速率(fps)。这是一个小的 qml 示例:

import QtQuick 2.0
import QtMultimedia 5.0

Video {
    id: video
    source: "Wildlife.wmv"
    width: 800
    height: 600
    volume: 0
    autoPlay: true
    playbackRate: 0.1 // <--- no effect

    MouseArea {
        anchors.fill: parent
        onClicked: {
            animatePlaybackRate.start() // <--- hangs the video
        }
    }

    NumberAnimation {
        id: animatePlaybackRate
        target: video
        properties: "playbackRate"
        from: 0.1
        to: 2.0
        loops: Animation.Infinite
        duration: 10000
        easing {
            type: Easing.Linear 
        }
    }
}

拜托,你能建议我一种方法吗?我发现使用普通 Qt4(C++,没有 qml)和 GStreamer 有一个缺点,但我真的想将 qml 的强大功能用于应用程序的其他功能。

4

0 回答 0