[FFmpeg-devel] [PATCH] avformat/utils: disabled debug code to collect format probing statistics

Michael Niedermayer michaelni at gmx.at
Mon Nov 11 13:10:46 CET 2013


On Sun, Nov 10, 2013 at 12:34:26PM +0100, Stefano Sabatini wrote:
> On date Saturday 2013-11-09 20:08:55 +0100, Michael Niedermayer encoded:
> > This allows collecting statistics on probing scores and the amount of data
> > probing needed for various files and formats.
> > For example it can be used to find out which formats tend to need more
> > data for probing or which files are probed with less certain/lower scores
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/utils.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 5637d17..cc219f2 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -399,6 +399,11 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
> >                  av_log(logctx, AV_LOG_WARNING, "Format %s detected only with low score of %d, misdetection possible!\n", (*fmt)->name, score);
> >              }else
> >                  av_log(logctx, AV_LOG_DEBUG, "Format %s probed with size=%d and score=%d\n", (*fmt)->name, probe_size, score);
> > +#if 0
> 
> > +            FILE *f= fopen("probestat.tmp", "ab");
> 
> nitt: *f = ...
> 
> > +            fprintf(f, "%d, bytes format: %s, filename: %s, score: %d\n", probe_size, (*fmt)->name, filename, score);
> 
> probably more readable/parsable:
> fprintf(f, "probe_size:%d format:%s score:%d filename:%s\n", probe_size, (*fmt)->name, score, filename);
> 

fixed


> > +            fclose(f);
> > +#endif
> 
> LGTM if useful.

yes, its usefull, consider how many formats we have
if now 2mb are needed for probing then all format probe functions
will be run over this 2mb, that can be alot of CPU for a embeded
system for example, also needing alot of bytes to probe means
long latency for low bitrate network streams.

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131111/8d57d462/attachment.asc>


More information about the ffmpeg-devel mailing list