[FFmpeg-user] sws_scale and alpha channel

Maksym Veremeyenko verem at m1stereo.tv
Wed Feb 15 13:18:46 CET 2012


Hi,

i am trying to extract an alpha channel plane from frame in 
PIX_FMT_YUVA420P or PIX_FMT_BGRA pixel format but has no luck.

i tried to convert to PIX_FMT_YUYV422 with additional plane for alpha 
channel:

     struct SwsContext *context = sws_getContext(
         width, height, pix_fmt, width, height,
         PIX_FMT_YUYV422, 0, NULL, NULL, NULL);

     AVPicture output;
     avpicture_fill( &output, buffer, PIX_FMT_YUYV422, width, height );
     output.data[3] = alpha;
     output.linesize[3] = width;

     sws_scale( context, frame->data, frame->linesize, 0,
         height, output.data, output.linesize);

     sws_freeContext( context );

but buffer for alpha did not changed.

should i use *PIX_FMT_YUVA444P* with only alpha plane buffer seted to 
extract alpha channel only?

-- 
________________________________________
Maksym Veremeyenko


More information about the ffmpeg-user mailing list