go2rtc
go2rtc copied to clipboard
There is no retry mechanism for timeouts
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"
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!
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
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!
I was able to capture the logs for when the stream stops working for me:
Restarting go2rtc fixes the issue.
I proposed a short-term solution at:
- https://github.com/AlexxIT/go2rtc/pull/88
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.
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.
I still get timeouts and they don't seem to attempt a reconnection...
This works perfectly for me now. All streams have been up for several days now where before it would only be a few hours.
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}
Don't understand what you mean about "without loading the config yaml file". The restart mechanism works, as shown by your logs.
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.
@otherippo you're probably experiencing https://github.com/AlexxIT/go2rtc/issues/116
@NickM-27 yes it is exactly the same problem