[Ffmpeg-devel] Changing "-vstats" option behaviour

Stefano Sabatini stefano.sabatini-lala
Mon Apr 16 15:49:36 CEST 2007


Hi to all FFmpeg devs.

I'm setting up a testing framework for ffmpeg/libavcodec. I'm encoding
streams using different parameters, dumping the output in the vstats
file using the -vstats option.

Actually the vstats filename is automatically detected, and precisely
its format is defined by the following snippet in ffmpeg.c:

snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour,
                                               today->tm_min,
                                               today->tm_sec);

I would like to change the behaviour of the -vstats option to let the
user specify the name of the outputted filename. For example it could
work like this:

ffmpeg ... -vstats vstats_test1.log

In this way I could automatically do a report of the vstats file just
as the encoding ends without the need to guess the vstats filename.

This could be easily been performed changing:

{ "vstats", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_vstats}, "dump video coding statistics to file" },

to:

{ "vstats", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&do_vstats}, "dump video coding statistics to file" },
            ^^^^^^^
and changing few things in do_vstats.

Alternatively we could support a format syntax for the -vstats
argument, that could support %<single char> parameters a la printf
patterns, and that could be for example:

%H (2 digit hour number)
%M (2 digit minute number)
%S (2 digit seconds number)
%s (seconds since epoch)
%Y (4 digit year number) 
%y (2 digit year number) 
%m (2 digit month number)
%d (2 digit day number)
%p (pid of the process)

and so on (where time parameters have the same meaning as for the date
unix command).

Cheers
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)




More information about the ffmpeg-devel mailing list