Page 1 of 1

Capturing 3D input from HDMI

PostPosted: Mon Aug 05, 2019 3:25 pm
by am_te_dev
Hi
i am using the following product:Decklink 4k Extreme 12G

my issue is about capturing 3d line by line video stream from HDMI input with the c++ API.
when i am capturing the 3d stream, i manage to get the left eye part of the image but i don't get the right eye buffer.

here is the code that i am using:
Code: Select all
void BlackMagicGrabber::CopyFrameForDisplay(IDeckLinkVideoInputFrame* pFrame)
{
    pFrame->GetBytes(&imageBufferPointer);  //here i get the left eye
    ....

  IDeckLinkVideoFrame3DExtensions* pExtension;
      if (S_OK !=pFrame->QueryInterface(IID_IDeckLinkVideoFrame3DExtensions(void**)&pExtension))
      {
         Logger_LogErrString("BlackMagicGrabber", "CopyFrameForDisplay: Failed getting IID_IDeckLinkVideoFrame3DExtensions from frame, can't get right eye data");
      }
}


i am not getting the pointer to the IDeckLinkVideoFrame3DExtensions, when i am using this code with dual stream SDI input i do get both the left and the right eye.

can you please help

thanks

Re: Capturing 3D input from HDMI

PostPosted: Tue Aug 06, 2019 7:39 am
by Cameron Nichols
Hi Aaron,

I was able to capture 3D with DeckLink 4K Extreme 12G with loopback HDMI cable with the following SDK samples (run on Ubuntu 18.04 LTS, Desktop Video 11.2):

Source:
Code: Select all
% ./TestPattern -d 0 -m 10 -3
Capturing with the following configuration:
 - Playback device: DeckLink 4K Extreme 12G
 - Video mode: 1080i50 3D
 - Pixel format: 8 bit YUV (4:2:2)
 - Audio channels: 2
 - Audio sample depth: 16 bit
Starting playback
scheduled 357              completed 333              dropped 0
Sink:
Code: Select all
% ./Capture -d 0 -m 10 -3
Capturing with the following configuration:
 - Capture device: DeckLink 4K Extreme 12G
 - Video mode: 1080i50 3D
 - Pixel format: 8 bit YUV (4:2:2)
 - Audio channels: 2
 - Audio sample depth: 16 bit
Frame received (#0) [No timecode] - Valid Frame (3D left/right) - Size: 4147200 bytes
...

If you are on Linux, could you try the same configuration? Which display mode are you trying to capture? Do you see 3D capture in Media Express?

Regards
Cameron

Re: Capturing 3D input from HDMI

PostPosted: Tue Aug 06, 2019 1:22 pm
by am_te_dev
Hi
Thanks on the response, i manage to capture HDMI 3D and loop it out using the SDK,
but i am writing a software which does some image analysis and processing on the input
and then output it again as 3d in different formats (SBS, LBL, ..), so i must have the right and left eye images the make the 3d input.

can anyone know how to get both frames from the 3d line by line input

thanks

Re: Capturing 3D input from HDMI

PostPosted: Thu Aug 08, 2019 5:57 am
by Cameron Nichols
Hi Aaron,

Each IDeckLinkVideoFrame infers a buffer that the DeckLink hardware will write into. A 3D frame will infer 2 IDeckLinkVideoFrame objects. There is no direct correlation between the 2 buffers in memory. To create a side-by-side or line-by-line buffer you will need to copy your left-eye and right-eye line buffers into a seperate buffer.

If you are using OpenCV for your image analysis + processing, one possible solution could be to use hconcat.

Regards
Cameron

Re: Capturing 3D input from HDMI

PostPosted: Mon Aug 12, 2019 10:20 am
by am_te_dev
Hi Cameron

Thank you for you response, can you please elaborate on how do i get that right eye buffer when my input is HDMI.

for example when i am using two channel SDI input i can use the following code:
Code: Select all
IDeckLinkVideoFrame3DExtensions* pExtension;
pFrame->QueryInterface(IID_IDeckLinkVideoFrame3DExtensions, (void**)&pExtension)
IDeckLinkVideoFrame* pRightFrame;
pExtension->GetFrameForRightEye(&pRightFrame);


but when i am using HDMI the query for IID_IDeckLinkVideoFrame3DExtensions returns S_FALSE.

is there any other way to query for the right eye?

thanks
Aaron

Re: Capturing 3D input from HDMI

PostPosted: Thu Aug 15, 2019 7:23 am
by Cameron Nichols
Hi Aaron,

Which version of Desktop Video are you running and what is your input video display mode?

Can you check HRESULT return for IDeckLinkVideoInputFrame::QueryInterface(IID_IDeckLinkVideoFrame3DExtensions, ...). I would expect to see either E_NOINTERFACE if invalid frame or S_OK otherwise.

If you are not already doing so, you may need to check, firstly that pFrame is not nullptr, then secondly the no input source frame flag, eg:
Code: Select all
if (pFrame->GetFlags() & bmdFrameHasNoInputSource)
    return false;
Regards
Cameron

Re: Capturing 3D input from HDMI

PostPosted: Mon Aug 26, 2019 10:22 am
by am_te_dev
Hi Cameron

I have checked the video frame flags and the return value is true, i have an input source.
I am using a 3d camera connect to the black magic card through the HDMI interface, the 3d image packed in Line by line format.

The black magic card identifies the input type, i am getting a frame.
this code:
pFrame->GetBytes(&imageBufferPointer);

produces the data for the left eye frame, so far we identified the correct input source managed to split the 3d image and extract the left eye frame.

now i want to get the right eye frame
i am trying the following code:
Code: Select all
IDeckLinkVideoFrame3DExtensions* pExtension;
      if (S_OK != pFrame->QueryInterface(IID_IDeckLinkVideoFrame3DExtensions, (void**)&pExtension))
      {
         Logger_LogErrString("BlackMagicGrabber", "CopyFrameForDisplay: Failed getting IID_IDeckLinkVideoFrame3DExtensions from frame, can't get right eye data");
      }
      else
      {         
         IDeckLinkVideoFrame* pRightFrame;
         pExtension->GetFrameForRightEye(&pRightFrame);
                }


this should have provide me the left eye frame but the QueryInterface for the 3D extension fails.

What should i do to get that left eye frame?

thanks
Aaron

Re: Capturing 3D input from HDMI

PostPosted: Tue Aug 27, 2019 9:06 pm
by Cameron Nichols
Hi Aaron,

Can you please run StatusMonitor example at the same time as performing 3D capture - this will help analyse the detected signal.

Thanks
Cameron