ffmpeg - 什么时候 fps 可以是猜测值而不是精确值?

标签 ffmpeg frame-rate libavcodec libavformat

我使用 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。所以,我想了解为什么文档说 ...只是一个猜猜! 如果我总能得到准确的 fps?什么时候改变?

最佳答案

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

因此,r_frame_rate 是一个仅供引用的精细值。但最好单独查看每个帧的 PTS。

关于ffmpeg - 什么时候 fps 可以是猜测值而不是精确值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14124321/

相关文章:

video - FFMPEG : Obtain the system time corresponding to each frame present in a video

android - 如何修复Android手机相机的帧速率

c - libav:编码/解码错误:get_buffer() 失败

ffmpeg - 可以在使用 libavcodec 解码期间裁剪帧大小吗?

ffmpeg - 使用 gstreamer 或 ffmpeg 仅使用终端命令创建 hsync 和 vsync 视频效果

performance - 游戏开发: How Do Game Developers Maintain Game Speed Regardless of FPS?

swift - SceneKit 场景在 macOS 上高于预期的 FPS

ubuntu - ffmpeg、libav、avconv有什么区别和相同点?

c - 在 C 中对 OpenGL 捕获的缓冲区进行编码

ffmpeg - 使用 ffmpeg 记录 Facetime 摄像头 (mac) 提供的最高分辨率