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

panic: runtime error: slice bounds out of range #191

Closed
caraar12345 opened this issue Jan 22, 2023 · 1 comment
Closed

panic: runtime error: slice bounds out of range #191

caraar12345 opened this issue Jan 22, 2023 · 1 comment
Labels
question Further information is requested

Comments

@caraar12345
Copy link

Hey there,

Just set up go2rtc as a Home Assistant add-on rather than just using the component because pyunifiprotect intentionally ignores the hostname on the SSL cert in the RTSPS stream meaning I get the no IP in SANs error - which is fine, and expected.

As a result, I've added the cameras to the go2rtc.yaml file as below:

streams:
  camera1:
    - "rtsps://unifi.server.com:7441/cam1-1080p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam1-576p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam1-360p-secret?enableSrtp"
  camera2:
    - "rtsps://unifi.server.com:7441/cam2-1080p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam2-576p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam2-360p-secret?enableSrtp"
  camera3:
    - "rtsps://unifi.server.com:7441/cam3-1080p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam3-576p-secret?enableSrtp"
    - "rtsps://unifi.server.com:7441/cam3-360p-secret?enableSrtp"

However, when I try and open the stream from go2rtc through the RTSP link on go2rtc:1994 in VLC or the stream link in the browser, I get a slice bounds out of range error then the add-on crashes. I've provided 2 examples to show there's not one specific range that causes issues - seems to be random.

panic: runtime error: slice bounds out of range [4406:519]
goroutine 529 [running]:
github.com/AlexxIT/go2rtc/pkg/aac.RTPDepay.func1.1(0xc00024a310)
	github.com/AlexxIT/go2rtc/pkg/aac/rtp.go:22 +0x132
github.com/AlexxIT/go2rtc/pkg/streamer.(*Track).WriteRTP(0xc000298e70, 0xc000298cc0?)
	github.com/AlexxIT/go2rtc/pkg/streamer/track.go:42 +0xa2
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Handle(0xc00027e0f0)
	github.com/AlexxIT/go2rtc/pkg/rtsp/conn.go:792 +0x6b5
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Start(0xc00027e0f0?)
	github.com/AlexxIT/go2rtc/pkg/rtsp/streamer.go:47 +0x94
github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).worker(0xc00021a240, {0xc95a40?, 0xc00027e0f0?}, 0x3)
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:123 +0x35
created by github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).start
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:119 +0x1be
panic: runtime error: slice bounds out of range [4281:519]
goroutine 96 [running]:
github.com/AlexxIT/go2rtc/pkg/aac.RTPDepay.func1.1(0xc000250460)
	github.com/AlexxIT/go2rtc/pkg/aac/rtp.go:22 +0x132
github.com/AlexxIT/go2rtc/pkg/streamer.(*Track).WriteRTP(0xc000116420, 0xc000298090?)
	github.com/AlexxIT/go2rtc/pkg/streamer/track.go:42 +0xa2
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Handle(0xc0000940f0)
	github.com/AlexxIT/go2rtc/pkg/rtsp/conn.go:792 +0x6b5
github.com/AlexxIT/go2rtc/pkg/rtsp.(*Conn).Start(0xc0000940f0?)
	github.com/AlexxIT/go2rtc/pkg/rtsp/streamer.go:47 +0x94
github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).worker(0xc0002182d0, {0xc95a40?, 0xc0000940f0?}, 0x1)
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:123 +0x35
created by github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).start
	github.com/AlexxIT/go2rtc/cmd/streams/producer.go:119 +0x1be

Let me know if you need anything else!

@AlexxIT AlexxIT added the question Further information is requested label Jan 23, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 23, 2023

#81 you need to remove enableSrtp

@AlexxIT AlexxIT closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants