I am recording desktop video and audio with ffmpeg. I am controlling the process with c#. Simplified, my ffmpeg arguments are “ffmpeg -f gdigrab -framerate 30 -i desktop -preset ultrafast -pix_fmt yuv420p output.mp4”
I have some functionality to pause and resume the recording, essentially just suspending and resuming the process. This works, however, it leaves the paused section in the video, just one frame for the entire duration. To fix this, I added “-vf setpts=N/FR/TB” yo the arguments. This resolved that issue, but while recording my framerate was 1.3 fps rather than 30 and the video duration was only a few seconds instead of the minute it so it should have been. The video was also obviously quite sped up.
How do I use “setpts” without it affecting the video in this way, or what alternative do I have to prevent an extended frame in the middle of the recording?
TLDR: “-vf setpts=N/FR/TB” affects framerate and playback speed in ways I don’t understand.