Accurately timing image updates (video playback)
I'm using FFmpeg to read frames from a video, doing some processing, and then showing the video on a form.
Let's say I have a 59.97 fps video. I'd need to update the image on the form every 16.68 ms to have a correct looking output.
At the moment I'm just using QTimer, which isn't very accurate and only allows integers for the timeout. And I'm using a label with setPixmap to display the video frames :)
- Can I time the playback more accurately somehow?
- What is the best way to display fast changing image data on a form?
Hi, and welcome to the Qt Dev Net!
What is your main goal?
To experiment with FFmpeg? Or,
To apply effects to your video?
If it's 2, I recommend using high-level video manipulation functions like "QML shader effects":http://qt-project.org/doc/qt-5/qml-qtquick-shadereffect.html instead of low-level FFmpeg code. Here's a demo: https://www.youtube.com/watch?v=P4kv-AoAJ-Q