diff options
author | Bill Eldridge <bill@rfa.org> | 2003-09-03 12:13:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-09-03 12:13:43 +0000 |
commit | f068206ed3240715125f143df81d66a44f58a791 (patch) | |
tree | f9d036975ae9b7356459624fbfd4dd3f61c11fc8 | |
parent | 3633ada54620154a7535772a0724d86a866caedf (diff) | |
download | ffmpeg-f068206ed3240715125f143df81d66a44f58a791.tar.gz |
quiet/verbose patch by (Bill Eldridge <bill at rfa dot org>)
Originally committed as revision 2200 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffmpeg.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -163,6 +163,7 @@ static char *audio_grab_format = "audio_device"; static char *audio_device = NULL; static int using_stdin = 0; +static int verbose = 1; #define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass" @@ -724,20 +725,20 @@ static void print_report(AVFormatContext **output_files, } if (ti1 < 0.01) ti1 = 0.01; - bitrate = (double)(total_size * 8) / ti1 / 1000.0; - sprintf(buf + strlen(buf), + if (verbose || is_last_report) { + bitrate = (double)(total_size * 8) / ti1 / 1000.0; + + sprintf(buf + strlen(buf), "size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s", (double)total_size / 1024, ti1, bitrate); - - fprintf(stderr, "%s ", buf); - - if (is_last_report) { - fprintf(stderr, "\n"); - } else { - fprintf(stderr, "\r"); + + fprintf(stderr, "%s \r", buf); fflush(stderr); } + + if (is_last_report) + fprintf(stderr, "\n"); } /* @@ -1596,6 +1597,11 @@ static void opt_debug(const char *arg) debug = atoi(arg); } +static void opt_verbose(const char *arg) +{ + verbose = atoi(arg); +} + static void opt_frame_rate(const char *arg) { if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) { @@ -2633,6 +2639,7 @@ const OptionDef options[] = { { "bitexact", OPT_EXPERT, {(void*)opt_bitexact}, "only use bit exact algorithms (for codec testing)" }, { "re", OPT_BOOL | OPT_EXPERT, {(void*)&rate_emu}, "read input at native frame rate", "" }, { "loop", OPT_BOOL | OPT_EXPERT, {(void*)&loop_input}, "loop (current only works with images)" }, + { "v", HAS_ARG, {(void*)opt_verbose}, "control amount of logging", "verbose" }, /* video options */ { "b", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate}, "set video bitrate (in kbit/s)", "bitrate" }, |