Hello,

For about a month now, I've been trying to play a video in a LCD TV through
a Blackmagic card on a video Component input, I decided to use ffmpeg to
extract the frames and put into the buffer of the card. All I can do right
now is play the video in b&w.

I followed the tutorial 1 that is in the web (
http://www.dranger.com/ffmpeg/tutorial01.html), changing the img_convert
function to the sws_scale.

img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height,
PIX_FMT_RGB32, pCodecCtx->width, pCodecCtx->height, PIX_FMT_RGB32,
SWS_BILINEAR, NULL, NULL, 0);

sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0,
pCodecCtx->height, pFrameRGB->data, FrameRGB->linesize);
.
.
.
for(int h = 0; h < height; h++){
   for(int w = 0; w<width*3; w++){
      int index = h * width + w;
      aux = (unsigned int) pFrameRGB->data[0][index];
      aux2 = aux;
      nextWord[index]     =((255<< 24) | (aux2 << 16) | (aux2 << 8) | aux2);

I'm doing this to put the frame into the Blackmagic buffer (unsigned int*
nextWord).

The Blackmagic card uses an 8BitBGRA pixel format. From the Blackmagic API
manual:
"bmdFormat8BitBGRA : BGRA (or RGB32) 4:4:4:x raw
Four 8-bit unsigned components are packed into one 32-bit little-endian
word.
The alpha channel may be valid."

Hope somebody can help me.

Thanks in advance.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to