2

我使用 libavcodec 进行视频处理。

的文档AVStream->r_frame_rate

Real base framerate of the stream.
This is the lowest framerate with which all timestamps can be
represented accurately (it is the least common multiple of all
framerates in the stream). Note, this value is just a guess!

我尝试了几个 mp4 和 avi 视频(25fps)并且r_frame_rate总是像我预期的那样 25。所以,我想了解为什么文档说...is just a guess!如果我总是得到精确的 fps?什么时候改变?

4

1 回答 1

2

许多容器,尤其是流式容器(例如 mpeg-ts)不记录帧速率。许多容器允许可变帧率视频。ffmpeg 尝试通过查看前几秒并计算帧数来确定帧速率。但是,如果帧速率在整个流中发生变化或变化,则 r_frame_rate 可能会变得不准确。

因此 r_frame_rate 对于信息目的来说是一个很好的值。但最好单独查看每一帧的 PTS。

于 2013-11-21T19:18:32.850 回答