Inconsistency in using Capture code provided in SDK

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

Rajat_Shetty

  • Posts: 11
  • Joined: Thu Dec 21, 2017 11:07 am

Inconsistency in using Capture code provided in SDK

PostThu Mar 22, 2018 8:19 am

Hi,

I have a 'DeckLink 4K Extreme 6G SDI' device, and for this I am using 'BlackMagic_DeckLink_SDK_10.9.5' on my Ubuntu 16.04 machine.

My application requires capturing of 500 video frames from external source through DeckLink card using Capture example provided in BlackMagic_DeckLink_SDK. Here the video source is transmitting at 720p59.94 .
The connection done for this is, HDMI-OUT of the video source is connected to HDMI-IN of the DeckLink card.
The command I am using to run the capture executable once I start transmitting the video from external source is:
./Capture -d 0 -m 14 -p 2 -n 500 -v video.raw


So according to this DeckLink card should capture 500 frames and should stop capturing the further frames.
But sometimes what I see is the DeckLink card goes on capturing the frames and doesn't stop once it captures 500 frames.

Unable to get what the problem is, waiting for any help. TIA

Regards
Offline

Cameron Nichols

Blackmagic Design

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

Re: Inconsistency in using Capture code provided in SDK

PostFri Mar 23, 2018 4:02 am

Hi Rajat,

I was also able to observe this problem. It appears that VideoInputFrameArrived callbacks continue to occur after StopStreams. I am testing why this only seen in 10-bit RGB and not other pixel formats.

The quick solution is to unregister the callback after StopStreams. In the source, towards the end of main()
Code: Select all
      fprintf(stderr, "Stopping Capture\n");
      g_deckLinkInput->StopStreams();
      g_deckLinkInput->SetCallback(NULL); // add this line
      g_deckLinkInput->DisableAudioInput();
      g_deckLinkInput->DisableVideoInput();

Please let me know if this resolves the issue.

Kind Regards
Cameron
Offline

Rajat_Shetty

  • Posts: 11
  • Joined: Thu Dec 21, 2017 11:07 am

Re: Inconsistency in using Capture code provided in SDK

PostThu Mar 29, 2018 5:27 am

Hi Cameron

I added the changes as you suggested and rebuilt the executable.
And when I try to run it using:
./Capture -d 0 -m 14 -p 2 -n 350 -v video.raw


I observed that, sometimes it has captured some 425 frames, sometimes 390 frames, or sometimes it goes on capturing and doesn't stop. Instead of capturing only 350 frames.

So to answer your question, after doing the suggested changes, problem remains the same.

Please suggest me if there is any other solution. TIA

Regards

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests