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

Stefano Sabatini stefano.sabatini-lala
Thu Apr 19 17:52:55 CEST 2007

On date Thursday 2007-04-19 10:38:18 +0200, Benoit Fouet encoded:
> Hi,
> Stefano Sabatini wrote:
> > On date Wednesday 2007-04-18 09:15:00 +0200, Benoit Fouet encoded:
> >   
> >> isn't it also possible to keep vstats option, and internally call
> >> opt_vstats_file with the right filename ?
> >> that way, we keep what exists and offer a new option...
> >> any thoughts ?
> >>     
> > [...]
> >
> > Anyway I find confusing to have two different options for this (rather
> > than having two ways to do a thing, it's better to keep just one
> > method, the more general), and the above solution isn't completely
> > safe (-vstats_file generic-filename -vstats will print to
> > generic-filename rather than to the vstats_HHMMSS.log file).
> >
> >   
> this will just allow to keep what exists.
> the behavior when -vstats and -vstats_file are used in the same command
> line could be a warning, an exit, ...
> anyway, i thought about something like the attached patch.
> thoughts ?

In this case:
ffmpeg <other options> -vstats_file foo -vstats_file bar -vstats

it will print to the first defined file (which isn't the expected
behaviour for most users).

A possible solution is showed in the attached patch. In this case the
vstats_filename plays the role of the global var, while the fvstats is
defined in the do_video_stats scope, and is opened the first time
do_video_stats is executed.  

The various opt_vstats_file and opt_vstats simply change the value of
the global vstats_filename.

A warning message like this:
Warning: redefining the already defined vstats file from "foo" to "bar"
Warning: redefining the already defined vstats file from "bar" to "vstats_174600.log"

is issued when redefining the vstats filename.

Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vstats_file.patch
Type: text/x-diff
Size: 4508 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070419/2941b9e2/attachment.patch>

More information about the ffmpeg-devel mailing list