4

I've RTSP stream of an IP cam on my local network. I would like to stream that using webrtc over the internet. How to do it? Can it be done by JavaScript Library like peerjs or easywebrt or simplewebrtc. If yes then, is there any demo or example available for reference?

user9675151
  • 43
  • 1
  • 2
  • 4
  • kurento, janus, ant media server, unreal media server - all of them will receive your rtsp stream and stream it out as WebRTC. H264 video is OK. Audio is more problematic: WebRTC needs Opus or G.711 audio, so you will either need to set your IP Camera to encode G.711 audio, or you will need to transcode audio to Opus inside of these gateways. – user1390208 May 08 '20 at 17:04

4 Answers4

8

I don't think you will be able to do this with just your browser. You will need some sort of media gateway.

RTSPtoWebRTC is an active project that does exactly what you want! It is written in Go and uses Pion WebRTC

Sean DuBois
  • 3,972
  • 1
  • 11
  • 22
1

Need to use a Media Gateway for converting the RTSP/RTP protocol to WEBRTC specific RTP protocol.

Media Gateway option - janus-gateway

Check the link and create the your setup accordingly - meetecho-janus.

mail2subhajit
  • 1,106
  • 5
  • 16
0

It is unverified because I do not have IPCam at hand,
EX) Virtual Webcam Driver
If you use such an IP Camera to WebCam Converter, you will be able to recognize it as a WebCam in the Browser. The disadvantage is that you need a PC on the IP Camera side.

kenji tanaka
  • 461
  • 4
  • 5
  • I have pc but is there any other way to do this without using any third party software inorder to access rtsp stream from IP cam ? – user9675151 May 08 '20 at 06:05
  • 1
    WebRTC's Media Channel needs to connect with the DTLS-RTSP protocol, so I think that it will be necessary to add a server or some means for protocol conversion. – kenji tanaka May 08 '20 at 06:37
0

I use Ant Media for a similar use case.I had a requirement for converting RTSP stream and viewing it as WebRTC and HLS for browsers and Mobile applications. Ant Media Server is a media server software that supports RTSP ingestion and conversion to WebRTC, HLS, or DASH. It provides the necessary infrastructure to handle the streaming workflow, including media ingestion, transcoding, and distribution.for more information please take a look their Github Ant Media.

Usama
  • 159
  • 1
  • 13