1

Whenever I try to use the seek() function it jumps to the new position and then back to a random point. The desired behaviour would be to simply jump to the new position. I have the following video qml type.

Video {
    id: video
    focus: true
    MouseArea {
        anchors.fill: parent
        onClicked: {
            video.playbackState === MediaPlayer.PlayingState ? video.pause() : video.play()
            playButton.visible = false
        }
    }
}

Whenever I try to skip ahead by a certain amount (for example 1 second) by doing the following, the video does this and then jumps back roughly 0.5s.

RoundButton{
    Layout.fillWidth: true
    text: ">"
    onClicked: {
        video.seek(video.position + 1000)
    }
}

When Paused the Video jumps to the correct location. As soon as the video is played again jumps back to a same seemingly random point which is roughly 0.5s earlier.

If a new position is beeing seeked while the video is playing this seems to happen instantly. So the video jumps to the correct location and then jumps back.

When playing the video for the first time i get the following error a bunch of times.

W MapperHal: buffer descriptor with invalid usage bits 0x2000

When I stop the video and start playing it again I get the following error once.

W MediaPlayerNative: info/warning (3, 0)

The goal is simply to be able to skip through the video in predefined timesteps.

Sam
  • 11
  • 4
  • Just a shot into blue: Due to compression, the consecutive images are not stored itself but as difference to the previous image. (Assuming that there are only small changes in consecutive images, the differences result in much smaller numbers -> better to compress.) The draw-back is that errors would accumulate over the rest of the video and you had to start always from beginning to go to a specific image. That's why, full frames (non-difference images) are inserted periodically. I assume, the effect you see is that it goes back to the last full frame before your intended location. – Scheff's Cat Aug 27 '20 at 11:42
  • FYI: [SO: PyQt QMediaPlayer setPosition rounds the position value](https://stackoverflow.com/q/57889211/7478597), [SO: Force QMediaPlayer to update position accurately for video scrubbing application?](https://stackoverflow.com/q/27006902/7478597) – Scheff's Cat Aug 27 '20 at 11:55
  • @Scheff The going back to the last full frame sounds like a reasonable guess. It would explain the behaviour well. Thanks for the links as well. Altough they refer to mac users and i am currently running on windows 10 they gave me some ideas i could try. – Sam Aug 27 '20 at 14:35

0 Answers0