Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can stream auto reconnect ? #45

Open
zaozhao opened this issue Jun 5, 2020 · 5 comments
Open

Can stream auto reconnect ? #45

zaozhao opened this issue Jun 5, 2020 · 5 comments

Comments

@zaozhao
Copy link

zaozhao commented Jun 5, 2020

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
Copy link
Owner

Roverr commented Jul 20, 2020

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

  • When the stream is stored, it should do some kind of a backup mechnism. Like you know, the stream stops, and whenever reconnection is successful, there should be a moving process that backs up the previous record
  • When the stream is not stored, then you just have to reconnect. However here it is also missing to be able to process and understand errors occouring with the process

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
Copy link
Author

zaozhao commented Jul 31, 2020

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

@ankitkrsahu94
Copy link

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
Copy link

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

can you share your solving ?

@CudaNet
Copy link

CudaNet commented Oct 12, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants