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

Benoit Fouet benoit.fouet
Thu Apr 19 10:38:18 CEST 2007


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 ?
>>     
>
> It would be possible keeping the old option and the global flag
> do_vstats, setting in opt_vstats_file the flag do_vstats to 1, then
> putting in do_video_stats:
>
> if (!fvstats && do_vstats) {
>     \\ do_vstats is setted but not the file where to put the video_stats
>     \\ open vstats_HHMMSS.log and get the fvstats file handler point to it 
>     char filename[40];
>     time_t today2;
>     struct tm *today;
>
>     today2 = time(NULL);
>     today = localtime(&today2);
>     snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour,
>     today->tm_min,
>     today->tm_sec);
>    
>     fvstats = fopen(filename,"w");
>     if (!fvstats) {
>         perror("fopen");
>         exit(1);
>     }
> }
>
> ...
>
> 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 ?

Ben

-- 
Purple Labs S.A.
www.purplelabs.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vstats_file.patch
Type: text/x-patch
Size: 4235 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070419/1e34355d/attachment.bin>



More information about the ffmpeg-devel mailing list