0
votes

Established: I am currently streaming data packets(.mp3 files) from source(server) to sink(client A) using gstreamer over RTP. This thing is pretty easy and I am successfully able to stream music over a network from server to device.

Requirement: Now, I want to retransmit the data packets in real time(or atleast as close to real time as possible) from the client A to say any other client B . Hence the control would still remain with client A and only the music would now be actually streaming with client B.

What is the most optimum way to do such a thing.

2

2 Answers

1
votes

Assuming you want to quickly try this. The ideal way is to setup a rtsp server on client A which can forward client B data. If you want to do it your way here is one way to do it:

If you have a player in client B which can play a rtp stream given a sdp file this is what you can do: Create a copy of the sdp you get in client A. Give it to client B via some path. [Say tcp socket that both agree to communicate upon]

Stream a copy of what you get in client A to client B as well.

You need to change port numbers in sdp to be the one available at client B [This what RTSP negotiation does]. If the client B can tell client A the port number before it gets the SDP, great, you can then set the port number in the sdp correctly, give it to client B and then send a copy of he stream to client B. you are done.

0
votes

you also uset RTP over TCP. So it would be easy for you, as no changes require at RTP level. You need to pass packet to RTSP instead of sending directly over UDP socket. everything will be handle by RTSP. If you are using RTP as a stand alone ,accoeding to rfc 3550 , its not a part of RTP Still you wan't to do so, then you are not following standard way of RTP implementation.