- Posts: 9
- Joined: Tue Aug 11, 2020 12:01 pm
- Real Name: Michael Banck
Hi everyone,
I am currently playing with the SDK on Ubuntu and there are some color problems. And it goes even further, Media Express is also displaying them wrong.
So the image I was capturing is this one .
I connected my laptop hdim-out to the my desktop pc with this blackmagic grabber https://www.blackmagicdesign.com/de/products/decklink/techspecs/W-DLK-05.
However, you can see the result in the attached image. This result is shown for Media Express and SDK, code below.
Since Media Express was created by Blackmagicdesign I would expect the right result, but you can see it isn't, for some reason. So lets see my code. I basically used the "Capture" sample of the SDK. I added the openCV lib and convert the image from YUV to an openCV RGB/BGR array, which works good so far:
You can see I do it in the "VideoInputFrameArrived" function of the "Capture" sample. The translation from YUV to RGB is done by openCV, the file writer as well.
The card is telling me this values:
Capturing with the following configuration:
- Capture device: DeckLink Mini Recorder
- Video mode: 1080i60
- Pixel format: 8 bit YUV (4:2:2)
- Audio channels: 2
- Audio sample depth: 16 bit
I am using Ubuntu 18.04 and the SDK and drivers of 11.5.1 ()
Can you pls tell me what is going on here? Is there some configuration to fix this?
BR Michael
I am currently playing with the SDK on Ubuntu and there are some color problems. And it goes even further, Media Express is also displaying them wrong.
So the image I was capturing is this one .
I connected my laptop hdim-out to the my desktop pc with this blackmagic grabber https://www.blackmagicdesign.com/de/products/decklink/techspecs/W-DLK-05.
However, you can see the result in the attached image. This result is shown for Media Express and SDK, code below.
Since Media Express was created by Blackmagicdesign I would expect the right result, but you can see it isn't, for some reason. So lets see my code. I basically used the "Capture" sample of the SDK. I added the openCV lib and convert the image from YUV to an openCV RGB/BGR array, which works good so far:
- Code: Select all
HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame *videoFrame,
IDeckLinkAudioInputPacket *audioFrame) {
....
void *myFrameBytes;
videoFrame->GetBytes(&myFrameBytes);
uchar *charColorPointer = (uchar *) myFrameBytes;
int size = videoFrame->GetRowBytes() * videoFrame->GetHeight();
uchar dataUYVY[size];
for (int i = 0; i < size; i++) {
dataUYVY[i] = *charColorPointer++;
}
//opencv turn UYVY array into RGB/GBR array
Mat matUYVY(height, width, CV_8UC2, dataUYVY);
Mat matBGR(height, width, CV_8UC3);
cvtColor(matUYVY, matBGR, COLOR_YUV2BGR_UYVY, 0);
imwrite("images/out.jpg", matBGR);
....
}
You can see I do it in the "VideoInputFrameArrived" function of the "Capture" sample. The translation from YUV to RGB is done by openCV, the file writer as well.
The card is telling me this values:
Capturing with the following configuration:
- Capture device: DeckLink Mini Recorder
- Video mode: 1080i60
- Pixel format: 8 bit YUV (4:2:2)
- Audio channels: 2
- Audio sample depth: 16 bit
I am using Ubuntu 18.04 and the SDK and drivers of 11.5.1 ()
Can you pls tell me what is going on here? Is there some configuration to fix this?
BR Michael
- Attachments
-
- Images shown by Media Express, as well as SDK/OpenCV
- out.jpg (169.7 KiB) Viewed 922 times