PDA

View Full Version : Using QT to record a Video Playback



Avan
11th May 2017, 07:38
Hi, basically I have a QMediaPlayer that is playing a video file.
I would like to record the video playing and saved it into another file.

May I know is there any libraries or classes I can use to fulfill this requirement.
I asked this question in stackoverflow and 0 person could answer me.

I hope there is some experts here to guide me to find a solution for this problem.


Updated:
So I decided to use the following methods:

I will use the widget->grab() method to get a list of QPixmap (Video Frames)
then I will pass them to a QThread for processing.

However, I realized the widget->grab() method is too slow.



QPixmap snapshot = videoPlayerView->grab();
emit passFrames(snapshot);


My Video that is streaming was lagging when I am grabbing the frames. My FPS is 25 which means I have to grab a frame every 40ms.
Is there any other way I could obtained the frames or screenshots of my video?

- I am unable to put the grabbing in a thread as the widget can only be accessed in the main thread.

Can anyone help or maybe suggest another solution for me?
Just a direction or something I could try.

Thanks

srsr
11th May 2017, 12:11
With Linux you can wrap FFMPEG Library or applications ( even its converter utility)
With Windows you can wrap MediaFoundation or DirectShow Library or applications
Using a Qt MediaPlayer is not a (good) practical strategy.

kuzulis
12th May 2017, 11:14
+100500 to srsr