0

Hi i have a RTSP stream (video) coming from my Rasberry Pi and want to stream to a browser for clients to view without using plugins such as flash. From my understanding of webRTC and it's P2P nature both peers need to connect to a signalling server before they are connected to each other.

Is there a way to set it so that one peer (The media stream coming from the RPi) is always connected and awaiting another peer to signal the server.

Websockets would be preferable but I don't know how to use them in this way, if it's even possible.

Thanks for any help in advance!

1 Answers1

0

It's even more simple than that. Peers just have to be able to send a bunch of text (data that's needed by their WebRTC modules to establish the media streams) to each other. You can literally open two browsers and copy-paste that metadata between them - they'll establish a WebRTC connection.

People talk about the "signaling servers" because in the case of two browsers they can't directly connect to each other with something like a WebSocket or a HTTP request.

The peer that receives RTSP stream isn't a browser. It can listen on a WebSocket so browsers could connect to it.

Velkan
  • 7,067
  • 6
  • 43
  • 87
  • Thank you for comment, I apologize as I didn't specify that i was a video stream, not text. The problem with this is that I want to avoid opening a browser on the RPi 'client'. It should act more as a server to other clients to connect to to view a stream that is already running. I know this isn't the intented use of webRTC but I haven't found another way to display a video stream in a browser without using plugins – Adam O Mahony Jun 28 '18 at 07:43
  • "Text" is the signaling that peer need to connect their media (audio/video) streams properly. "Displaying a video stream in a browser without using plugins" is one of intended uses of WebRTC. – Velkan Jun 28 '18 at 07:54
  • Okay misunderstood your comment, that still doesn't solve my problem. I want the streaming peer to always be 'connected' and just waiting for other peers to send data and connect to that stream – Adam O Mahony Jun 28 '18 at 08:14