[Live-devel] Initial support for server 'trick play' operations on Transport Stream files
Ross Finlayson
finlayson at live555.com
Sun Dec 31 17:31:45 PST 2006
The latest version (2006.12.31) of the "LIVE555 Streaming Media"
software includes initial support for server 'trick play' operations
(seeking, fast forward, reverse play) on MPEG-2 Transport Stream
files. The actual RTSP server code itself does not yet support
Transport Stream 'trick play' operations; however, that will be added
probably for the next release - perhaps within a day or so.
To support 'trick play' operations on a Transport Stream file, the
server must have a corresponding "index file". This index file
describes the position - within the Transport Stream file - of video
I-frames (i.e., key frames); these frames are used to produce a fast
forward or reverse play stream.
Each Transport Stream file that you wish to stream must have a
corresponding "index file" (if it doesn't, the the server will still
be able to stream the file, but without 'trick play' operations).
The index files use the file name suffix ".tsx"; for example, if your
Transport Stream file is named "foo.ts", then the corresponding index
file will be named "foo.tsx". The current release of the "LIVE 555
Streaming Media" software includes a utility - called
"MPEG2TransportStreamIndexer", in the "testProgs" directory - that
you can use to generate index files for your Transport Stream files.
To generate each index file, run
MPEG2TransportStreamIndexer <transport-stream-file-name>
Be warned that this program is currently rather slow, so I suggest
running it on the fastest computer that you have.
Once you have generated your index files, you can try running a demo
application called "testMPEG2TransportStreamTrickPlay" (also in the
"testProgs" directory) to simulate the effect of 'trick play'
operations on Transport Stream files. To run it:
testMPEG2TransportStreamTrickPlay
<input-transport-stream-file-name> <start-time> <scale>
<output-transport-stream-file-name>
where
<input-transport-stream-file-name> is the original Transport
Stream file name (which must end with ".ts"). There must also be a
corresponding index file for this file.
<start-time> is the starting play time in seconds (use 0 to
play from the start)
<scale> is a non-zero integer, representing the playing speed
(use a negative number for reverse play)
Examples (assume that your original Transport Stream file is named
"foo.ts", and that you have already generated an index file, named
"too.tsx"):
testMPEG2TransportStreamTrickPlay foo.ts 0 8 foo8.ts
The output file "foo8.ts" is the original stream, sped up 8x
testMPEG2TransportStreamTrickPlay foo.ts 30 -1 foo-1.ts
The output file "foo-1.ts" is the original stream, played
backwards (at 1x speed), starting from the 30 second point.
testMPEG2TransportStreamTrickPlay foo.ts 30 -5 foo-5.ts
The output file "foo-5.ts" is the original stream, played
backwards (at 5x speed), starting from the 30 second point.
If you have any problems with these programs, please let us know,
including the URL of the original Transport Stream file, so we can
take a look at it.
A reminder once again that this 'trick play' functionality will be
added to the RTSP server code shortly.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list