Fix T42997: Support RGBA output for HuffYUV

More like a feature request but was simple to support.
This commit is contained in:
Sergey Sharybin 2014-12-24 18:54:38 +05:00
parent 0fcf9b2672
commit 607c45ae6b
Notes: blender-bot 2023-02-14 11:42:40 +01:00
Referenced by issue #42997, Clearer Alpha Video Output
1 changed files with 12 additions and 2 deletions

View File

@ -598,8 +598,12 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
/* Keep lossless encodes in the RGB domain. */
if (codec_id == AV_CODEC_ID_HUFFYUV) {
/* HUFFYUV was PIX_FMT_YUV422P before */
c->pix_fmt = PIX_FMT_RGB32;
if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
c->pix_fmt = PIX_FMT_BGRA;
}
else {
c->pix_fmt = PIX_FMT_RGB32;
}
}
if (codec_id == AV_CODEC_ID_FFV1) {
@ -1628,6 +1632,12 @@ bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd)
if (codec == AV_CODEC_ID_PNG)
return true;
if (codec == AV_CODEC_ID_PNG)
return true;
if (codec == AV_CODEC_ID_HUFFYUV)
return true;
#ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
if (codec == AV_CODEC_ID_FFV1)
return true;