[FFmpeg-devel] [PATCH] When PMT is found, we have found mpegts header information

Joakim Plate elupus
Mon Apr 19 14:07:56 CEST 2010


Baptiste Coudurier <baptiste.coudurier <at> gmail.com> writes:

> >
> > My patch only changes what happens during probesize, where it makes
> > av_find_stream_info stop after first pmt is found. It does not stop the
> > demuxer from adding more streams later (even as the doxy above would
> > suggest that is against api), so further stream will still be found.
> 
> Technically by not setting AVFMT_NOHEADER it will make it stop after all 
> streams
> detected in the first PMT have parameters information.
> 
> Breaking API is certainly not wanted.
> However I think API could be extended to allow this usage. This could be 
> done that makes av_find_stream_info ignore AVFMT_NO_HEADER.
> Would that work for you ?

Not sure if you intended to attach a patch, but yea if av_find_stream_info 
ignored AVFMT_NO_HEADER after first PMT was found that would work just fine.

The point is just to avoid searching the full probesize. For low bitrate live 
stream that can take some time.

I can't see a good solution to how to do above thou. One can for example not 
just stop av_find_stream_info as soon as it has found one stream. Standard mpeg 
demuxer has no similar mid stream header that shows up that contains the 
complete list of streams in the file after that point (maybe it has, but it's 
not used anyway). 

One would have to extend the demuxer/utils.c interface with some additional 
flag, and i'm not sure it's really worth it, given the one use case of 
AVFMT_NO_HEADER.

/Joakim






More information about the ffmpeg-devel mailing list