[FFmpeg-user] Local latency with FFplay

Carl Zwanzig cpz at tuunq.com
Thu Apr 22 19:05:15 EEST 2021

On 4/22/2021 12:43 AM, Bouke wrote:
> Trying to view a stream while recording. (That 'sorta kinda' works with a
> tee and udp streaming, but has a horrible delay.)
> Ideal would be to keep FFplay open, and start / stop FFmpeg for
> recording, or just viewing the incoming signal.
The BMD recorder app does a rather good job of that....

> This results in a latency of 6 seconds (Ok, no local file, but with it
> and a tee it’s the same)
Have you tried
different encodings?
tee-ing raw frames into both a viewer and a separate encoder?

IIRC the ffmpeg decklink code has a few frames of latency, but not more than 
that. OTOH, how many does the x264 encoder have? (I'll assume the encoder 
can keep up with the incoming frames.) At least for the viewing part, you 
shouldn't use -any- encoding since those same frames will then have to be 
decoded for display. (If you're using ffplay to monitor the recording 
-after- encoding, they you have to live with the encoder's latency.)



More information about the ffmpeg-user mailing list