From b5ebc996eefde4aace92bf287a8a3297488cdd75 Mon Sep 17 00:00:00 2001 From: eisneinechse <42617957+eisneinechse@users.noreply.github.com> Date: Sun, 10 Mar 2019 10:42:48 -0700 Subject: [PATCH] Adjust the q values for low quality crf settings --- src/FFmpegWriter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index cf4004c4..b1eb7ec3 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -1140,8 +1140,14 @@ AVStream* FFmpegWriter::add_video_stream() // Defaults are used because mpeg2 otherwise had problems } else { - c->qmin = 0; - c->qmax = 63; + if (info.video_bit_rate < 40) { + c->qmin = 0; + c->qmax = 63; + } + else { + c->qmin = info.video_bit_rate - 5; + c->qmax = 63; + } } //TODO: Implement variable bitrate feature (which actually works). This implementation throws