[FFmpeg-devel] [PATCH 3/3] avdevice/decklink: Add support for decoding 8-bit RGB formats.

Reuben Martin reuben.m at gmail.com
Mon Jul 20 18:41:14 CEST 2015


On Sunday, July 19, 2015 02:50:23 PM Chris Spencer wrote:
> On 19 July 2015 at 14:30, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > Chris Spencer <spencercw <at> gmail.com> writes:
> >> > > +    } else if (cctx->pixel_format == AV_PIX_FMT_ARGB) {
> >> > > +        ctx->bmd_format = bmdFormat8BitARGB;
> >> > > +    } else if (cctx->pixel_format == AV_PIX_FMT_BGRA) {
> >> > > +        ctx->bmd_format = bmdFormat8BitBGRA;
> >> > > 
> >> > > +    } else if (ctx->bmd_format == bmdFormat8BitARGB) {
> >> > > +        st->codec->codec_id    = AV_CODEC_ID_RAWVIDEO;
> >> > > +        st->codec->pix_fmt     = AV_PIX_FMT_ARGB;
> >> > > +        st->codec->codec_tag   = MKTAG('A', 'R', 'G', 'B');
> >> > > +    } else if (ctx->bmd_format == bmdFormat8BitBGRA) {
> >> > > +        st->codec->codec_id    = AV_CODEC_ID_RAWVIDEO;
> >> > > +        st->codec->pix_fmt     = AV_PIX_FMT_BGRA;
> >> > > +        st->codec->codec_tag   = MKTAG('B', 'G', 'R', 'A');
> >> > 
> >> > I would have expected these to be AV_PIX_FMT_0RGB and
> >> > AV_PIX_FMT_BGR0.
> >> 
> >> The Blackmagic documentation is kind of strange on this
> >> one actually. For bmdFormat8BitBGRA it says "alpha
> >> channel is valid". For bmdFormat8BitBGRA it says "alpha
> >> channel may be valid". Not sure how best to deal with
> >> that to be honest.
> > 
> > Can you test?
> > Is there a theoretical possibility that the content
> > contains valid alpha? If yes, please use ARGB.
> > If not and if you can confirm that the alpha channel
> > is correctly set to 0xFF, then you may use ARGB but I
> > wonder what the usecase would be (and how probable it
> > is that a future driver would not set it to 0xFF).
> > The codec_tag looks wrong to me because it would be
> > 0x00 for AV_PIX_FMT_ARGB and AV_PIX_FMT_BGRA. I think
> > it should only be set if needed (for YV12 or similar).
> 
> Ok so with the HDMI input connected to my graphics card the alpha
> channel is zero with both ARGB and BGRA (which explains why I couldn't
> get the overlay filter to work with it now that I think about it). I
> will add bgr0 and 0rgb, but I wonder if it's worth leaving bgra and
> argb in, as the Blackmagic documentation seems to imply the alpha
> channel might be present in some situation.
> 
Alpha channel is valid in the SDI spec, although not widely supported. Perhaps 
this can be used in the SDI output from decklink “extream” models that offer 
separate sync locked outputs for key and fill? I have access to such a card if 
you would want that tested.

-Reuben



More information about the ffmpeg-devel mailing list