From c7035f6c347423dc0a13ca5e72a002448758f87e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 23 Jul 2020 19:37:54 -0700 Subject: [PATCH] FFmpeg: Add ZMBV specialization --- src/feature/ffmpeg/ffmpeg-encoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index fc2896d41..9752971d4 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -402,6 +402,12 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { if (encoder->video->codec->id == AV_CODEC_ID_PNG) { encoder->video->compression_level = 8; } +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 48, 100) + if (encoder->video->codec->id == AV_CODEC_ID_ZMBV) { + encoder->video->compression_level = 5; + encoder->video->pix_fmt = AV_PIX_FMT_BGR0; + } +#endif if (strcmp(vcodec->name, "libx264") == 0) { // Try to adaptively figure out when you can use a slower encoder if (encoder->width * encoder->height > 1000000) {