[Live-devel] Need help relaying RTP packets
Ross Finlayson
finlayson at live555.com
Thu Nov 2 21:35:16 PDT 2017
> I am trying to relay the RTP packets received from an RTSP server (server A, running 3rd party software) to a remote URL hosted by server B (running our own software). I must get the SDP of the video stream from server A and use it to ask server B for the destination URL. Communication with Server B does not require any type of streaming control protocol (RTCP, RTSP), but it knows how to accept RTP packets on a socket. All video streams from server A are H264.
>
> So I created a module based on the Live555 sample testRTSPClient. Once I was receiving data from server A, I replaced the "DummySink" that it used with the BasicUDPSink that the sample testRelay is using, and created its output socket on the destination URL that I got from server B. That did not seem to work, and I was told that if I wanted to relay RTP packets, I should use a sink derived from RTPSink. So I replaced the BasicUDPSink with H264VideoRTPSink. That did not seem to work either.
>
> So I'm hoping that someone can tell me if I am on the right track
Yes, I think you’re on the right track. However (as I’ve noted before), because your ‘Server B’ is a product of your own company, only someone at your company can tell you what kind of data it expects, and why your stream is not working. I don’t understand why you’re asking for help here, rather than inside your own company. (Therefore, this will be your last posting on this topic.)
One thing to keep in mind, however, is that *perhaps* your receiver (‘Server B’) expects to see H.264 SPS and PPS ‘NAL units’ at the front of the H.264 video stream that it receives. (Once again, only you can know this.) But if that’s the case, you can get these SPS and PPS NAL units by calling "parseSPropParameterSets()”. See, for example, the third paragraph of
http://live555.com/liveMedia/faq.html#testRTSPClient-how-to-decode-data
and note also the implementation of the “H264or5VideoFileSink” class (which also inserts SPS and PPS NAL units in front of its output data).
> And here is another thing I find odd: When I create the output socket for the sink (a Groupsock), I notice that its constructor takes an address and port, but no scheme. I want it to use UDP, and I have the #define REQUEST_STREAMING_OVER_TCP set to False. Will it, in fact, use UDP?
Yes, “Groupsocks” always send UDP packets. The optional REQUEST_STREAMING_OVER_TCP #define is used to request that the *incoming* RTP stream be received over TCP. It has nothing to do with what you subsequently do with this received data. Red Herring...
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list