diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 12:18:55 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 12:28:36 +0300 |
commit | 43b7512a59c2c4400ab7ccb5783efa707bfa2148 (patch) | |
tree | c16b7b6972eb7233c410823337de936ce279c749 | |
parent | 631d5026c7bb34320c5d9b60afa5bc44b40fc5e4 (diff) |
FFmpeg: Added support for writing alpha values in WebM/VP9 video
The VP9 video codec supports writing alpha values; now this is available
in Blender too.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5156
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 0d4182ff24d..fcd00837f4f 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -701,6 +701,12 @@ static AVStream *alloc_video_stream(FFMpegContext *context, c->pix_fmt = AV_PIX_FMT_ARGB; } + if (codec_id == AV_CODEC_ID_VP9) { + if (rd->im_format.planes == R_IMF_PLANES_RGBA) { + c->pix_fmt = AV_PIX_FMT_YUVA420P; + } + } + if (codec_id == AV_CODEC_ID_PNG) { if (rd->im_format.planes == R_IMF_PLANES_RGBA) { c->pix_fmt = AV_PIX_FMT_RGBA; @@ -1838,6 +1844,7 @@ bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd) return ELEM(codec, AV_CODEC_ID_QTRLE, AV_CODEC_ID_PNG, + AV_CODEC_ID_VP9, # ifdef FFMPEG_FFV1_ALPHA_SUPPORTED AV_CODEC_ID_FFV1, # endif |