[Live-devel] streaming h264 dynamic payload from rtp source
Garrison, David
dgarri02 at harris.com
Tue Jan 21 10:52:58 PST 2014
Ross,
Thanks for the quick response.
Ok, So I've started my own MPEG2PesParser class that extends FramedFilter to do the parsing. I started the implementation for doGetNextFrame() and understand how to parse the PES from the datagram payload but I still do not see how to get at the data nor how to pass that data along to the sink.
I set some breakpoints in RTPInterface and see the startNetworkReading being called in response to the PLAY request but the incomingReportHandler is not called.
Seems my MPEG2PesParser::doGetNextFrame() is being called before the RTPInterface::incomingReportHandler is called.
What am I missing?
Dave Garrison
From: live-devel-bounces at ns.live555.com [mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Monday, January 20, 2014 8:47 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] streaming h264 dynamic payload from rtp source
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/20140121/c290288d/attachment-0001.html>
More information about the live-devel
mailing list