aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-14 09:38:36 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-14 14:15:41 +0200
commit8d03ca085f7d355f4c7b3bcc1fd9de488e73e739 (patch)
treecaee1766d67c5a84e5e79afffb28efd3e3e1e15c /ffmpeg.c
parentd0fcf39f0c6201c8cce439395eee051798c0a958 (diff)
downloadffmpeg-8d03ca085f7d355f4c7b3bcc1fd9de488e73e739.tar.gz
ffmpeg: print the low bitrate warning after the codec is openend.
This doesn't access avcodec_opts, so it works with the new options passing system. Makes opt_bitrate() unneeded, so it's removed.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 5446be9ca4..dcc92ac481 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2349,6 +2349,9 @@ static int transcode(AVFormatContext **output_files,
}
assert_codec_experimental(ost->st->codec, 1);
assert_avoptions(ost->opts);
+ if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000)
+ av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
+ "It takes bits/s as argument, not kbits/s\n");
extra_size += ost->st->codec->extradata_size;
}
}
@@ -2790,18 +2793,6 @@ static int opt_frame_rate(const char *opt, const char *arg)
return 0;
}
-static int opt_bitrate(const char *opt, const char *arg)
-{
- int codec_type = opt[0]=='a' ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO;
-
- opt_default(opt, arg);
-
- if (av_get_int(avcodec_opts[codec_type], "b", NULL) < 1000)
- fprintf(stderr, "WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s\n");
-
- return 0;
-}
-
static int opt_frame_crop(const char *opt, const char *arg)
{
fprintf(stderr, "Option '%s' has been removed, use the crop filter instead\n", opt);
@@ -4290,8 +4281,6 @@ static const OptionDef options[] = {
{ "copyinkf", OPT_BOOL | OPT_EXPERT, {(void*)&copy_initial_nonkeyframes}, "copy initial non-keyframes" },
/* video options */
- { "b", HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
- { "vb", HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
{ "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[AVMEDIA_TYPE_VIDEO]}, "set the number of video frames to record", "number" },
{ "r", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" },
{ "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
@@ -4338,7 +4327,6 @@ static const OptionDef options[] = {
{ "force_key_frames", OPT_STRING | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void *)&forced_key_frames}, "force key frames at specified timestamps", "timestamps" },
/* audio options */
- { "ab", HAS_ARG | OPT_AUDIO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
{ "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[AVMEDIA_TYPE_AUDIO]}, "set the number of audio frames to record", "number" },
{ "aq", OPT_FLOAT | HAS_ARG | OPT_AUDIO, {(void*)&audio_qscale}, "set audio quality (codec-specific)", "quality", },
{ "ar", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_rate}, "set audio sampling rate (in Hz)", "rate" },