I have a Qt application running, i hijack the openGL frameBuffer when a new frame has been rendered. A new frame is drawned when only some changes appear in the scene, so no constant frameRate.
Now i want to send those raw rgba pixels value to ffmpeg, I use this wonderfull link http://blog.mmacklin.com/2013/06/11/real-time-video-capture-with-ffmpeg/ to encode my input stream, but in the end i have a video where each frame has been concatenate with a constant time between each.
To clarify, if i am not updating my application for 1 sec, this halt won't appear in the final video.
I use this command line to encode:
ffmpeg.exe -f rawvideo -vsync 1 -pix_fmt rgba -s 1172x768 -i - -threads 0 -y -pix_fmt yuv420p -b:v 8000K -vf vflip output.mp4
and i write in to my stream with:
uchar* buffer = (uchar*)malloc(count);
fwrite(buffer, sizeof(char), count, m_ffmpeg);
fflush(m_ffmpeg);
I saw the vsync option, i use it with different values as output and input options, but it seems to have no effect.
I might be able to store the delta time in a .txt file if it can help.
-use_wallclock_as_timestamps 1
before-i
-vsync
to complete the gap we should take in to account ?-vsync 0
and if it's relevant or not.