Originally committed as revision 2200 to svn://svn.ffmpeg.org/ffmpeg/trunk
static char *audio_device = NULL;
static int using_stdin = 0;
static char *audio_device = NULL;
static int using_stdin = 0;
#define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass"
#define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass"
}
if (ti1 < 0.01)
ti1 = 0.01;
}
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);
"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);
+
+ if (is_last_report)
+ fprintf(stderr, "\n");
+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) {
static void opt_frame_rate(const char *arg)
{
if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) {
{ "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)" },
{ "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" },
/* video options */
{ "b", HAS_ARG | OPT_VIDEO, {(void*)opt_video_bitrate}, "set video bitrate (in kbit/s)", "bitrate" },