- Posts: 3
- Joined: Thu Nov 24, 2016 2:46 pm
Just filling in the blanks for anyone who may have joined this thread and not seen our message on the CasparCG GitHub discussion, it does look like my understanding of the docs may be wrong and that even with the newer SDK (10.11.x), you still need to have the same pixel format for active picture as for ancillary data (and that'll have to be 10-bit YUV).
I was reading up on this last July, and may have got the wrong end of the stick. Sadly, I can no longer even remember my sources to try and offload the blame elsewhere!
Some reading and re-reading might indicate that the 4k DeckLink cards are capable of this (handling distinct pixel formats for active picture and VANC), but it wasn't totally clear to me if this was for both capture/input and replay/output.
There is one thing that you should try though: I've just tested the IDeckLinkVideoConversion::ConvertFrame() method and this did work. I tried going from 8-bit BGRA to 10-bit YUV, and it was fine. I'd assume that 8-bit YUV -> 10-bit YUV is simpler still (from a CPU/processing point-of-view; code is probably not much harder either way).
What worked for me (SDK 10.4):-
You'll need to call
- Code: Select all
CoCreateInstance(CLSID_CDeckLinkVideoConversion, NULL, CLSCTX_ALL, IID_IDeckLinkVideoConversion, (void**)&deckLinkVideoConverter);
When creating video frames, create two (different params):-
- Code: Select all
deckLinkOutput->CreateVideoFrame(kFrameWidth, kFrameHeight, itmRowBytes, itmPixelFormat, bmdFrameFlagDefault, &interimFrame);
- Code: Select all
deckLinkOutput->CreateVideoFrame(kFrameWidth, kFrameHeight, kRowBytes, kPixelFormat, bmdFrameFlagDefault, &convertedFrame);
Fill your interim frame
Convert:
- Code: Select all
deckLinkVideoConversion->ConvertFrame(interimFrame, convertedFrame);
You're done with the interim frame, so do release it!
- Code: Select all
interimFrame->Release();
Appreciate this code is very shorthand, but hopefully you get the gist.
I don't know how much extra CPU this requires. Also, it might be worth checking that there aren't any colourspace-conversion issues.
Good luck!