How to forward/backward video frame by frame in QMediaplayer?
-
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.
-
@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,
-
@mit_cruze
Take a look here. Seems like the right stackoverflow topic for your issue :-) -
I used KMPlayer to get the frames from video.