[Libav-user] How to handle video muxing to file when real frame rate varies from the specified frame rate

Nuno Santos nuno.santos at imaginando.pt
Thu Sep 2 14:13:12 EEST 2021


I have a process that generates video frames in real time. I’m muxing the generated video frames stream in a video file. 

The frames are supposed to be generated at FPS, however, depending on the hardware capacity it might produce less than FPS.

When we start the video stream context we say:

AVRational r = { 1, FPS };
ost->st->time_base = r;

This specifies that the video is going to be at FPS but if less frames are fed, the playback will be faster because it will still reproduce at FPS. 

This is also a problem if we want to add audio to the stream and get it in sync with the video.

I’m sure this is a common problem. I wonder what strategies are used to workaround this cases?

Thank you!

Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210902/36903a76/attachment.htm>

More information about the Libav-user mailing list