Skip to content

Commit 16c3d53

Browse files
committed
Fix problem with q values for crf quality setting.
DOTO adjust q values according to desired quality
1 parent 9cde600 commit 16c3d53

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/FFmpegWriter.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,12 @@ AVStream* FFmpegWriter::add_video_stream()
11321132
/* Init video encoder options */
11331133
if (info.video_bit_rate >= 1000) {
11341134
c->bit_rate = info.video_bit_rate;
1135+
c->qmin = 2;
1136+
c->qmax = 30;
1137+
}
1138+
else {
1139+
c->qmin = 0;
1140+
c->qmax = 63;
11351141
}
11361142

11371143
//TODO: Implement variable bitrate feature (which actually works). This implementation throws
@@ -1141,8 +1147,8 @@ AVStream* FFmpegWriter::add_video_stream()
11411147
//c->rc_buffer_size = FFMAX(c->rc_max_rate, 15000000) * 112L / 15000000 * 16384;
11421148
//if ( !c->rc_initial_buffer_occupancy )
11431149
// c->rc_initial_buffer_occupancy = c->rc_buffer_size * 3/4;
1144-
c->qmin = 2;
1145-
c->qmax = 30;
1150+
// c->qmin = 2;
1151+
// c->qmax = 30;
11461152

11471153
/* resolution must be a multiple of two */
11481154
// TODO: require /2 height and width

0 commit comments

Comments
 (0)