Closed jherby2k closed 1 year ago
go2rtc:
streams:
driveway:
- rtsp://192.168.2.206:80/ch0_0.264
- ffmpeg:driveway#audio=opus
driveway_sub:
- rtsp://192.168.2.206:80/ch0_1.264
- ffmpeg:driveway_sub#audio=opus
side note: what does input_args: preset-rtsp-restream actually do? I see no difference if i exclude it.
go2rtc returns a much more stable stream compared to the camera. Without these input args your recordings will likely have stuttering and hitching due to the default input args
hmm not sure that's working. Looking at the restream in VLC still shows a-law not opus.
what url are you using in VLC?
rtsp://192.168.1.2:8554/back_door for example
right, but that stream has multiple audio tracks and go2rtc will pick one. If you want it to use opus then you need to use rtsp://192.168.1.2:8554/back_door?video=copy&audio=opus
That URL shows no audio streams, while rtsp://192.168.1.2:8554/back_door?video=copy&audio=pcma works. Doesn't appear to be transcoding.
rtsp://192.168.1.2:8554/driveway?video=copy&audio=aac also doesn't show any audio stream (added ffmpeg:back_door#audio=aac#audio=opus)
okay, can you go to http://ha_ip:5000/live/webrtc
and click the info button for that camera and paste the output here
{
"producers": [
{
"type": "RTSP source",
"url": "rtsp://192.168.2.206:80/ch0_0.264",
"remote_addr": "192.168.2.206:80",
"user_agent": "go2rtc/0.1-rc.9",
"medias": [
"video, sendonly, 96 H264/90000",
"audio, sendonly, 8 PCMA/8000"
],
"tracks": [
"96 H264/90000, sinks=1",
"8 PCMA/8000, sinks=1"
],
"recv": 1996102
},
{
"url": "ffmpeg:driveway#audio=opus"
}
],
"consumers": [
{
"type": "RTSP client",
"url": "rtsp://192.168.1.2:8554/driveway",
"remote_addr": "192.168.1.94:31075",
"user_agent": "LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)",
"medias": [
"video, recvonly, 96 H264/90000",
"audio, recvonly, 97 PCMA/8000"
],
"tracks": [
"96 H264/90000, sinks=1",
"97 PCMA/8000, sinks=1"
],
"recv": 156,
"send": 1996102
}
]
}
thanks, and can you show the same thing when using rtsp://192.168.1.2:8554/driveway?video=copy&audio=opus
?
{
"producers": [
{
"type": "RTSP source",
"url": "rtsp://192.168.2.206:80/ch0_0.264",
"remote_addr": "192.168.2.206:80",
"user_agent": "go2rtc/0.1-rc.9",
"medias": [
"video, sendonly, 96 H264/90000",
"audio, sendonly, 8 PCMA/8000"
],
"tracks": [
"96 H264/90000, sinks=1",
"8 PCMA/8000, sinks=0"
],
"recv": 14997560
},
{
"url": "ffmpeg:driveway#audio=opus"
}
],
"consumers": [
{
"type": "RTSP client",
"url": "rtsp://192.168.1.2:8554/driveway?video=copy\u0026audio=opus",
"remote_addr": "192.168.1.94:31123",
"user_agent": "LibVLC/3.0.17.4 (LIVE555 Streaming Media v2016.11.28)",
"medias": [
"video, recvonly, 96 H264/90000",
"audio, recvonly, 0 OPUS/0"
],
"tracks": [
"96 H264/90000, sinks=1"
],
"recv": 624,
"send": 16411828
}
]
}
so it is working as it should just sending no opus audio, might be an issue with ffmpeg trying to transcode to opus, maybe file a bug with go2rtc
OK i can do that, as long as you're seeing the correct behavior. Does the same thing with AAC.
I think that would explain why using ffmpeg:
only also has problems, because the process exits with code 1 for some reason
QQ: any way to set the log level for go2rtc? I tried adding:
go2rtc:
log:
exec: trace
but its not working. go2rtc can't investigate without some better logs
Set it like this:
go2rtc:
log:
format: text
exec: trace
OK i've opened up https://github.com/AlexxIT/go2rtc/issues/179. I think it might still be a frigate-specific issue (possibly specific to HASS addon?) as its failing with 'address already in use' or 'cannot assign requested address'
Just curious, have you setup the (disabled by default) port 8554 mapping ?
yes. streams accessible remotely.
so what if instead of 127... you use 192.168.1.2:8554 ? (for the frigate stream I mean)
Same error.
So i just tried disabling this camera in frigate entirely, just left the go2rtc section in place. No errors on startup, but this shows up when i try to connect via VLC:
2023-01-17 19:23:54.672353923 19:23:54.670 DBG [exec] run url="exec:ffmpeg -hide_banner -allowed_media_types audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://192.168.2.206:80/ch0_0.264 -vn -map 0:a:0? -c:a:0 aac -map 0:a:0? -c:a:1 libopus -ar:a:1 48000 -ac:a:1 2 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/b008b7886d713602c3dd78c244faafa5"
2023-01-17 19:23:54.975384688 [rtsp @ 0x55739d91b0] Unable to open RTSP for listening
2023-01-17 19:23:54.975454947 rtsp://192.168.2.206:80/ch0_0.264: Cannot assign requested address
2023-01-17 19:23:54.989883755 19:23:54.989 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:rtsp://192.168.2.206:80/ch0_0.264#audio=aac#audio=opus
2023-01-17 19:23:54.990824800 19:23:54.989 WRN [rtsp] error="source 0 error: exec: exit status 1" stream=driveway
2023-01-17 19:23:54.994559334 19:23:54.994 WRN github.com/AlexxIT/go2rtc/cmd/rtsp/rtsp.go:203 > error=EOF
What happens if you add
rtsp:
listen: ":8559"
under go2rtc and change all references in the container 8554
-> 8559
rtsp://localhost:8559/driveway?audio: Address already in use.
Also tried turning off port 8554 forwarding for the container. Same.
What device are you running on?
Doesn't make sense that it would fail like that inside the container
Pi 4. HASSOS 64-bit. Tried turning hwaccel off and it makes no difference.
To be clear, i'm pretty sure this was as issue under beta 3 etc (needed force_audio=false). and i'm not really stressed about not having audio - just trying to help you guys with the beta.
I wonder if there is some bug with arm64 clients, another arm user has been having the same issue.
I think I know what the problem is. For arm64 we are using ffmpeg4 and for amd64 we are using ffmpeg5, ffmpeg4 has the stimeout
argument, but go2rtc assumes ffmpeg5 and uses the timeout
arg meanwhile that arg is not supported on arm platforms so this error happens.
@jherby2k can you please add
ffmpeg:
rtsp: "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
to the go2rtc config and confirm that this now works?
You sir, are a machine. Works!
Great thanks, we can definitely fix this on our side so please close the go2rtc issue saying it's a Frigate issue
Describe the problem you are having
If I follow the beta 4 instructions here, go2rtc crashes with an exit code 1. This was "fixed" in beta 3 by setting
so I took a look at the beta 3 code and made the changes you can see below. Just curious a) why using ffmpeg: doesn't work, and b) if maybe this should be in the docs.
My camera streams appear to be h264 video and a-law. Don't really care about the audio so this config works for me.
side note: what does input_args: preset-rtsp-restream actually do? I see no difference if i exclude it.
Version
0.12 beta 4
Frigate config file
Relevant log output
Frigate stats
No response
Operating system
HassOS
Install method
HassOS Addon
Coral version
USB
Any other information that may be helpful
No response