FORUMS: list search recent posts

BlackMagic Decklink and SDK questions

COW Forums : Blackmagic Design

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Pete Black
BlackMagic Decklink and SDK questions
on Jul 22, 2011 at 10:48:40 pm

Hi, I'm currently using a Blackmagic Decklink card to do capture from HD-SDI, for display in a realtime presentation system. on OS X.

I have working code integrated into a Cocoa app that initialises the device, grabs frames, and does YUV to RGB conversion in GLSL with good performance so I understand the basics pretty well, however I have a few questions:

I am currently not using the ScreenPreview callbacks - i need to texture map my video frames onto geometry set up in an existing 3d engine, so i fetch captured buffers directly from the main input callback and use GLSL to convert the YUV422 into RGB. Presumably the ScreenPreview PaintGL stuff results in an RGB texture on the GPU, but does it involve software YUV-> RGB conversion?

I am a little unclear on the behaviour of the API with interlaced inputs (e.g. 1080i50) - when I get a frame callback, am I receiving a full size buffer with alternate lines blanked out, or is the blackmagic hardware performing deinterlace for me? The frame width/height in the arrivedFrame indicates a full frame size.

Is it possible to have the Decklink hardware perform hardware YUV to RGB conversion? Any software YUV to RGB is a major bottleneck for my app, as i need to decode and display several streams (live input and from movies on disk via ffmpeg) in realtime. Doing this on the GPU gives me good performance however.

Is it possible to have the Decklink hardware supply planar YUV data instead of interleaved? e.g. an arrivedFrame would contain a Y buffer, a U buffer and a V buffer?



Return to posts index

Ben Snooks
Re: BlackMagic Decklink and SDK questions
on Nov 27, 2012 at 1:28:06 am


Did you find a solution to your problem? I am experiencing a similar problem. I have developed a program that draws video to an opengl texture based on teh example code provided by BlackMagic Design. I have a problem of receiving interlaced video when using the example glsl shader. I have tried to modify the shader to do deinterlacing but have run into problem iterating through the lines of the texture.

Below is an example of what I am trying to get to wok combined with the YUVtoRGB shader:

void main()
/* Get default texel read position (s,t): s is column, t is row of image. */
vec2 readpos = gl_TexCoord[0].st;
if (bool(mod(floor(readpos.t + UseOddField), 2.0))) {
/* This row is to be replaced by the average of its neighbour rows: */
gl_FragColor = 0.5*(texture2DRect(Image1, readpos - vec2(0.0, 1.0)) + texture2DRect(Image1, readpos + vec2(0.0, 1.0)));
else {
/* This row is to be used: */
gl_FragColor = texture2DRect(Image1, readpos);

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved