avgBitrate == 0 is used to signal a VBR track, so if that value is propagated by an encoder, don't overwrite it with a calculated value based on track size.
Part of a fix for ticket #11303. Signed-off-by: James Almer <jamr...@gmail.com> --- libavformat/movenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7563ff2628..8300f49383 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -737,6 +737,9 @@ static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track) // utilize values from properties if we have them available if (props) { + // no avg_bitrate signals that the track is VBR + if (!props->avg_bitrate) + bit_rates.avg_bit_rate = props->avg_bitrate; bit_rates.max_bit_rate = FFMAX(bit_rates.max_bit_rate, props->max_bitrate); bit_rates.buffer_size = props->buffer_size / 8; -- 2.47.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".