[Live-devel] Question about trick play, server side

Ross Finlayson finlayson at live555.com
Wed Dec 1 06:23:59 PST 2010


>I checked the code mentioned, and it works as expected.
>But now I have a question... is possible to do the same (stream only 
>N mins of file, or make an infinite loop) from the server side?

Well, if you want to only stream N minutes of a file - without the 
client asking you to do this - then the best/right way to do this 
would simply be to create a new file in advance, by editing the 
original file, and then asking your clients to stream from the new 
file instead.

As for streaming a single file over and over again, in an infinite 
loop (again, without the client asking you to do this): You could do 
this, but you'd need to write a new "FramedFilter" subclass that sits 
in front of your "ByteStreamFileSource" class (and presents the 
illusion of delivering a single, unbroken stream to the downstream 
object (a "MPEG2TransportStreamFramer")).  You'd also need to write a 
new "OnDemandServerMediaSubsession" class (replacing the existing 
"MPEG2TransportFileServerMediaSubsession" class) that uses your new 
"FramedFilter" subclass.

Also, because you're streaming a Transport Stream file, you'd need to 
make sure that the 'discontinuity flag' is set at the start of the 
file, so that PCR values (and thus presentation times) don't get 
messed up when the server loops back to the start of the file.

None of this really has anything to do with 'trick play' (in 
particular, you won't be creating index files at all), because - from 
the client's point of view - you're not doing anything other than 
playing a simple stream.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list