[Live-devel] fix for stuttering video and audio when streaming an mpeg-2 transport stream

Morgan Tørvolt morgan.torvolt at gmail.com
Fri Feb 16 03:12:37 PST 2007


> Thanks i see and understand the problem now.
> However the solutions (build 3 different framers) which is being suggested
> will not work for me.
> I need a fourth framer;-) and let me explain why.
> Although I do receive live tv, i dont want to feed it directly in the Live
> library.
> Instead i'm writing the live data to HDD and use the file on the HDD as a
> timeshifting buffer.
> This buffer on the HDD is circular and has a fixed length (lets say 2 GByte)
> I receive the live tv, write it to the file and when i reach the 2 GB, i
> start at file position 0 again.

That makes it harder, yes.

> Because of my setup where
> - i use the live tv data (so no indexing possible)
> - the data is not feeded directly into live555 (so not possible to skip the
> pcr detection as you proposed)

Indexing could still be possible, doing that in a parallell
ring-buffer of some sort. It would even make it very easy to see if
you are at the boundry of the buffer as there will be a large gap in
the PCR without the discontinuity flag being set in the TS header, so
disallowing rewinding or fast forwarding too far. Problem with that
ring-buffer is that it cannot be fixed size like the other buffer, as
you really do not know how many pcr packets and I-frames will be in
the ts-buffer. There are of course ways around that. Maybe you could
make the receiving application and the liveMedia streaming application
talk trough a socket, and let the receiving application keep track of
all the PCRs available? You will need to index the file in one way or
another to get decent trick play functionality without demanding too
much resources from your server.

> I'm now forced to use the default framer which is not good enough.
> I guess we really need a (small) buffer on the server side to determine both
> current and next PCR
> and based on those two perform the calcuations

That is a possibility, but doing fast forward or rewinding would make
you read trough the whole file looking for PCRs and I-frames. That is
not what you want if you expect to have more than very small number of
clients.

Best regards
-Morgan-


More information about the live-devel mailing list