<html><head><base href="x-msg://180/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The basic problem is your code's use of the port number 8556. First, you shouldn't think of it as being the server's 'output' port. Instead, it's the 'control' port that the server uses for incoming RTSP connections from clients. (The actual RTP/RTCP stream 'output' uses other port numbers, which will differ for each client.)</div><div><br></div><div>Anyway, the key point is that because the server uses port number 8556 for RTSP, your code can't reuse it.</div><div><br></div><div>Also, you should not be calling "getStreamParameters()" and "getStreamSource()" at all. Those functions are only used internally by our library code to implement RTSP server functionality; you should not be calling them yourself in your code.</div><div><br></div><div>Because your server is receiving Transport Stream packets on a UDP port (1236, in your case), and then re-serving this data via RTSP, you should just be using a variant of the code that's used (in lines 330-356 of "testProgs/testOnDemandRTSPServer.cpp") to demonstrate this functionality in the "testOnDemandRTSPServer" demo application.</div><div><br></div><div>The change that you would make is that instead of using the "MPEG2TransportUDPServerMediaSubsession" class, you would use a *subclass* of this - that you would write. For the purposes of this email, let's call this subclass "modifiedMPEG2TransportUDPServerMediaSubsession".</div><div><br></div><div>Your "modifiedMPEG2TransportUDPServerMediaSubsession" class would be a subclass of "MPEG2TransportUDPServerMediaSubsession", and would reimplement just one virtual function: "createNewStreamSource()". Your reimplemented "createNewStreamSource()" function would look something like this:</div><div><br></div><div><br></div><div><div>FramedSource* modifiedMPEG2TransportUDPServerMediaSubsession</div><div>::createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>FramedSource* inputSource = MPEG2TransportUDPServerMediaSubsession:: createNewStreamSource(clientSessionId, estBitrate);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>// call the parent class's implementation first</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>StreamReplicator* replicator = StreamReplicator::createNew(envir(), inputSource);</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>startReplicaFileSink(replicator, "test.ts");</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>startReplicaFileSink(replicator, "test2.ts");</div></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return replicator->createStreamReplica();</div><div>}</div><div><br></div><div><br></div><div>I.e., your code would replace the input source stream with a replica, while creating two more replicas for use in output files.</div></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; font-size: medium; "><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; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>