Playing QImages in QVideoWidget
-
Hello,
I have a series of QImages that I want to put together and play in a QVideoWidget. I found were I can convert the QImages to QVideFrames but I don't know how to play the frames. I do not want to write the video out to a file, I simply want to take internally generated images and animate them. Any help would be greatly appreciated!Thanks
-
Have you looked at http://doc.qt.io/qt-5/videooverview.html ? I think you can find answer to your question there.
-
Yes I have looked at that webpage. In the "Working with Low Level Frames" section, the first part seems to talk about if you need to process the frames. This doesn't seem applicable to my situation. The second part describes how to display a single frame. I can see how this would be applied. Since I have a static list of frames, would I use a QTimer or something of that nature to display each frame? Is a QTimer going to be accurate enough or is there a better option?
-
Hi and welcome to devnet,
It will depend on the accuracy you need. Which frame rate are you targeting ?
-
Hi, Thank you!
I'd like to target at 30 FPS at most. I will probably have a user selectable playback rate. My goal is, given a list of QImages, to have a playback capability like what is available in http://doc.qt.io/qt-5/qtmultimedia-multimediawidgets-videowidget-example.html with the "Open" button replaced with a framerate seletor from 1 to 30FPS. RIght now I'm just trying to get it to work with a hard coded framerate. -
In that case QTimer should be enough for your needs.