Page 1 of 1

bmdFormat8BitBGRA returns empty frames

PostPosted: Fri Sep 28, 2018 3:01 pm
by Jonas Geduldig
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.

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Thu Oct 04, 2018 3:24 am
by Cameron Nichols
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

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Fri Oct 05, 2018 2:59 pm
by Jonas Geduldig
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?

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Tue Oct 09, 2018 11:52 pm
by Cameron Nichols
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

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Wed Oct 10, 2018 2:51 pm
by Jonas Geduldig
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?

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Mon Oct 15, 2018 3:03 pm
by Jonas Geduldig
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?

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Thu Oct 18, 2018 1:10 am
by Cameron Nichols
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

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Sun Feb 10, 2019 12:23 am
by tomerbr
Hi,

Where can I find the mentioned StillsCSharp sdk?
Couldn't find anything on google :o

Re: bmdFormat8BitBGRA returns empty frames

PostPosted: Mon Feb 18, 2019 2:58 am
by Cameron Nichols
Hi Tomer,

Please download the latest Desktop Video SDK from the Blackmagic Design Developer site: https://www.blackmagicdesign.com/develo ... d-playback

Regards
Cameron