[FFmpeg-devel] adding RGBA and BGRA to nvenc.c

Timo Rothenpieler timo at rothenpieler.org
Wed Sep 7 11:23:17 EEST 2016


>              avctx->width << 1, avctx->height);
> +    } else if (frame->format == AV_PIX_FMT_RGBA || frame->format ==
> AV_PIX_FMT_RGB0) {
> +      av_image_copy_plane(buf, lockBufferParams->pitch,
> +           frame->data[0], frame->linesize[0],
> +           avctx->width << 2, avctx->height);
> +    } else if (frame->format == AV_PIX_FMT_BGRA || frame->format ==
> AV_PIX_FMT_BGR0) {
> +      av_image_copy_plane(buf, lockBufferParams->pitch,
> +           frame->data[0], frame->linesize[0],
> +           avctx->width << 2, avctx->height);
>      } else {

These are identical, so please put them into one if.

Also, why is the twist from AV_PIX_FMT_RGBA to NV_ENC_BUFFER_FORMAT_ABGR
necessary?

The nvenc header describes it as "8 bit Packed A8B8G8R8", so did they
mess it up?


More information about the ffmpeg-devel mailing list