提交 f068206e 编写于 作者: B Bill Eldridge 提交者: Michael Niedermayer

quiet/verbose patch by (Bill Eldridge <bill at rfa dot org>)

Originally committed as revision 2200 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 3633ada5
...@@ -163,6 +163,7 @@ static char *audio_grab_format = "audio_device"; ...@@ -163,6 +163,7 @@ static char *audio_grab_format = "audio_device";
static char *audio_device = NULL; static char *audio_device = NULL;
static int using_stdin = 0; static int using_stdin = 0;
static int verbose = 1;
#define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass" #define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass"
...@@ -724,20 +725,20 @@ static void print_report(AVFormatContext **output_files, ...@@ -724,20 +725,20 @@ static void print_report(AVFormatContext **output_files,
} }
if (ti1 < 0.01) if (ti1 < 0.01)
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", "size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",
(double)total_size / 1024, ti1, bitrate); (double)total_size / 1024, ti1, bitrate);
fprintf(stderr, "%s ", buf); fprintf(stderr, "%s \r", buf);
if (is_last_report) {
fprintf(stderr, "\n");
} else {
fprintf(stderr, "\r");
fflush(stderr); fflush(stderr);
} }
if (is_last_report)
fprintf(stderr, "\n");
} }
/* /*
...@@ -1596,6 +1597,11 @@ static void opt_debug(const char *arg) ...@@ -1596,6 +1597,11 @@ static void opt_debug(const char *arg)
debug = atoi(arg); debug = atoi(arg);
} }
static void opt_verbose(const char *arg)
{
verbose = atoi(arg);
}
static void opt_frame_rate(const char *arg) static void opt_frame_rate(const char *arg)
{ {
if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) { if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) {
...@@ -2633,6 +2639,7 @@ const OptionDef options[] = { ...@@ -2633,6 +2639,7 @@ const OptionDef options[] = {
{ "bitexact", OPT_EXPERT, {(void*)opt_bitexact}, "only use bit exact algorithms (for codec testing)" }, { "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", "" }, { "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)" }, { "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 */ /* video options */
{ "b", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate}, "set video bitrate (in kbit/s)", "bitrate" }, { "b", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate}, "set video bitrate (in kbit/s)", "bitrate" },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册