From 607c45ae6b8ecf0b4ce5278f4fbecb575efcb308 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 24 Dec 2014 18:54:38 +0500 Subject: Fix T42997: Support RGBA output for HuffYUV More like a feature request but was simple to support. --- source/blender/blenkernel/intern/writeffmpeg.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/writeffmpeg.c') diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index d4f5da2e36f..9737ef429cb 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -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; -- cgit v1.2.3