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

Reimar Döffinger Reimar.Doeffinger
Wed Feb 27 20:45:21 CET 2008

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.

Reimar D?ffinger

More information about the ffmpeg-devel mailing list