[FFmpeg-user] Determine when h.264 TS/UDP frame rate has changed in C/C++

Kevin Hise hisekc at gmail.com
Mon Jan 18 04:59:39 EET 2021

I'm decoding an h.264 video as TS over UDP from a Haivision encoder.
When I change the video output from the camera from one resolution
(like 720p) to something else (say 1080p) I can see a change in the
video context or the parser structures that indicate the new video

However when I change the video to something that has the same
resolution BUT A DIFFERENT FRAME RATE (say from 59.9 to 60, or from 60
to 50) the video still properly decodes but none of the AVRational
values that should compute to the frame rate change...they all seem to
contain the same value from whatever the video frame rate was when
decoding started.

Even the API function "av guess frame rate" returns the original frame
rate, not the actual current rate.

Is there any way to determine what the *current* frame rate is,
without having to destroy and recreate the decoder context and parser?
Is there a way to determine that something has changed in the video
and the parser had to do some "thinking" (like it seems to do) so that
it could continue with decoding?

I need to know so I can update some rendering and timing values.


More information about the ffmpeg-user mailing list