diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2007-11-04 02:03:36 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2007-11-04 02:03:36 +0000 |
commit | 1b1656c67f7a12db6bb972cef0c063f2a317f684 (patch) | |
tree | 246b8798c4d691fa1e21b964be161a176cc80e70 /ffmpeg.c | |
parent | 46a845d06ee5053d8df5608e743da7e102415fbc (diff) | |
download | ffmpeg-1b1656c67f7a12db6bb972cef0c063f2a317f684.tar.gz |
Warn user if bitrate parameter is too low
Originally committed as revision 10919 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2159,6 +2159,16 @@ static void opt_frame_rate(const char *arg) } } +static void opt_bitrate(const char *opt, const char *arg) +{ + int codec_type = opt[0]=='a' ? CODEC_TYPE_AUDIO : CODEC_TYPE_VIDEO; + + opt_default(opt, arg); + + if (av_get_int(avctx_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"); +} + static void opt_frame_crop_top(const char *arg) { frame_topBand = atoi(arg); @@ -3688,6 +3698,8 @@ const OptionDef options[] = { { "programid", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&opt_programid}, "desired program number", "" }, /* video options */ + { "b", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "" }, + { "vb", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "" }, { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[CODEC_TYPE_VIDEO]}, "set the number of video frames to record", "number" }, { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[CODEC_TYPE_DATA]}, "set the number of data frames to record", "number" }, { "r", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" }, @@ -3734,6 +3746,7 @@ const OptionDef options[] = { { "qphist", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, { (void *)&qp_hist }, "show QP histogram" }, /* audio options */ + { "ab", OPT_FUNC2 | HAS_ARG | OPT_AUDIO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "" }, { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[CODEC_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" }, |