Not supported pixel formats with DeckLink Mini Recorder 4K

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

acastles91

  • Posts: 6
  • Joined: Thu Feb 21, 2019 7:23 am
  • Real Name: Antonio Castles

Not supported pixel formats with DeckLink Mini Recorder 4K

PostSat Feb 08, 2020 1:04 pm

Hello. I have been digging around the SDK for a while and I'm interested in implementing something similar to the example called CaptureStills. I made a project with its files in qt creator and I managed to compile it just fine. However, I cannot get a correct pixel format mode. From the list of supported pixel formats, which is a vector called kSupportedPixelFormats, I can only get the first two to work, the other ones fail. Here is how it goes:

Code: Select all
 Index 0 - 8 bit YUV (4:2:2)                          OK
 Index 1 - 10 bit YUV (4:2:2)                        OK
 Index 2 - 8 bit ARGB (4:4:4)                       Fail
 Index 3 - 8 bit BGRA (4:4:4)                       Fail
 Index 4 - 10 bit RGB (4:4:4)                       Fail
 Index 5 - 12 bit RGB (4:4:4)                       Fail
 Index 6 - 12 bit RGB (4:4:4) Little-Endian  Fail
 Index 7 - 10 bit RGBX (4:4:4)                     Fail


I am using a DeckLink Mini Recorder 4K and a Micro Studio camera, which inside MediaExpress can record Avi 10 bit YUV, Avi 10 bit RGB, QuickTime 10 bit YUV, QuickTime 10 bit RGB and DPX 10 bit RGB. Could you give me a hint on where the problem lies? Thank you!
Offline

Cameron Nichols

Blackmagic Design

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

Re: Not supported pixel formats with DeckLink Mini Recorder

PostMon Feb 10, 2020 3:36 am

Hi Antonio,

I can think of two potential issues why you would see this:
  • You are capturing in a display mode that only supports YUV 422 capture, not RGB 444 - on the DeckLink Mini Recorder 4K these modes are NTSC, PAL and >2160p50.
  • You have a YUV 422 signal on the wire, but not providing case for conversion to RGB 444. The CaptureStills SDK sample infers a class Bgra32VideoFrame that implements IDeckLinkVideoFrame for the reason that the sample requires the capture format to be BGRA. It uses the IDeckLinkVideoConversion interface to provide the conversion to the required format. See description of input pixel format conversion in the SDK manual, section 2.4.14
Are you still using IDeckLinkVideoConversion from CaptureStills in your project?

Regards
Cameron
Offline

acastles91

  • Posts: 6
  • Joined: Thu Feb 21, 2019 7:23 am
  • Real Name: Antonio Castles

Re: Not supported pixel formats with DeckLink Mini Recorder

PostMon Feb 10, 2020 9:57 am

Cameron Nichols wrote:Hi Antonio,

I can think of two potential issues why you would see this:
  • You are capturing in a display mode that only supports YUV 422 capture, not RGB 444 - on the DeckLink Mini Recorder 4K these modes are NTSC, PAL and >2160p50.
  • You have a YUV 422 signal on the wire, but not providing case for conversion to RGB 444. The CaptureStills SDK sample infers a class Bgra32VideoFrame that implements IDeckLinkVideoFrame for the reason that the sample requires the capture format to be BGRA. It uses the IDeckLinkVideoConversion interface to provide the conversion to the required format. See description of input pixel format conversion in the SDK manual, section 2.4.14
Are you still using IDeckLinkVideoConversion from CaptureStills in your project?

Regards
Cameron


Thank you very much for your answer Cameron. I am using IDeckLinkVideoConversion, it looks something like this:

Code: Select all
else if ((++captureFrameCount % captureInterval) == 0)
        {
            std::string outputFileName;
            result = ImageWriter::GetNextFilenameWithPrefix(captureDirectory, filenamePrefix, outputFileName);
            if (result != S_OK)
            {
                fprintf(stderr, "Unable to get filename\n");
                captureRunning = false;
            }
            else
            {
                fprintf(stderr, "Capturing frame #%d to %s\n", captureFrameCount, outputFileName.c_str());

                if (receivedVideoFrame->GetPixelFormat() == bmdFormat8BitBGRA)
                {
                    // Frame is already 8-bit BGRA - no conversion required
                    bgra32Frame = receivedVideoFrame;
                    bgra32Frame->AddRef();
                }
                else
                {
                    bgra32Frame = new Bgra32VideoFrame(receivedVideoFrame->GetWidth(), receivedVideoFrame->GetHeight(), receivedVideoFrame->GetFlags());

                    result = deckLinkFrameConverter->ConvertFrame(receivedVideoFrame, bgra32Frame);
                    if (FAILED(result))
                    {
                        fprintf(stderr, "Frame conversion to BGRA was unsuccessful\n");
                        captureRunning = false;
                    }
                }

                result = ImageWriter::WriteBgra32VideoFrameToPNG(bgra32Frame, outputFileName);
                if (FAILED(result))
                {
                    fprintf(stderr, "Image encoding to file was unsuccessful\n");
                    captureRunning = false;
                }


If I understand correctly, the program is taking the incoming frames, checking if they are 8 bit BGRA and converting them to that format if they are not before saving them as .png, correct? So in order to get RGB 444 I should avoid this conversion altogether or reconvert before the saving method? What about if I want to do playback of the stream, should it also be coming as 8 bit BGRA? Thanks a lot.

Antonio
Offline

Cameron Nichols

Blackmagic Design

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

Re: Not supported pixel formats with DeckLink Mini Recorder

PostTue Feb 11, 2020 6:35 am

Hi Antonio,

The actual incoming pixel format is set in the DeckLinkInputDevice::VideoInputFormatChanged callback for auto-mode detection. Depending on whether 422 or 444 is detected on the wire, the sample will capture with bmdFormat10BitYUV or bmdFormat10BitRGB pixel formats. In either case, the call to deckLinkFrameConverter->ConvertFrame will convert to required pixel format bmdFormat8BitBGRA.

On playback, it is OK to schedule BGRA frames, so long as its supported by that mode. The actual colorspace output on the wire is set by configuration flag bmdDeckLinkConfig444SDIVideoOutput (true=444, false = 422).

Regards
Cameron

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests