Output schedule frame delay increasing

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

panderson2

  • Posts: 4
  • Joined: Tue Dec 13, 2022 12:26 am
  • Real Name: Phillip Reeder

Output schedule frame delay increasing

PostTue Jan 31, 2023 9:55 pm

In a live production using a Decklink 8k, we've observed playback latency increasing steadily at a rate of around 1ms per minute. We've narrowed down the delay to frame scheduling. Specifically, the latency from
Code: Select all
ScheduleVideoFrame
to
Code: Select all
ScheduledFrameCompleted
starts at 50ms and climbs up to over 300ms after a few hours. This eventually leads to media queue backup and manifests as stuttering video/audio in the final output.

This happens no matter the mode, though we are mostly focused on Hp59 and Hi59 outputs. This is on SDK version 11.5.1. Is there anything we can do to pinpoint and resolve the issue?

Thanks.
Offline

panderson2

  • Posts: 4
  • Joined: Tue Dec 13, 2022 12:26 am
  • Real Name: Phillip Reeder

Re: Output schedule frame delay increasing

PostThu Feb 02, 2023 8:39 pm

Using GetFrameCompletionReferenceTimestamp we're seeing the difference by frame of the frameCompletionTimestamp as 60061 in timescale 60000. As far as I can tell that means the Decklink device takes 60061/60000~=1.00102 frame durations per frame which would lead to our increasing latency. How can this be explained?
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 442
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Output schedule frame delay increasing

PostWed Mar 08, 2023 5:29 am

Hi Phillip,

Please be aware that the system and output frames are based on different clocks. The output clock will be based on a local clock with frame timing locked to genlock reference, or full-duplex input, or free running. In either case it won't be locked to system clock.

As such there will be some long term drift between output clock and system clock, however I would not expect it to be as high as 60061/60000 ~= 1000ppm.

If your frame output is free-running you can perform fine clock adjustment with the configuration item bmdDeckLinkConfigClockTimingAdjustment with integer range -127ppm to +127ppm. Support for this configuration item was added for the DeckLink 8K Pro in Desktop Video 12.3, but you can check support in other products by querying attribute flag BMDDeckLinkSupportsClockTimingAdjustment.

Regards
Cameron
Offline

panderson2

  • Posts: 4
  • Joined: Tue Dec 13, 2022 12:26 am
  • Real Name: Phillip Reeder

Re: Output schedule frame delay increasing

PostFri Mar 24, 2023 10:38 pm

What we're trying to achieve is long term stability between capture and augmented playback without external genlock reference, on two subdevices. Using BMDDeckLinkSupportsClockTimingAdjustment works for input generated by the system clock i.e. ffmpeg to the device. However it becomes unusable when working off an SDI capture. I would think this would be relative simple as we're attempting to drive the playback timing from the capture timing. Can this be done?
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 442
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Output schedule frame delay increasing

PostWed Apr 12, 2023 5:31 am

Hi Phillip,

In full-duplex mode (and absence of genlock reference), the output frame timing will be locked to the timing of an active capture.

If you a looking to output independently of input frame timing, change the profile of the DeckLink 8K Pro to 4 sub-device full-duplex. When in half-duplex mode, all output connectors will operate independent of input capture.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 7 guests