vls input from MPEG2 stream ? -> problems

Arnaud de Bossoreille de Ribou bozo at via.ecp.fr
Thu Oct 18 13:38:06 CEST 2001


Hi Andy,

I suggest continuing this discussion in "vls-devel" instead of "vls"
because it has become very technical.

On Wed, Oct 17, 2001, Andy Kellner wrote:
> - I solved the problem (at least for now) by putting a max number of
> waittime into the WaitSendDate() call, specifically I changed line
>   323 in tsstreamer.cpp from:
> 
>  If (iWait > 500)
> 
> to
> 
> If (iWait > 500) && (iWait < 2000)

With your patch the internal clock of the streamer is completely
desynchronized and TS packets are sent directly after the first
discontinuity. It doesn't matter with a real time encoder because the
encoder also regulates the stream but it generates a bug for files.

The clean way is to detect time discontinuities in the converter and
then to set the discontinuity flag in the TS packet. When the streamer
see this flag set it synchronizes its internal clock with the new time
reference.

Backward discontinuities are detected in src/mpeg/ps2ts.cpp:355. Could
you please send to "vls-devel" the amount of time between m_iPrevSCR
and iSCR when you have forward discontinuities ?

> Let me know what you think. Maybe there should be a mechanism in thread.cpp
> to interrupt the nanosleep() call after a max timeout or so ?

Hmm no and even if there was one it is a kludge.

> Also, I tried to feed a TS stream into vls rather then a PS stream. It looks
> to work fine, however I get a message 'PES trashed, decoder fifo full'
> message
> on the CLIENT side after a while and the client AND the server hangs and
> need to be restarted. I did not however, tried the TS stream after the
> changes
> in tsstreamer.

I'm going to harass the guy who have the card to begin tests. Maybe
the pipe makes things work better for an unknown reason (one more thing
in the TOTEST list :)

One more question to give an answer to: does the TS stream given by
the encoder set the discontinuity flag in the case of a discontinuity ?
If "yes" then its a good encoder, if "no" it doesn't follow the MPEG2
specification.

-- 
Arnaud de Bossoreille de Ribou - http://www.via.ecp.fr/~bozo/




More information about the vls-devel mailing list