Patch #34569: Enable PNG Codec for video output
[blender.git] / source / blender / blenkernel / intern / writeffmpeg.c
index 2cf7a96..af8b32a 100644 (file)
@@ -551,6 +551,12 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
                }
        }
 
+       if (codec_id == CODEC_ID_PNG) {
+               if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
+                       c->pix_fmt = PIX_FMT_ARGB;
+               }
+       }
+
        if ((of->oformat->flags & AVFMT_GLOBALHEADER)
 //             || !strcmp(of->oformat->name, "mp4")
 //         || !strcmp(of->oformat->name, "mov")
@@ -1493,6 +1499,9 @@ int BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd)
        if (codec == CODEC_ID_QTRLE)
                return TRUE;
 
+       if (codec == CODEC_ID_PNG)
+               return TRUE;
+
 #ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
        if (codec == CODEC_ID_FFV1)
                return TRUE;