diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-02-01 02:00:29 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-02-01 02:00:29 +0300 |
commit | f420118335e4a3c81f7a50eb08c9da8765d451e3 (patch) | |
tree | 4677c896b97309e6ee82aa192fd6b61043969d9b /source/blender/blenkernel/intern | |
parent | 68c2650b03f417fd48bcc0f682fcc71a2a4c9c81 (diff) |
Fix T93856: VP9 lossless render missing alpha
Since 0ea0ccc4ffd5, `AV_PIX_FMT_YUV444P` pixel format was used for
lossless renders, which did override `AV_PIX_FMT_YUVA420P` format when
"RGBA" output is chosen. VP9 encoder doesn't seem to support
`AV_PIX_FMT_YUVA444P` pixel format, so use `AV_PIX_FMT_YUVA420P` for
lossless RGBA ouput instead.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D13947
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 4d94132e6fd..9effeb831b6 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -726,14 +726,12 @@ static AVStream *alloc_video_stream(FFMpegContext *context, } } - 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_VP9 && rd->im_format.planes == R_IMF_PLANES_RGBA) { + c->pix_fmt = AV_PIX_FMT_YUVA420P; } - - /* Use 4:4:4 instead of 4:2:0 pixel format for lossless rendering. */ - if ((codec_id == AV_CODEC_ID_H264 || codec_id == AV_CODEC_ID_VP9) && context->ffmpeg_crf == 0) { + else if ((codec_id == AV_CODEC_ID_H264 || codec_id == AV_CODEC_ID_VP9) && + context->ffmpeg_crf == 0) { + /* Use 4:4:4 instead of 4:2:0 pixel format for lossless rendering. */ c->pix_fmt = AV_PIX_FMT_YUV444P; } |