[MPlayer-dev-eng] NUT dts proposal
Uoti A Urpala
urpala at cc.helsinki.fi
Wed Sep 7 02:55:54 CEST 2005
Rich Felker wrote:
> frame[n].dts = min(frame[n].pts, frame[n+1].pts, ..., frame[n+d].pts)
> (where d=decode_delay)
> The biggest apparent problem with the possible new system is that you
> (in principle) have to look at future context to know dts. This would
> appear to introduce latency in muxing and whatnot. In actuality, you
In what sense does it require more "looking at future context" than
the current system? You can implement muxing as follows:
- For each stream, have a buffer with decode_delay+1 packets (or you
don't need to buffer that many if you know by some other means that
the later ones won't have a pts smaller than the smallest pts already
in this or some other buffer).
- Find the stream with smallest pts in its buffer. Mux all packets
from that stream until (including) the one with minimal pts. Refill
buffers and repeat.
This is quite similar to the "decode_delay+1 sized buffer for each
stream" requirement in the existing spec. In fact the current spec is
worse: in the earlier "pathological" example, the current spec
requires you to know the frame at pts=100 before you can mux other
streams past pts=2. That wouldn't work for any kind of live
streaming. The "dts=min(pts of further frames)" version doesn't have
that problem: as long as you know the stream won't have packets with
pts smaller than those already known in other streams, you don't need
to know anything else about its future values to keep muxing.
More information about the MPlayer-dev-eng
mailing list