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

There is no retry mechanism for timeouts #39

Closed
fast8888 opened this issue Sep 12, 2022 · 14 comments
Closed

There is no retry mechanism for timeouts #39

fast8888 opened this issue Sep 12, 2022 · 14 comments
Labels
enhancement New feature or request
Milestone

Comments

@fast8888
Copy link

There is no retry mechanism for timeouts

I'm through FRP camera port public network, such as RTSP: / / 192.168.4.190:554 / ch01, the port 554 through the public network, and then to public server, link through the server, run for a few hours, if the network fluctuations, or FRP penetration is not stable, lead to broken links, Go2rtc, there is no way to re-link, can only restart GO2RTC

err log

�[36murl=�[0m"ffmpeg:rtsp://127.0.0.1:54189/ch0#channel=1#subtype=0#audio=opus#unicast=true#resolution=1280x720#video=vp9#raw=-vf transpose=2"
�[90m09:25:04.397�[0m �[1m�[31mERR�[0m�[0m [exec] timeout �[36murl=�[0m"exec:ffmpeg -hide_banner -allowed_media_types video+audio -fflags nobuffer -flags low_delay -rtsp_transport tcp -i rtsp://127.0.0.1:54189/ch0 -vf transpose=2 -codec:a libopus -ar 48000 -ac 2 -rtsp_transport tcp -f rtsp rtsp://localhost:8554/d40d0930ba209bfe3ee7a339de5253e4"

@AlexxIT AlexxIT added the enhancement New feature or request label Sep 12, 2022
@aderusha
Copy link

I'm seeing similar behavior. I have a FOSCAM camera that loves to occasionally drop off of wifi then immediately reconnect. I am restarting the go2rtc add-on several times a day in response which... isn't ideal.

Great tool though, outside of this one issue I love the add-on!

@mattbrad2
Copy link

Same behavior here as well, however these are wired cameras. Never had an issue before using RTSPtoWeb, but switched to go2rtc and occasionally random cameras will drop requiring a restart of go2rtc

@tsightler
Copy link
Contributor

tsightler commented Oct 1, 2022

Really great project here, works great with ring-mqtt project and gives fast camera startup and low latency. I'd like to start recommending this to ring-mqtt users as the preferred setup, but the retry issue is a little bit of a blocker as these cameras timeout a live view after 10 minutes and, after that, the only recourse is to restart go2rtc.

Would be really nice if the retry timeout was configurable vs hard coded.

Thanks again for all of your hard work on this!

@felipecrs
Copy link
Contributor

I was able to capture the logs for when the stream stops working for me:

image

Restarting go2rtc fixes the issue.

@felipecrs
Copy link
Contributor

I proposed a short-term solution at:

@spacebares
Copy link

Having same issue, especially on dashboards that load up 6+ cameras at once. Previously fine using other WebRTC solutions but they are too high cpu usage.

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 4, 2022

Should be fixed in https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-rc.1

go2rtc will try to instant reconnect to source. And will continue to try each 30 sec.

@AlexxIT AlexxIT closed this as completed Nov 4, 2022
@calisro
Copy link

calisro commented Nov 5, 2022

I still get timeouts and they don't seem to attempt a reconnection...

@mattbrad2
Copy link

This works perfectly for me now. All streams have been up for several days now where before it would only be a few hours.

@otherippo
Copy link

otherippo commented Dec 17, 2022

I noticed that this is still an issue on the latest release 0.1-rc.5.
One of my cameras sometimes has issues with wifi and the stream is not stable. go2rtc seems to restart but without loading the config yaml file (which contains the name and rtsp url for all my cameras). So no streams are available on go2rtc.

Here are some logs that I see after noticing that no streams are available anymore:

20:45:01.019 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:33232->xxx.xxx.xxx.xxx:14554: i/o timeout"
00:51:32.739 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:37842->xxx.xxx.xxx.xxx:14554: i/o timeout"
08:28:10.702 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="RTSP wrong input"
09:30:20.630 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:51142->xxx.xxx.xxx.xxx:14554: i/o timeout"
09:34:20.660 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:51678->xxx.xxx.xxx.xxx:14554: i/o timeout"
09:38:26.864 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:52168->xxx.xxx.xxx.xxx:14554: i/o timeout"
22:46:10.078 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:35568->xxx.xxx.xxx.xxx:14554: i/o timeout"
03:38:33.987 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:40084->xxx.xxx.xxx.xxx:14554: i/o timeout"
12:19:45.509 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:48548->xxx.xxx.xxx.xxx:14554: i/o timeout"
14:25:32.044 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:105 > error="read tcp xxx.xxx.xxx.xxx:37896->xxx.xxx.xxx.xxx:17554: i/o timeout"
2022/12/16 22:20:17 [INFO] mdns: Closing client {true false 0xc00000e848 <nil> 0xc00000e850 <nil> 1 0xc00003c7e0}

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 17, 2022

Don't understand what you mean about "without loading the config yaml file". The restart mechanism works, as shown by your logs.

@otherippo
Copy link

otherippo commented Dec 17, 2022

The config file go2rtc.yaml is mounted into the docker container. In the streams section all my cameras are listed by name and rtsp url. When I (re-)start the container go2rtc loads this config file and I can access all streams.

Now if an error occurs (like in the logs above) go2rtc restarts but doesn't load this config file. It behaves as if there was no config file, aka no cameras have been defined. So I can't access any stream until I manually restart the container.

@NickM-27
Copy link
Contributor

@otherippo you're probably experiencing #116

@otherippo
Copy link

@NickM-27 yes it is exactly the same problem

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

Successfully merging a pull request may close this issue.

10 participants