[Live-devel] Transport Streams

Ross Finlayson finlayson at live555.com
Tue Mar 7 12:45:13 PST 2017


> I have downloaded and built your system. I tried the "testMPEG2TransportStreamer" test program. I have a file named "test.mpg". This is a file with a 10 second transport stream compressed with h.264. This file can be played with vlc from the file. I can also stream it to a rtp, udp, multicast ip stream from vlc and it works fine.
> 
> When I run the test program mentioned above it does send rtp packets. However, vlc displays garbage. I have looked at the packets emitted with wireshark. Wireshark decodes them as transport stream packets but claims the video is scrambled, which of course is not the case.
> 
> I looked at the source code. From what I can tell the event loop continually calls functions that simply read the file and stuffs the bytes in the rtp packets without regard to the video format, compression type. It does not appear to parse the file data to get any of this information. I must be missing something.
> 
> My question is :
>     Has this test program been tested, or am I doing something stupid?

The “testMPEG2TransportStreamer” application is working properly (assuming that your Transport Stream file is named “test.ts”).  The RTP payload format for MPEG Transport Streams (as defined in RFC 2250) calls for (an integral number of) 188-byte Transport Stream ‘packets’ to be packed into each RTP packet.  When sent over RTP, Transport Stream data is not demultiplexed at all; it is sent ‘as is’.

Your problem is that - when you are trying to play the incoming RTP stream using VLC - VLC is not recognizing the stream as being Transport-Stream-data-over-RTP, because it is not being told this.

The easiest way to fix this is to use the RTSP protocol to access the stream.  Uncomment the line
	#define IMPLEMENT_RTSP_SERVER 1
in “testMPEG2TransportStreamer.cpp”, line 34, and recompile.  Then, when you run “testMPEG2TransportStreamer”, it will output a “rtsp://“ URL for the stream.  Enter this “rtsp://“ URL into VLC, and VLC should be able to play the stream OK.


Note also that the “testMPEG2TransportStreamer” streams via IP multicast, which means that the stream will probably not go beyond a single LAN.  If, instead, you want to stream via IP unicast (one stream per client), then you can instead use the “LIVE555 Media Server”
	http://www.live555.com/mediaServer
or else use the “testOnDemandRTSPServer” demo application.
	

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




More information about the live-devel mailing list