[FFmpeg-devel] [RFC] possible API for opening external demuxer references

Måns Rullgård mans
Wed Feb 27 21:00:50 CET 2008


Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:

> On Wed, Feb 27, 2008 at 07:37:05PM +0000, M?ns Rullg?rd wrote:
>> Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:
>> > On Wed, Feb 27, 2008 at 08:01:58PM +0100, Gabriel Fort? wrote:
>> >> the reading part is IMO even dirtier, as I'm forced to keep the
>> >> current pts/dts values for every stream, and find out before
>> >> each av_read_frame() which AVFormatContext I should use based on
>> >> expected values.  ie. if aux's DTS <= main's DTS, then read from
>> >> aux.
>> >
>> > Um, why don't you just buffer one AVPacket for each AVFormatContext and
>> > always return the one with the lower PTS in your read wrapper (and fill
>> > the empty buffer with a new packet)?
>> 
>> Ordering by PTS is wrong when B-frames are present.
>
> Why should that matter here? This is about combining demuxers in a way
> that behaves reasonably similar to a real demuxer. A real demuxer will
> return the packets from different streams neither perfectly ordered nor
> perfectly interleaved, so neither does this solution have to I think.

I thought the problem here was the PTS of a single stream being
non-monotonous.  If they are, they must stay that way.  The error is
in assigning DTS=PTS when DTS is not specified for anything but MPEG
containers.

Ordering packets from different streams by PTS won't help with
monotonicity if packets from a single stream do not have monotone
timestamps.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list