illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.89k stars 1.51k forks source link

Leave session opened on RTMP encode (OBS) stop/restart streaming #624

Open top4music opened 5 months ago

top4music commented 5 months ago

Hello,

I have to find a solution or a workaround to my scenario.

We use NMS to make sport live streaming, using 4G for trasmission (ISP offer dynamic IP behind D-NAT). All works flowly but if there's a connection drops (change 4G public ip/port), NMS, after his timeout settings behaviour, drops (correctly) the inactive session (I think identified on ip:port).

This would not be the real problem, but we use HLS indexing and on streaming restart also indexing restarts, from 0. On the other side, player, doesen't know this and try to find the-next-one-chunk (p.e. index5879.ts), forever, when the m3u8 has index0.ts, index1.ts, index2.ts.

The momentary workaround was to intercept this from our CDN network and reload webpage. It's works, but with a ugly end user experience.

Based on my past Vimeo experience, I have notice that they leave open session (based on random stream key token) for 5 minutes after you push GoLive button, regardless of whether rtmp encoder (OBS) is broadcasting or not, or even on connection drop and stream restarting.

Obviously I'm not asking for any of this, but I would like to understand if NMS has any tweaks that allow you to keep the session active on the same rtmp key

Thanks