[FFmpeg-user] Local latency with FFplay

Bouke bouke at editb.nl
Fri Apr 23 09:46:48 EEST 2021


> On 22 Apr 2021, at 18:05, Carl Zwanzig <cpz at tuunq.com> wrote:
> 
> 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....

You mean Media Express? Yes, that has just a little latency, but is too limited for my purpose.

> 
>> 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?

Yes, but that’s no issue, the encoding is fast enough

> tee-ing raw frames into both a viewer and a separate encoder?

How would I go about that? And, how should that help ’not’ filling the buffer that FFplay reads out, introducing the latency?

> IIRC the ffmpeg decklink code has a few frames of latency, but not more than that. OTOH, how many does the x264 encoder have?
Very little, that’s not the issue

> (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.)

Just cursed and googled more, -fflags nobuffer solves it!

Thanks for putting me on the right track

Bouke


> Later,
> 
> z!
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list