Roverr / rtsp-stream

Out of box solution for RTSP - HLS live stream transcoding. Makes RTSP easy to play in browsers.
MIT License
713 stars 166 forks source link

Can stream auto reconnect ? #45

Open zaozhao opened 4 years ago

zaozhao commented 4 years ago

Hi,@Roverr, I'm coming again , and our project is running perfect in your help ! But i have a new question about disconnecting stream can't auto reconnect , always playing history , so i want to know how to reconnect it without request again ! Thanks again !

Roverr commented 4 years ago

Hi @zaozhao ,

Sorry for taking so long to answer. I have an ongoing project that eats up all my time so unfortunately I had to neglect this repository a bit.

Your concern is valid, the stream is corrently not flexible around reconnecting. The reason for it is that we have multiple scenarios

So as a summary, currently it is not possible, but I am hoping to add more fault tolerance during the summer. As a matter of fact, I already started this but did not have enough time to get deep enough in the topic.

zaozhao commented 4 years ago

Thank you for your reply , and i have solved this problem.

ankitkrsahu94 commented 4 years ago

Thank you for your reply , and i have solved this problem.

Hi @zaozhao, have done it in a generic way or in a way specific to your project ? Can you please share your approach, I've run into same problem of stream getting disconnect often.

lianmafutra commented 3 years ago

Thank you for your reply , and i have solved this problem.

can you share your solving ?

CudaNet commented 2 years ago

Hi,@Roverr,

I'm absolutely loving this Docker image (I've tried many). I've been studying it for the past few days and I too have realized a few things. Using the API, I perform a /list and at first, the state indicates 'running=true'. However, after a short period of time, this changes to false even though the process(es) are running fine. Perhaps I'm misinterpreting its use. If it was meant as I expected, I could use this to simply cycle the container and restart the streams.

Moving forward, ss the OP indicated above, I'm having issues keeping a constant stream (resilience). The FFMPEG appears to be the culprit in failing. I have 2 Unifi Protect WIFI cameras (+4 wired) and they misbehave to a point that causes FFMPEG to up and stop. The other 4 cameras (wired) don't exhibit this problem. A great method to reproduce the issue is to simply reboot the camera while the process (FFMEG) is converting. We can observe the FFMPEG PID stop for that specific stream and it doesn't/won't recover. Well, gracefully that is. I can however restart the FFMPEG (within the container) and everything recovers perfectly. So it's a matter of monitoring the process(es) and restarting the failed PID/alias.

My environment commands are, -e RTSP_STREAM_CLEANUP_ENABLED="false" -e RTSP_STREAM_AUDIO_ENABLED="false" . So basically my goal is to keep the streams persistent/constant. This makes for a great UI experience (home automation). I'm going to explore 'Monit' and see if I can overcome this until this is corrected within this project. I'll post a solution when/if I can find one that meets my needs.

If anyone has found/uses a monitor/restart the PID please share here as this is an amazing project.