[FFmpeg-devel] [PATCH] lavf: add a concat demuxer.

Michael Niedermayer michaelni at gmx.at
Mon Aug 27 21:10:20 CEST 2012

On Mon, Aug 27, 2012 at 07:44:43PM +0200, Nicolas George wrote:
> Le nonidi 9 fructidor, an CCXX, Michael Niedermayer a écrit :
> > if this would also work with timestamp discontinuities within files
> > (possibly through a full demux scan through the file and possibly
> > also through caching of the timestamp info in some file)
> > then this would allow timestamp accurate seeking in mpeg-ts/ps with
> > discontinuities. At the cost of some startup delay
> > this could be quite usefull sometimes i think ...
> I am not completely sure this is related, but I do not understand the
> generic seeking code well enough to be sure. Can you correct if I am
> mistaken:
> At startup, tu MPEG-[PT]S demuxers seek near the end of the file to get the
> duration.
> When a seek is requested and there is no index, the seek engine finds the
> two nearest known seek points and does a binary search by offset between
> them, making the demuxer read a packet to get the timestamp.
> When there are discontinuities, it does not work because it is not possible,
> when reading the timestamp from a packet after seeking in the file, to know
> whether the discontinuity is before or after, or maybe both.


> A trivial solution would be to walk through the whole file and let the
> demuxer build the index of all seek points and be ready, like mplayer does
> with the -idx option. In that mode, discontinuities can be detected and
> compensated. Maybe just setting analyzeduration and probesize to huge values
> would be enough to implement that method.

> A more efficient way would be to seek by small amounts in the file, but that
> requires to have a predefined idea of what the discontinuities look like (go
> back from 2^33 to 0? from anything to 0? from anything to anything else?).

they can go from anything to anything but going from anything to
something close to 0 is more common 

> In any case, it may be possible to dump the detected discontinuities, and
> then to accept them back later in the same format, avoiding the need for a
> new scan.
> Am I speaking complete nonsense?

nope, you seem to understand the problem well


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- 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/20120827/186a0a60/attachment.asc>

More information about the ffmpeg-devel mailing list