Commit 628a73f8 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: force 128k default audio bitrate if nothing is specified and there is no specific default

This prevents breaking existing command lines in case the "ab" default is removed from libavcodec
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 777df1ff
......@@ -2604,6 +2604,11 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
if (!av_dict_get(ost->encoder_opts, "threads", NULL, 0))
av_dict_set(&ost->encoder_opts, "threads", "auto", 0);
av_dict_set(&ost->encoder_opts, "side_data_only_packets", "1", 0);
if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
!codec->defaults &&
!av_dict_get(ost->encoder_opts, "b", NULL, 0) &&
!av_dict_get(ost->encoder_opts, "ab", NULL, 0))
av_dict_set(&ost->encoder_opts, "b", "128000", 0);
if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
if (ret == AVERROR_EXPERIMENTAL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment