Invalid SetMaxSize Logic and Invalid CRF q settings in FFmpegWriter (#198)

* Limit max size of preview to the timeline size (this renders very small profiles correctly)

* Fixing CRF quality setting to allow "low" quality without breaking
This commit is contained in:
Jonathan Thomas
2019-03-09 13:19:07 -06:00
committed by GitHub
parent 8f385c112a
commit 3f17601db6
2 changed files with 13 additions and 5 deletions

View File

@@ -995,6 +995,16 @@ AVStream* FFmpegWriter::add_video_stream()
/* Init video encoder options */
if (info.video_bit_rate >= 1000) {
c->bit_rate = info.video_bit_rate;
if (info.video_bit_rate >= 1500000) {
c->qmin = 2;
c->qmax = 30;
}
// Here should be the setting for low fixed bitrate
// Defaults are used because mpeg2 otherwise had problems
}
else {
c->qmin = 0;
c->qmax = 63;
}
//TODO: Implement variable bitrate feature (which actually works). This implementation throws
@@ -1004,8 +1014,6 @@ AVStream* FFmpegWriter::add_video_stream()
//c->rc_buffer_size = FFMAX(c->rc_max_rate, 15000000) * 112L / 15000000 * 16384;
//if ( !c->rc_initial_buffer_occupancy )
// c->rc_initial_buffer_occupancy = c->rc_buffer_size * 3/4;
c->qmin = 2;
c->qmax = 30;
/* resolution must be a multiple of two */
// TODO: require /2 height and width