[streaming] Re: TS Discontinuities
James Yates
james.yates at packetvision.com
Tue Jun 21 13:33:46 CEST 2005
When you start streaming, it is likely you will get a few
discontinuities reported. A continuity counter is maintained for every
PID which is incremented everytime a TS packet with a payload is sent.
This is a 4 bit number so is in the range 0 to 0xF, it then wraps back
to 0.
The discontinuities at the beginning happen as LIBDVBPSI has to assume
every count is at 0 although in practice they could be at any number in
the valid range. Once the stream is playing, any discontinuity error
reported will be as the result of losing a real packet, thus tieing in
with you atrifacts on screen, probably missing or green blocks.
The warning shows you the countuer value received and what VLC is
expecting, so for the first output it got 0 but was expecting 15 so you
can say that it dropped 1 packet on that PID.
As for TS packets in UDP, TS packets are placed in UDP packets in their
stream order, so 1 udp packet contains 7 TS packets but not necessarily
from the same PID. Countintuity counter is only valid for a packet that
contains a payload and also not for NULL packets (PID 0x1FFF).
Have you used ethereal. Great programme for looking at this sort of
thing. Can sniff the network and look at the stream. Also has a MPEG2
plugin which will be very handy for you.
As I understand it, there should be no packet reordering in UDP. The
problems you are seeing are due to dropping UDP packets which on a
network, particularly on wireless will happen.
Hope this helps.
James
On Tue, 2005-06-21 at 12:06 +0100, Dermot McGahon wrote:
> Hi,
>
> I need to understand these a little better,
>
> libdvbpsi error (PSI decoder): TS discontinuity (received 0, expected 15)
> libdvbpsi error (PSI decoder): TS discontinuity (received 7, expected 6)
> libdvbpsi error (PSI decoder): TS discontinuity (received 9, expected 8)
> libdvbpsi error (PSI decoder): TS discontinuity (received 5, expected 4)
>
> I'm streaming mpeg-2 ts/udp and on a channel change I get a few
> discontinuities,
> but more worrying is that during streaming I sometimes get 10-20
> discontinuities
> with artifacts resulting on screen.
>
> Questions:
>
> - It seems libdvbpsi expects CC of 0 when starting playback. What is the
> range of the CC's in the transport stream packets? How often does it
> loop back to 0? Is it based on the GOP?
>
> - How should I read the above? VLC received CC 15, 0, 1, 2, 3, 4, 5, 7, 9?
>
> - UDP packet size is 1316 (7 TS packets). Is this was due to a udp packet
> being lost wouldn't I see a gap of mod 7 in the discontinuities?
>
> - Does UDP packet reordering come into play here?
>
>
>
> Dermot.
> --
>
--
This is the streaming mailing-list, see http://www.videolan.org/streaming/
To unsubscribe, please read http://www.videolan.org/support/lists.html
More information about the streaming
mailing list