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

Benoit Fouet benoit.fouet
Wed Apr 18 09:15:00 CEST 2007


Hi,

Stefano Sabatini wrote:

[snip]
> Hope this is OK.
>
> Cheers
>   
> ------------------------------------------------------------------------
>
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 8745)
> +++ ffmpeg.c	(working copy)
>   
[snip]
> @@ -3449,6 +3432,15 @@
>      }
>  }
>  
> +static void opt_vstats_file (const char *arg)
> +{
> +    vstats_file = fopen(arg ,"w");
> +    if (!vstats_file) {
>   
you surely meant fvstats, no ?
this code won't even compile.

> +        perror("fopen");
> +        exit(1);
> +    }
> +}
> +
>  static void opt_video_bsf(const char *arg)
>  {
>      AVBitStreamFilterContext *bsfc= av_bitstream_filter_init(arg); //FIXME split name and args for filter at '='
> @@ -3610,7 +3602,7 @@
>      { "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace},
>        "deinterlace pictures" },
>      { "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" },
> -    { "vstats", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_vstats}, "dump video coding statistics to file" },
> +    { "vstats_file", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_vstats_file}, "dump video coding statistics to file", "file" },
>   
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 ?

Ben





More information about the ffmpeg-devel mailing list