简体   繁体   中英

How to setup a livestream Node js server that accepts RTMP and/or RTSP streams and use WebRTC to stream to clients (browsers)?

I am trying to set up a live streaming server using Node js and stream it to clients. The server needs to cater both RTMP and RTSP incoming streams.

So far, what I have done is to use node-media-server to accept RTMP streams and remux to HLS/DASH. This is working fine but produces a huge latency of around 10-20 secs which is not acceptable in my application. I need to have low latency (as much as possible, maximum of 1-2 secs delay). I am also trying to avoid using Flash plugins in the client-side since it will be deprecated by end of 2020.

Further research, maybe I can use WebRTC but is there a way to set up a server that still accepts RTMP and even RTSP (maybe convert to RTMP afterward) and then stream via WebRTC? If so, how? Or are there any other suggestions?

That is possible (and people are doing it today!)

For fun I did rtmp-to-webrtc which is a Go server that accepts RTMP and serves via WebRTC.

You could easily add a RTSP server and do the same. I haven't done it myself, but there are a few Go RTSP servers out there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM