理解ffmpeg的re参数

Understanding ffmpeg re parameter

我正在阅读 ffmpeg 中的 -re 选项。 他们提到的是

From the docs

-re (input)

Read input at the native frame rate. Mainly used to simulate a grab device, or live input stream (e.g. when reading from a file). Should not be used with actual grab devices or live input streams (where it can cause packet loss). By default ffmpeg attempts to read the input(s) as fast as possible. This option will slow down the reading of the input(s) to the native frame rate of the input(s). It is useful for real-time output (e.g. live streaming).

我的疑惑基本上是上面描述中我强调的部分。建议在实时输入流时不要使用该选项,但最后建议在实时输出中使用它。

考虑到输入和输出都是rtmp格式的情况,到底该不该用?

不要使用它。当 ffmpeg 能够以比实时更快的速度处理源时,它对 实时输出 很有用。在那种情况下,ffmpeg 可能会以更快的速度发送输出,而接收方可能无法或不想缓冲和排队其输入。

+Mulvya 说了什么。它 (-re) 适用于从离线文件流式传输并以其本机速率(即 25 fps)读取它们,否则 ffmpeg 可能每秒输出数百帧,这可能会导致问题。