Open zhehuaz opened 9 years ago
I have the same question, too.Can anyone help us?
Seems this one not answered yet. I also wonder how to do the multi user support.
Looks someone has the answer here. http://stackoverflow.com/questions/27058706/multiple-libstreaming-streams-only-recognized-as-session-of-first-rtsp-client
But looks it;s not a simple modification. In the current api each time a request come it tries to initialize the camera also. Which thorws camera in use error.
Any one has a solution?
This is a really old question...
I solved it by sending packets to a broadcast IP. Besides, you need a server to dispatch SDP(session description) info. The clients open SDP files with VLC, it works. The solution is ugly, though.
Thank you very much for the answer. Seems you managed to solve it somehow.
Though, the question is old but no proper or official solution yet. If you could share your work that would be a great help for me and the community. You will save lot of time of myself and other programmers who look for the same answer.
Thank again LangleyChang
Here's my old code for it, but honestly, the code is really ugly and I guess you may get confused... You must be aware that broadcast packets challenges the router and it could cause a crash in the network.
Anyway, if my solution really helps, it is as following :
.sdp
file and then open it with VLC.This player is amazing because it parses the file and connect the RTSP server (libstreaming) automatically. So, the problem is to send the .sdp
file to clients, and I build up another socket server for it.In conclusion, the server builds up a session and start to send broadcast packets.Then you build up another server to dispatch SDP strings obtained from session object.
The clients connect to the latter server firstly to fetch the SDP string and save it as a .sdp
file.Then, open the .sdp
file with VLC. All done~
Forgive me but I'm not a native English speaker.And anywhere unclear or better approaches, feel free to reply.
Thanks Zhehua Chang, your solution works!
Bit slow but works. :) The only issue is the writing to the broadcast ip.
As another approach, I have tried to write the buffer into two sockets. Managed to get the frames in two clients. But has some issues.
_Here I did the modifications in the AbstractPacketizer class and H264Packetizer class. Created two _RtpSocket and buffer instances.
Anyone tried this before?
2016-01-28 15:41 GMT+05:30 Zhehua Chang notifications@github.com:
Here's my old code https://github.com/Oo-Dev/OoDroid2 for it, but honestly, the code is really ugly and I guess you may get confused... You must be aware that broadcast packets challenges the router and it could cause a crash in the network.
Anyway, if my solution really helps, it is as following :
- Firstly, set your IP address to "239.1.1.1" or some other broadcast IPs.
- Then build up a session as usual.After that, you can get SDP as a string by calling session.getSessionDescription(). The above two steps correspond to the normal way to build up a sessoin https://github.com/Oo-Dev/OoDroid2/blob/master/app/src/main/java/org/oo/oodroid2/OoDroidActivity.java#L100 .
- As far as I know, this SDP string can identify a session. You just save it into a .sdp file and then open it with VLC.This player is amazing because it parses the file and connect the RTSP server (libstreaming) automatically. So, the problem is to send the .sdp file to clients, and I build up another socket server for it.
In conclusion, the server builds up a session and start to send broadcast packets.Then you build up another server to dispatch SDP strings obtained from session object. The clients connect to the latter server firstly to fetch the SDP string and save it as a .sdp file.Then, open the .sdp file with VLC. All done~
Forgive me but I'm not a native English speaker.And anywhere unclear, feel free to reply.
— Reply to this email directly or view it on GitHub https://github.com/fyhertz/libstreaming/issues/93#issuecomment-176102877 .
@zhehuaz @ft816806 @deshan @brunosiqueira @serpro I don't have any server. I would like to make my own device as server and let multiple clients see streams in VLC player. Any suggestions, how to I achieve that?
@zhehuaz 您可以用中文详细描述下您上面的做法吗?我没大看明白,大致感觉你说的是多播(组播)。
Here's my old code for it, but honestly, the code is really ugly and I guess you may get confused... You must be aware that broadcast packets challenges the router and it could cause a crash in the network.
Anyway, if my solution really helps, it is as following :
- Firstly, set your IP address to "239.1.1.1" or some other broadcast IPs.
- Then build up a session as usual.After that, you can get SDP as a string by calling session.getSessionDescription(). The above two steps correspond to the normal way to build up a sessoin.
- As far as I know, this SDP string can identify a session. You just save it into a
.sdp
file and then open it with VLC.This player is amazing because it parses the file and connect the RTSP server (libstreaming) automatically. So, the problem is to send the.sdp
file to clients, and I build up another socket server for it.In conclusion, the server builds up a session and start to send broadcast packets.Then you build up another server to dispatch SDP strings obtained from session object. The clients connect to the latter server firstly to fetch the SDP string and save it as a
.sdp
file.Then, open the.sdp
file with VLC. All done~Forgive me but I'm not a native English speaker.And anywhere unclear or better approaches, feel free to reply.
Can libstreaming support multiple users? When a new client connect the server,the previous one is closed. How to implement multi-user connection like RSTP streaming in VLC ?