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

Assert in fails when go2rtc connects to Neolink when the camera is off. #481

Closed
PeterPalenik opened this issue Jun 20, 2023 · 2 comments
Closed
Labels
bug Something isn't working panic
Milestone

Comments

@PeterPalenik
Copy link

I have a Reolink camera with a proprietary stream protocol and I'm using Neolink (as a docker image) to convert it to RTSP. Sometimes when the camera is not in use, I turn it off (unplug it). In this case, go2rtc starts failing completely on an assert and exits. That disrupts all my cameras, as all go through go2rtc.
This behavior started I believe after 1.2.0. Reverting to 1.2.0 mitigates this.

If the Neolink instance is down, it fails on "dial tcp x.x.x.x:554: connect: no route to host" and this doesn't bring the whole go2rtc instance down, only triggers a retry on the stream.

I believe what's happening is, that neolink is probably creating a rtsp stream which is "empty" when the camera is down, and go2rtc can't handle that. It would probably be the best if if the assertions didn't bring the whole instance down, only the stream that's faulty.

Here's the stacktrace from the failed assertion:

17:03:15.408 DBG [rtsp] new consumer stream=kamera-chuvicka
panic: github.com/AlexxIT/go2rtc/pkg/rtsp/consumer.go:15
goroutine 165 [running]:
github.com/AlexxIT/go2rtc/pkg/core.Assert(0xc6?)
	github.com/AlexxIT/go2rtc/pkg/core/helpers.go:68 +0x7c
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).GetMedias(0xc000298240)
	github.com/AlexxIT/go2rtc/pkg/rtsp/consumer.go:15 +0x28
github.com/AlexxIT/go2rtc/internal/streams.(*Producer).GetMedias(0xc00012c870?)
	github.com/AlexxIT/go2rtc/internal/streams/producer.go:63 +0xab
github.com/AlexxIT/go2rtc/internal/streams.(*Stream).AddConsumer(0xc000190780, {0xd5ce40, 0xc000298000})
	github.com/AlexxIT/go2rtc/internal/streams/stream.go:69 +0x612
github.com/AlexxIT/go2rtc/internal/rtsp.tcpHandler.func1({0xb3bb40?, 0xd565e0?})
	github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:190 +0x63f
github.com/AlexxIT/go2rtc/pkg/core.(*Listener).Fire(...)
	github.com/AlexxIT/go2rtc/pkg/core/listener.go:16
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Accept(0xc000298000)
	github.com/AlexxIT/go2rtc/pkg/rtsp/server.go:94 +0xbcc
github.com/AlexxIT/go2rtc/internal/rtsp.tcpHandler(0xc000298000)
	github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:222 +0x1ad
created by github.com/AlexxIT/go2rtc/internal/rtsp.Init.func1
	github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:75 +0x48
17:03:16.410 INF go2rtc version 1.5.0 linux/amd64

Thanks

@AlexxIT AlexxIT added bug Something isn't working panic labels Jun 26, 2023
AlexxIT added a commit that referenced this issue Jun 28, 2023
@AlexxIT AlexxIT added this to the v1.6.0 milestone Jun 28, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jul 11, 2023

@AlexxIT AlexxIT closed this as completed Jul 11, 2023
felipecrs pushed a commit to felipecrs/go2rtc that referenced this issue Oct 20, 2023
@Caddyman68
Copy link

I am trying to add 2 Reolink Lumus cameras to Go2RTC in Frigate via Neolink as the OP did with his Reolink. I currently have them working in the Generic Camera integration at "rtsp://192.168.1.100:8554/camera_name" and in Frigate with this as the path under "cameras". Note: 192.168.1.100 is my Home Assistant URL. What are the syntax to include them in Go2RTC and then in cameras in Frigate?
I tried "rtsp://192.168.1.100:8554/camera_name" with or without the port in streams and " path: rtsp://127.0.0.1:8554/camera_name" under cameras/camera_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working panic
Projects
None yet
Development

No branches or pull requests

3 participants