[FFmpeg-devel] [PATCH] Playout to DeckLink will wait for all buffered frames before stopping.
Devin Heitmueller
devin.heitmueller at ltnglobal.com
Tue Jul 8 19:22:04 EEST 2025
Hi Marvin,
On Tue, Jul 8, 2025 at 11:19 AM Marvin Scholz
<epirat07-at-gmail.com at ffmpeg.org> wrote:
> I think even if a frame is schedule "far" in the future, if I want them
> all played out then it should probably still wait, no? As what is considered
> "far" is a matter of interpretation…
That probably depends. If the clock gets screwed up and a frame is
submitted with a PTS five hours into the future you don't want it to
stall for five hours. The driver lets you control the number of
buffers available (and has limits on such), but IIRC not explicitly on
the timestamps submitted (which dictates when the frame gets played
out).
But yeah, "far" is a matter of interpretation. In practice you
generally won't see frames queued more than a second in advance. I
think we can agree on a reasonable threshold that prevents it getting
stuck in a loop for potentially hours if the clocks were bad but
doesn't cause issues in practice (e.g. 2 seconds?).
> Also there should likely be an option to opt in to this new behavior?
Agreed, this behavior should probably be configurable. I would argue
though that the behavior provided by this patch should be the default.
AFAIK, it wasn't an intentional decision to terminate before all
buffers were output, and flushing pending data on close is the
standard behavior for other muxers.
On a personal note, I work with realtime decoding and thus the
existing behavior is my preference (since I want it to terminate
immediately). But I think my use case is far less common than people
who simply want to play out their file based content to the Blackmagic
device.
Devin
--
Devin Heitmueller, Senior Software Engineer
LTN Global Communications
o: +1 (301) 363-1001
w: https://ltnglobal.com e: devin.heitmueller at ltnglobal.com
More information about the ffmpeg-devel
mailing list