[FFmpeg-devel] [PATCH 2/2] lavd/lavfi: raise probesize if necessary.

Stefano Sabatini stefasab at gmail.com
Sun Apr 22 22:16:42 CEST 2012

On date Saturday 2012-04-21 19:42:27 +0200, Nicolas George encoded:
> Le tridi 3 floréal, an CCXX, Stefano Sabatini a écrit :
> > This is semantically problematic. Suppose the user sets the default
> > value explicitely and by chance it is the same as the default value,
> > then she may *want* to keep that value.
> I was aware of that, and I tried other solutions before that, but they soon
> became too complicated.
> My reasoning to go on with it is that the exact value of probesize does not
> matter much usually: if the user wants to stay at the default, they can
> write "-probesize 4999999" or "-probesize 5000001", the difference with the
> default will be negligible.
> > What could go wrong with a too big value?
> Probably nothing.
> > I suggest to add an option - you may call it -auto_probesize or
> > whatever you want to call it - so that it is still possible to set the
> > probesize value explicitely, when the option is on the heuristic
> > presented in this patch is applied (you can set it by default if you
> > think it would be useful to prevent the issue).
> I believe it starts being too complex for the user.
> I see two alternative solutions:
> * Set the default value of probesize to -1, and have lavf test:
>   if (probesize == -1) probesize = 5000000;
>   after read_header. Unfortunately, probesize is used in several places
>   before read_header, that makes the code more complicated.
> * Add a field to AVOption: "int *is_default": if it is not NULL,
>   av_opt_set_defaults sets it to 1 while av_opt_set sets it to 0.

Yes that was suggested various times and would be useful in other
places, but is maybe overkill in this case.
> I just thought of another option:

> * Create a new option -infoprobesize, with default value 0 meaning "use the
>   same value as -probesize or a format-specific value".

I'm not sure about what the value means when != 0. Alternatively:

auto_probesize: if 1 use a format-specific value when meaningful,
otherwise use the value specified in -probesize. Default value is 1.

auto_probesize set to 0 will force to use the probesize value
specified in the -probesize option.

That's similar to my previous suggestion, with the difference that it
would be a generic demuxer/indev option.
FFmpeg = Fancy & Freak Maxi Prodigious Eager Game

More information about the ffmpeg-devel mailing list