[FFmpeg-devel] [PATCH] avcodec: add Mandsoft Screen Capture Codec decoder

Paul B Mahol onemda at gmail.com
Sat Apr 15 18:59:00 EEST 2017

On 4/15/17, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2017-04-15 13:49 GMT+02:00 Paul B Mahol <onemda at gmail.com>:
>> +    case 32: avctx->pix_fmt = AV_PIX_FMT_BGRA;   break;
> (I am thankful for this patch and, yes, I believe we had this
> discussion before.)
> If this is a screen capture codec, I believe BGR0 is the correct
> colorspace. I understand that you tested that the encoder can
> really encode transparency but the issue - imo - is, that if the
> codec is (or actually was) used to record 32bit Windows screens
> then some parts of the screen will contain "0xff" as alpha value
> and others (sprites?) will contain "0x00" producing funny output
> if you just transcode to png.
> In the past, I also put BGRA there (for some other codec) and
> it was fixed after another developer tested the same sample I
> had tested but (correctly!) explained that the output (that I
> considered useful originally) makes no sense and the
> colorspace (or actually the transparency in the output file) is
> wrong.
> (If this is not a screen capture codec, BGRA is of course
> most likely correct.)
> Please don't let this stop you!

Using bgr0 when there is already valid transparency is bad as
that will kill it, on other side if its bgra like it is now
one can just ignore alpha component if its not interesting.

More information about the ffmpeg-devel mailing list