bmdFormat8BitBGRA returns empty frames

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

Jonas Geduldig

  • Posts: 34
  • Joined: Tue Jun 17, 2014 7:04 pm

bmdFormat8BitBGRA returns empty frames

PostFri Sep 28, 2018 3:01 pm

On a Decklink Duo 2, I have a channel set up for input.

DoesSupportVideoMode returns bmdDisplayModeNotSupported for bmdModeHD720p5994 with bmdFormat8BitBGRA. So this is a supported mode for video capture.

The video frame return by my VideoInputFrameArrived callback has a height of 720, width of 1280. The row bytes is 5120. So all looks good.

However, the BGR bytes are all zeros and the A bytes are all some invalid large integer.
Offline

Cameron Nichols

Blackmagic Design

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

Re: bmdFormat8BitBGRA returns empty frames

PostThu Oct 04, 2018 3:24 am

Hi Jonas,

In your VideoInputFrameArrived callback, are you checking the validity of the incoming frame? ie
Code: Select all
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource)
{
    // Invalid frame received
}
It may take several VideoInputFrameArrived callbacks before a valid frame is detected.

Regards
Cameron
Offline

Jonas Geduldig

  • Posts: 34
  • Joined: Tue Jun 17, 2014 7:04 pm

Re: bmdFormat8BitBGRA returns empty frames

PostFri Oct 05, 2018 2:59 pm

I added the test for bmdFrameHasNoInputSource. It appears that when I set the input to YUV and wait a few frames I begin receiving valid frames (bmdFrameHasNoInputSource not set). However, when I set the input to BGRA I never receive valid frames (bmdFrameHasNoInputSource set). Why would that be if BGRA is a supported input pixel format?
Offline

Cameron Nichols

Blackmagic Design

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

Re: bmdFormat8BitBGRA returns empty frames

PostTue Oct 09, 2018 11:52 pm

Hi Jonas,

Have you enabled automatic mode detection (by calling IDeckLinkInput::EnableVideoInput with bmdVideoInputEnableFormatDetection flag)? If so, on the IDeckLinkInputCallback::VideoInputFormatChanged callback, what are you seeing for the callback inputs:
[*] newDisplayMode - the detected display mode
[*] detectedSignalFlags - the detected signal flags, from this you can determine whether you are receiving YCbCr 4:2:2 or RGB 4:4:4.

For this test, you need to call IDeckLinkInput::EnableVideoInput with a display mode other than bmdModeHD720p5994 for the VideoInputFormatChanged callback to trigger.

Regards
Cameron
Offline

Jonas Geduldig

  • Posts: 34
  • Joined: Tue Jun 17, 2014 7:04 pm

Re: bmdFormat8BitBGRA returns empty frames

PostWed Oct 10, 2018 2:51 pm

I tried the test by calling
Code: Select all
input->EnableVideoInput(bmdModeNTSC, bmdFormat8BitBGRA, bmdVideoInputEnableFormatDetection)

VideoInputFormatChanged returns with:
newDisplayMode = bmdModeHD720p5994
detectedSignalFlags = bmdDetectedVideoInputYCbCr422

Maybe I am misunderstanding the pixel format parameter with EnableVideoInput. The video coming in is not BGRA, but I want to access each frame as BGRA in memory. I thought that this conversion would happen automatically, but is that incorrect? Is the pixel format paramter simply specifiying what format to expect on the input?
Offline

Jonas Geduldig

  • Posts: 34
  • Joined: Tue Jun 17, 2014 7:04 pm

Re: bmdFormat8BitBGRA returns empty frames

PostMon Oct 15, 2018 3:03 pm

In other words, if the video is compressed and I want to get each frame as uncompressed, do I need to convert them to uncompressed BGRA myself? Is it not possible to call EnableVideoInput with the appropriate parameters so that the frames received by VideoInputFormatChanged are uncompressed?
Offline

Cameron Nichols

Blackmagic Design

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

Re: bmdFormat8BitBGRA returns empty frames

PostThu Oct 18, 2018 1:10 am

Hi Jonas,

If the incoming stream is YUV, you will need to use the IDeckLinkVideoConversion object interface to convert it to BGRA pixel format. We have a C# sample StillsCSharp that demonstrates how to convert a captured frame to BGRA, there are also C++ samples in the pipeline.

The DeckLink SDK does not support compressed streams.

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 3 guests