Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer: setPosition jumps to key frames
QtWS25 Last Chance

QMediaPlayer: setPosition jumps to key frames

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fober
    wrote on last edited by
    #1

    I want to jump to arbitrary position in a video (while the video don't play). When using a compressed format (H264), setPosition() jumps to the closest key frame (it seems to). How can I do to access images between key frames?
    Here is the code
    @
    fMediaPlayer.play ();
    fMediaPlayer.setPosition( pos );
    fMediaPlayer.pause ();
    @

    fMediaPlayer is a QMediaPlayer. Note that it works when the video is compressed as jpeg.
    Any idea of what's wrong ?

    Dominique

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      I think it may depend on OS multimedia backend.

      But in H.264 you have to start to decode from key-frame.
      Because all other frames are just the differences between two key-frames, so nobody will be able to show it.

      If video is decoded as jpeg then all frames are full jpeg images.

      I guess you have to have running decoder to jump between each frame in H.264.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fober
        wrote on last edited by
        #3

        bq. I guess you have to have running decoder to jump between each frame in H.264.

        That's what I think too. Thus the question is how can I force decoding without playing.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          If a decoder is running but the frames are not shown then you need to store or to drop the frames.

          "Here":http://qt-project.org/doc/qt-5/videooverview.html#working-with-low-level-video-frames is a short info about how to work with the frames.

          What is your use case, why do you need to setPosition() to all frames in a stream?

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fober
            wrote on last edited by
            #5

            Thanks for the link. I'll give it a try.
            I'm using video in a musical context. Arbitrary jump to any time location must be supported (while playing or not) and with accurate time synchronization with other medias. This is why I need setPosition().

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved