Long delay from running StartStreams until capture starts

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

Baldur Gislason

  • Posts: 5
  • Joined: Sat Jan 06, 2018 7:55 pm

Long delay from running StartStreams until capture starts

PostWed Feb 28, 2018 4:28 pm

I have a machine with three different types of Decklink cards installed and I have noticed that in my capture application, there's a significant delay from the time I call StartStreams() and until the frame arrived callback starts getting any calls. This long delay also coincides with the delay in the video signal and it is different between cards, the mini recorder 4k appears to have a whole second of delay while the 4K Extreme 12G card only waits a couple hundred milliseconds.
The problem with this is I am getting video frames delivered to the callback that at the time of the callback could be considered ancient history (as much as 30 frames behind reality).
GetAvailableVideoFrameCount() indicates that there are no buffered frames waiting to be picked up.
Is there any workaround to shorten this delay or eliminate it altogether?

Baldur
Baldur Gislason
Offline

Cameron Nichols

Blackmagic Design

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

Re: Long delay from running StartStreams until capture start

PostWed Mar 14, 2018 5:01 am

Hi Baldur,

I modified the Linux Capture sample to maintain time duration between StartStreams call and VideoInputFrameArrived callback, I observed the following output:
Code: Select all
$ ./Capture -d 1 -m 8
Capturing with the following configuration:
 - Capture device: DeckLink Mini Recorder 4K
 - Video mode: 1080i59.94
 - Pixel format: 8 bit YUV (4:2:2)
 - Audio channels: 2
 - Audio sample depth: 16 bit
Elapsed time since StartStreams: 0.068226 ns
Frame received (#0) [No timecode] - Valid Frame - Size: 4147200 bytes
Elapsed time since StartStreams: 0.101405 ns
Frame received (#1) [No timecode] - Valid Frame - Size: 4147200 bytes
Elapsed time since StartStreams: 0.134734 ns
Frame received (#2) [No timecode] - Valid Frame - Size: 4147200 bytes
Elapsed time since StartStreams: 0.168110 ns
Frame received (#3) [No timecode] - Valid Frame - Size: 4147200 bytes
Elapsed time since StartStreams: 0.201475 ns
Frame received (#4) [No timecode] - Valid Frame - Size: 4147200 bytes

Are you able to provide further details on your setup (eg video mode, automatic mode detection enabled/disabled, OS + version, Desktop Video version)?

Regards
Cameron Nichols
Offline

Baldur Gislason

  • Posts: 5
  • Joined: Sat Jan 06, 2018 7:55 pm

Re: Long delay from running StartStreams until capture start

PostThu Mar 15, 2018 1:41 pm

I am running Desktopvideo 10.9.7a2 on Ubuntu.
I too modified my Capture.cpp to print timing information using gettimeofday().
t0 at the line before calling EnableVideoInput()

./Capture -d 2 -m 22 -z bar
Capturing with the following configuration:
- Capture device: DeckLink 4K Extreme 12G
- Video mode: 2160p29.97
- Pixel format: 8 bit YUV (4:2:2)
- Audio channels: 2
- Audio sample depth: 16 bit

EnableVideoInput completes at 174968 usec
EnableAudioInput completes at 175191 usec
StartStreams completes at 175234 usec
First frame in arrives at 250789 usec for processing by callback.
Frame received (#0) [No timecode] - Valid Frame - Size: 16588800 bytes
Baldur Gislason

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests