I am trying to create a video recorder with Qt. What I have done so far is to take a screenshot with a rectangle on the screen and save it. In the end, I use ffmpeg to get the video file from the images.
I connected the timeout() timer signal to my custom slot, which takes a snapshot and saves it in my tmp folder. The timer has an interval of 1000/30. It should be 30 times per second. But 1000/30 is a little over 33 milliseconds, so I cannot get 30 frames per second. This is a bit more.
I recorded a YouTube video with my recorder and everything was smooth, but a little faster / slower depending on the interval.
So my question basically is, how do I get really 30/40/50 / ... fps?
source share