[Live-devel] streaming h264 dynamic payload from rtp source

Ross Finlayson finlayson at live555.com
Mon Jan 20 17:47:21 PST 2014


> I’ve been looking at the examples and have tried to accomplish setting up an RTSP server that can stream RTP H264 dynamic payload from a live RTP source carrying MPEG2 Transport with H264 PES payload and keep running into problems.  Any guidance would be greatly appreciated.

Dave,

The bad news is that you're on completely the wrong track :-)  The good news, however, is that it will probably be fairly easy to do what you want.

The first thing to note is that the "LIVE555 Streaming Media" code does not include any mechanism for demultiplexing one (or more) stream(s) from a Transport Stream.  (Note that the "MPEG1or2Demux" class is for demultiplexing a MPEG *Program Stream*, which is completely different.)  Also, the "IndexFromTransportStream" code is for creating a separate index file from a Transport Stream file - to later use for 'trick play' access to the original file.  It has nothing to with demultiplexing from a Transport Stream.

Therefore, I suggest that you find (or write) some other software that will convert an input Transport Stream into an output H.264 video stream (consisting of a byte-stream that contains a sequence of H.264 NAL units, each beginning with a 0x00 0x00 0x00 0x01 'start code').  There is probably some other Open Source software out there that will do this.

Then, write your own "OnDemandServerMediaSubsession" subclass that:
1/ Reimplements "createNewStreamSource()" to create a new instance of your 'Transport Stream-to-H.264 Video conversion software', and feed this into a "H264VideoStreamFramer" (*not* a "H264VideoStreamDiscreteFramer", unless your conversion software delivers discrete H.264 NAL units (i.e., one-at-a-time), without start codes).
2/ Reimplements "createNewRTPSink()" to return a new "H264VideoRTPSink".  (You got that part right :-)

Even simpler, though, you can probably get what you want by doing the following:
- Change the "testOnDemandRTSPServer" code by changing line 92 of "testProgs/testOnDemandRTSPServer.cpp" from
	char const* inputFileName = "test.264";
to
	char const* inputFileName = "stdin";

Then, run
	Your-Transport-Stream-to-H264-Video-Conversion-Application | testOnDemandRTSPServer
(assuming that 'Your-Transport-Stream-to-H264-Video-Conversion-Application' outputs to 'stdout')

This should work, provided that the input stream contains frequently-occurring H.264 SPS and PPS NAL units.


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140120/456a5828/attachment.html>


More information about the live-devel mailing list