FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
582 stars 105 forks source link

changing probesize and analyzeduration #196

Closed ScottDillman closed 9 years ago

ScottDillman commented 9 years ago

Is it possible to set probesize and analyzeduration when creating an indexer? Looking at CreateIndexer in indexing.cpp I see that avformat_open_input is being passed a NULL for the AVDictionary* , should that be parametized or am I going about this all wrong? I just started working with ffms2 so I might be missing something.. thanks..

tgoyne commented 9 years ago

That's the sort of thing that ffms2 tries to save the user from having to care about. Do you have a sample that needs higher than default values? I suspect we could significantly increase them without bad things happening due to that we're going to be reading the whole file for indexing afterwards anyway.

On Mar 13, 2015, at 08:21, c.trauma notifications@github.com wrote:

Is it possible to set probesize and analyzeduration when creating an indexer? Looking at CreateIndexer in indexing.cpp I see that avformat_open_input is being passed a NULL for the AVDictionary* , should that be parametized or am I going about this all wrong? I just started working with ffms2 so I might be missing something.. thanks..

— Reply to this email directly or view it on GitHub.

ScottDillman commented 9 years ago

Yea I appreciate how much ffms2 handles out of the box..

I have run into examples before where libav spits out:

"Consider increasing the value for the 'analyzeduration' and 'probesize' options"

Since I'm binding a lot of these calls in a scripting language I'm paying attention to what can and cannot be set, and I was looking to add a setProbeSize() method in my script and couldn't deduce how to parameterize it in ffms2.

If I find a sample that needs higher values I'll comment on this issue..

Would it be worth having a FFMS_Dictionary struct wrapping AVDictionary that could be passed to the indexer constructor that dufaults to NULL to pick up the default?

dwbuiten commented 9 years ago

That would break ABI and API.

Theoretically, the ways that would "best" fit FFMS2's model is to either:

  1. Register an av_log callback and keep and eye out for that particular warning and try and increase as necessary. This would entail calling av_log_set_level during probe to temporarily override the user's setting. This is hideous, of course. The upshot being that at this moment, Libav are working on making log callbacks per-context, so it's... kinda feasible. But still super, super ugly.
  2. Add something like FFMS_SetProbeSize(FFMS_Indexer *Indexer, uint64_t size). Less ugly, but more cumbersome to the API user.

I'm sure @tgoyne has either a better idea or better opinion on this than I.

ScottDillman commented 9 years ago

Good points...

myrsloik commented 9 years ago

What kinds of files need it to be increased anyway?

myrsloik commented 9 years ago

No examples provided, closed.