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. How to forward/backward video frame by frame in QMediaplayer?
Forum Updated to NodeBB v4.3 + New Features

How to forward/backward video frame by frame in QMediaplayer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 4.8k Views 1 Watching
  • 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.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    How to forward/bakcward video frame by frame in QMediaplayer?

    1 Reply Last reply
    0
    • Vinod KuntojiV Offline
      Vinod KuntojiV Offline
      Vinod Kuntoji
      wrote on last edited by
      #2

      @mit_cruze ,

      Store all the frames bytearray in QHash,

      QHash<int, QByteArray> m_imageHash,

      Take two buttons like next, previous, Initially both buttons should point 0th index. Pressing next should get the next index bytearray and display it, Pressing previous should get the previous index bytearray and display it.

      C++, Qt, Qt Quick Developer,
      PthinkS, Bangalore

      1 Reply Last reply
      1
      • mit_cruzeM Offline
        mit_cruzeM Offline
        mit_cruze
        wrote on last edited by
        #3

        how do I get each frame? I have just local path of video. In which from I will get each frame. QImage or QVideoFrame?

        1 Reply Last reply
        0
        • Vinod KuntojiV Offline
          Vinod KuntojiV Offline
          Vinod Kuntoji
          wrote on last edited by Vinod Kuntoji
          #4

          @mit_cruze ,
          First you need to split the video into frames.
          Use vlc to get the frames from video.

          refer the following sample code
          QFile file;
          QByteArray m_fileData;
          file.setFileName(frameName);
          if(file.open(QIODevice::ReadOnly)){
          m_fileData = file.readAll();
          emit loadBuffer(fileCount, m_fileData);
          }

          Then convert bytearray to QImage,

          C++, Qt, Qt Quick Developer,
          PthinkS, Bangalore

          1 Reply Last reply
          1
          • mit_cruzeM Offline
            mit_cruzeM Offline
            mit_cruze
            wrote on last edited by
            #5

            But I am using QMediaPlayer of QT. Do you have any idea about it? How to divide frames of Video?

            J.HilkJ Vinod KuntojiV 2 Replies Last reply
            0
            • mit_cruzeM mit_cruze

              But I am using QMediaPlayer of QT. Do you have any idea about it? How to divide frames of Video?

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @mit_cruze
              Take a look here. Seems like the right stackoverflow topic for your issue :-)


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              0
              • mit_cruzeM mit_cruze

                But I am using QMediaPlayer of QT. Do you have any idea about it? How to divide frames of Video?

                Vinod KuntojiV Offline
                Vinod KuntojiV Offline
                Vinod Kuntoji
                wrote on last edited by
                #7

                @mit_cruze ,

                I used KMPlayer to get the frames from video.

                C++, Qt, Qt Quick Developer,
                PthinkS, Bangalore

                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