Time code - synchronized capture 4 inputs

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

ThierryT

  • Posts: 7
  • Joined: Wed Sep 25, 2019 1:02 pm
  • Real Name: Thierry Tapie

Time code - synchronized capture 4 inputs

PostTue Oct 15, 2019 4:42 pm

Hi,

I want to get frames synchrnonized from 4 Blackmagic Studio Cameras on DeckLink 8K Pro (4 inputs).
Camera configuration is 1080p25. Genlock signal 1080i50 (Blackmagic Sync Generator)
All the cameras are genlocked by external genlock signal. I don't want to use Synchronized Capture method because I want to keep the possibility to get synchronously 4 SDI video inputs.


I get the frames number for each SDI input (0 to 3) by using the following code:

HRESULT result = videoFrame->GetStreamTime(&time, nullptr, kTimeScale);
if (result != S_OK)
{
fprintf(stderr, "Could not get stream time from frame - result = %08x\n", result);
return S_OK;
}

unsigned frames = (unsigned)((time % kTimeScale) / kFrameDuration);
unsigned seconds = (unsigned)((time / kTimeScale) % 60);
unsigned minutes = (unsigned)((time / kTimeScale / 60) % 60);
unsigned hours = (unsigned)(time / kTimeScale / 60 / 60);


A rapide counter is display in front of the 4 cameras.
When frames value equal 24, the frame buffer 24 is saved in a file for each input (0 to 3) giving file0.raw, file1.raw, file2.raw, file3.raw.

The problem is: there is a gap of one or two frames when I check the output files result (file0.raw, file1.raw, file2.raw, file3.raw). I was expecting the same rapid counter value snapshooted but it is not the case.
This means the frame number after calculation does not corespond the real frame number of the camera. The number of invalid frames/drop frames at start up is not always the same for all SDI video inputs.

To solve the problem, I tryed to get the time code from SDI video coming from each camera. The idea consists to re-sync by software the different input frames according to their time code value. I used the following code:

BSTR timecodeBstr;
IDeckLinkTimecode* timecode = NULL;
if ((videoFrame->GetTimecode(bmdTimecodeRP188VITC1, &timecode) == S_OK))
{
//printf("ok bmdTimecodeRP188VITC1 supported \n");
timecode->GetString(&timecodeBstr);
printf("%S \n", timecodeBstr); }
else
printf("error bmdTimecodeRP188VITC1 not supported \n");

When displaying the time code value, result is always 00:00:00:00 for all SDI input which is not I was expecting. Same result when using capture preview from SDK sample. Further more, the internal counter of the cameras should be set to the same value in same time, but how ?

So, is there any solution to get frames synchronously from 4 SDI video input ?


Thank's

Thierry

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 29 guests