<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">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.</div></div></div></blockquote><div><br></div>Dave,</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Then, write your own "OnDemandServerMediaSubsession" subclass that:</div><div>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).</div><div>2/ Reimplements "createNewRTPSink()" to return a new "H264VideoRTPSink". (You got that part right :-)</div><div><br></div><div>Even simpler, though, you can probably get what you want by doing the following:</div><div>- Change the "testOnDemandRTSPServer" code by changing line 92 of "testProgs/testOnDemandRTSPServer.cpp" from</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>char const* inputFileName = "test.264";</div><div>to</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>char const* inputFileName = "stdin";</div><div><br></div><div>Then, run</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Your-Transport-Stream-to-H264-Video-Conversion-Application | testOnDemandRTSPServer</div><div>(assuming that 'Your-Transport-Stream-to-H264-Video-Conversion-Application' outputs to 'stdout')</div><div><br></div><div>This should work, provided that the input stream contains frequently-occurring H.264 SPS and PPS NAL units.</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>