Capturing 3D input from HDMI

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

am_te_dev

  • Posts: 3
  • Joined: Mon Aug 05, 2019 3:13 pm
  • Real Name: aaron magal

Capturing 3D input from HDMI

PostMon Aug 05, 2019 3:25 pm

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
Offline

Cameron Nichols

Blackmagic Design

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

Re: Capturing 3D input from HDMI

PostTue Aug 06, 2019 7:39 am

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
Offline

am_te_dev

  • Posts: 3
  • Joined: Mon Aug 05, 2019 3:13 pm
  • Real Name: aaron magal

Re: Capturing 3D input from HDMI

PostTue Aug 06, 2019 1:22 pm

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
Offline

Cameron Nichols

Blackmagic Design

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

Re: Capturing 3D input from HDMI

PostThu Aug 08, 2019 5:57 am

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
Offline

am_te_dev

  • Posts: 3
  • Joined: Mon Aug 05, 2019 3:13 pm
  • Real Name: aaron magal

Re: Capturing 3D input from HDMI

PostMon Aug 12, 2019 10:20 am

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
Offline

Cameron Nichols

Blackmagic Design

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

Re: Capturing 3D input from HDMI

PostThu Aug 15, 2019 7:23 am

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

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 4 guests