You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Set video bit rate to 0 if an invalid bit rate detected (which happens when using crf) (#191)
This commit is contained in:
@@ -148,6 +148,8 @@ void FFmpegWriter::SetVideoOptions(bool has_video, string codec, Fraction fps, i
|
||||
}
|
||||
if (bit_rate >= 1000) // bit_rate is the bitrate in b/s
|
||||
info.video_bit_rate = bit_rate;
|
||||
else
|
||||
info.video_bit_rate = 0;
|
||||
|
||||
info.interlaced_frame = interlaced;
|
||||
info.top_field_first = top_field_first;
|
||||
@@ -968,9 +970,12 @@ AVStream* FFmpegWriter::add_video_stream()
|
||||
#endif
|
||||
|
||||
/* Init video encoder options */
|
||||
if (info.video_bit_rate > 1000) {
|
||||
if (info.video_bit_rate >= 1000) {
|
||||
c->bit_rate = info.video_bit_rate;
|
||||
}
|
||||
else {
|
||||
c->bit_rate = 0;
|
||||
}
|
||||
|
||||
//TODO: Implement variable bitrate feature (which actually works). This implementation throws
|
||||
//invalid bitrate errors and rc buffer underflow errors, etc...
|
||||
|
||||
Reference in New Issue
Block a user