Closed duindain closed 11 months ago
You can not use the ffmpeg:
for this as that is the ffmpeg source, meanwhile the issue you linked said the #headers
parameter is only supported for the http/https source
Thanks @NickM-27 I didn't notice that when reading it yesturday
I had to change the version of go2rtc to support https stream with insecure cert using the httpx protocol
Ive changed the config a few times this morning the latest is this
doorcam:
- "kasa://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd#header=Authorization: Basic Base 64 encoded password the rebase64 encoded email]"
- "ffmpeg:doorcam#video=h264#audio=opus"
I did try this first
doorcam:
- "httpx://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd#header=Authorization: Basic Base 64 encoded password the rebase64 encoded email]"
- "ffmpeg:doorcam#video=h264#audio=opus"
I'm currently getting in the go2rtc logs
2023-10-03 07:27:04.704917922 [INFO] Preparing go2rtc config...
2023-10-03 07:27:04.862217433 [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one
2023-10-03 07:27:04.862221591 [INFO] Starting go2rtc...
2023-10-03 07:27:04.920456907 07:27:04.920 INF go2rtc version 1.7.1 linux/amd64
2023-10-03 07:27:04.920614674 07:27:04.920 INF [api] listen addr=0.0.0.0:1984
2023-10-03 07:27:04.920803279 07:27:04.920 INF [rtsp] listen addr=0.0.0.0:8554
2023-10-03 07:27:04.920898017 07:27:04.920 INF [webrtc] listen addr=0.0.0.0:8555/tcp
2023-10-03 07:27:11.058046652 07:27:11.057 WRN [rtsp] error="streams: unexpected EOF, exec: exit status 1" stream=doorcam
2023-10-03 07:27:14.705443818 [INFO] Starting go2rtc healthcheck service...
2023-10-03 07:27:16.171171378 07:27:16.171 WRN [rtsp] error="streams: unexpected EOF, exec: exit status 1" stream=doorcam
2023-10-03 07:30:55.918648675 07:30:55.918 WRN github.com/AlexxIT/go2rtc/internal/rtsp/rtsp.go:225 > error="write tcp 127.0.0.1:8554->127.0.0.1:55400: write: broken pipe"
The frigate logs show invalid data error
2023-10-03 07:27:05.470760115 [2023-10-03 07:27:05] frigate.app INFO : Capture process started for doorcam: 769
2023-10-03 07:27:10.614914040 [2023-10-03 07:27:10] frigate.video ERROR : doorcam: Unable to read frames from ffmpeg process.
2023-10-03 07:27:10.615572810 [2023-10-03 07:27:10] frigate.video ERROR : doorcam: ffmpeg process is not running. exiting capture thread...
2023-10-03 07:27:25.486941488 [2023-10-03 07:27:25] watchdog.doorcam ERROR : Ffmpeg process crashed unexpectedly for doorcam.
2023-10-03 07:27:25.487003545 [2023-10-03 07:27:25] watchdog.doorcam ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-10-03 07:27:25.487052187 [2023-10-03 07:27:25] ffmpeg.doorcam.detect ERROR : rtsp://127.0.0.1:8554/doorcam?video=copy: Invalid data found when processing input
I've tried removing all the audio config from the stream to decomplicate it but that had the same issue and log messages on both sections
I don't think kasa://
is a supported protocol / input type in go2rtc? I'd suggest posting logs with httpx://
Its new and the logs were the same between both https://github.com/AlexxIT/go2rtc#source-kasa
I see, regardless these errors are occurring in go2rtc so I think it would be best to make an issue on that repo
Thanks, I've posted the issue there now, fingers crossed Ill close this with info to help others if its solved soon, thx for your help @NickM-27
Looks like this is working now per the linked issue.
Yes its working thanks to troubleshooting from @AlexxIT Thanks everyone for taking a look
Describe the problem you are having
I'm trying to integrate this camera KD110 into Frigate to use it with HomeAssistant, I've managed to get it working in HomeAssistant using Scrypted but it seems thats for HomeKit not Frigate, so I'm retrying with just adding the camera into frigate first then i can use the existing plugin for frigate in HomeAssistant
Using this string in scripted for FFMPEG camera config it connects and can stream
-headers "Authorization: Basic ***[Base 64 encoded password the rebase64 encoded email]***" -f h264 -i https://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd
The camera doesn't work with username:password@ip in the url unfortunately but with the header injected does work
Adding into the Frigate config doesn't work so far
I got the pattern for header injection from https://github.com/AlexxIT/go2rtc/issues/64 for go2rtc
I'm not sure if its failing on the go2rtc config or the separate camera config lower, I've tried quite a few combinations so far without any luck
I suspect I'm configuring it completely wrong as its a combination of things that were already working and random help doco and camera configs from various googling
Would be great to hear any other pointers about my config too, i am waiting for shipping on a google coral so don't have that in there yet, and no gpu in this system, the other 6 cameras are reolink 811A's and they show up ok
Thanks
Version
0.12.1-367d724
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Debian
Install method
Docker Compose
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
Kasa KD110
Any other information that may be helpful
This is the console output from Scrypted FFMPEG camera plugin where the camera successfully connects and streams, though the audio is broken it seems
linux x64 #1 SMP PREEMPT_DYNAMIC Wed Aug 16 18:11:54 UTC 2023 server version: 0.55.0 plugin version: @scrypted/ffmpeg-camera 0.0.22 full ######################## 10/1/2023, 2:06:26 PM ######################## [HomeKit]: Device is in accessory mode and is online. HomeKit services are being published. Rebroadcast Plugin: prebuffer sessions starting in 5 seconds Rebroadcast Plugin: Stream 1 prebuffer session started Rebroadcast Plugin: Stream 1 prebuffer session starting Rebroadcast Plugin: -hide_banner -fflags +genpts -headers Authorization: Basic [Base 64 encoded password the rebase64 encoded email] -f h264 -i https:[REDACTED] -rtsp_transport tcp -vcodec copy -acodec copy -f rtsp rtsp://127.0.0.1:35977/56cde26392c964a4 Rebroadcast Plugin: https @ 0x561332797340: No trailing CRLF found in HTTP header. Adding it. Rebroadcast Plugin: Input #0, h264, from 'https://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd': Rebroadcast Plugin: Duration: N/A, bitrate: N/A Rebroadcast Plugin: Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, 15 fps, 15 tbr, 1200k tbn, 30 tbc Rebroadcast Plugin: No audio stream detected. Rebroadcast Plugin: Output #0, rtsp, to 'rtsp://127.0.0.1:35977/56cde26392c964a4':
Rebroadcast Plugin: encoder : Lavf58.76.100 Rebroadcast Plugin: Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, q=2-31, 15 fps, 15 tbr, 90k tbn, 15 tbc Rebroadcast Plugin: Stream mapping: Rebroadcast Plugin: Stream #0:0 -> #0:0 (copy) Rebroadcast Plugin: Press [q] to stop, [?] for help Rebroadcast Plugin: [rtsp @ 0x561332ac0040] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly Rebroadcast Plugin: frame= 1 fps=0.0 q=-1.0 size=N/A time=00:00:00.00 bitrate=N/A speed=N/A Rebroadcast Plugin: video/audio detected, discarding further input ######################## 10/1/2023, 2:25:15 PM ######################## Rebroadcast Plugin: sending prebuffer 6000 Rebroadcast Plugin: Stream 1 active rebroadcast clients: 1 Rebroadcast Plugin: Stream 1 active rebroadcast clients: 0 ######################## 10/1/2023, 2:50:49 PM ######################## Rebroadcast Plugin: sending prebuffer 6000 Rebroadcast Plugin: sending prebuffer 6000 ######################## 10/1/2023, 3:12:08 PM ######################## Rebroadcast Plugin: sending prebuffer 6000 ######################## 10/2/2023, 2:00:15 AM ######################## Rebroadcast Plugin: prebuffer sessions starting in 5 seconds Rebroadcast Plugin: Stream 1 prebuffer session started Rebroadcast Plugin: Stream 1 prebuffer session starting Rebroadcast Plugin: -hide_banner -fflags +genpts -headers Authorization: Basic [Base 64 encoded password the rebase64 encoded email] -f h264 -i https:[REDACTED] -rtsp_transport tcp -vcodec copy -acodec copy -f rtsp rtsp://127.0.0.1:42875/980411646ee4cf15 Rebroadcast Plugin: [https @ 0x561cc8996340] No trailing CRLF found in HTTP header. Adding it. Rebroadcast Plugin: Input #0, h264, from 'https://192.168.2.26:19443/https/stream/mixed?video=h264&audio=g711&resolution=hd': Rebroadcast Plugin: Duration: N/A, bitrate: N/A Rebroadcast Plugin: Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, Rebroadcast Plugin: 14 fps, 14 tbr, 1200k tbn, 28 tbc Rebroadcast Plugin: No audio stream detected. Rebroadcast Plugin: Output #0, rtsp, to 'rtsp://127.0.0.1:42875/980411646ee4cf15':
Rebroadcast Plugin: encoder : Lavf58.76.100 Rebroadcast Plugin: Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, q=2-31, 14 fps, 14 tbr, 90k tbn, 14 tbc Rebroadcast Plugin: Stream mapping: Rebroadcast Plugin: Stream #0:0 -> #0:0 (copy) Rebroadcast Plugin: Press [q] to stop, [?] for help Rebroadcast Plugin: [rtsp @ 0x561cc8ce0880] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly Rebroadcast Plugin: frame= 1 fps=0.0 q=-1.0 size=N/A time=00:00:00.00 bitrate=N/A speed=N/A Rebroadcast Plugin: video/audio detected, discarding further input ######################## 10/2/2023, 10:56:04 AM ######################## Rebroadcast Plugin: sending prebuffer 6000 ######################## 10/2/2023, 11:18:19 AM ######################## Rebroadcast Plugin: sending prebuffer 6000 [WebRTC Plugin]: signalingState have-remote-offer [WebRTC Plugin]: iceGatheringState gathering [WebRTC Plugin]: signalingState stable [WebRTC Plugin]: connectionState connecting [WebRTC Plugin]: iceConnectionState checking [WebRTC Plugin]: waiting ice connected [WebRTC Plugin]: iceConnectionState completed [WebRTC Plugin]: iceGatheringState complete [WebRTC Plugin]: iceConnectionState connected [WebRTC Plugin]: connectionState connected [WebRTC Plugin]: ice transport { ipv4: true, isLocalNetwork: true, destinationId: '192.168.2.31' } [WebRTC Plugin]: Connection is local network: true [WebRTC Plugin]: done waiting ice connected Rebroadcast Plugin: Selected stream Stream 1 Rebroadcast Plugin: sending prebuffer 3995.5 Rebroadcast Plugin: Stream 1 active rebroadcast clients: 1 RTC Connection Bridge: Client Stream Profile { RTC Connection Bridge: transcodeBaseline: false, RTC Connection Bridge: sessionSupportsH264High: true, RTC Connection Bridge: maximumCompatibilityMode: false, RTC Connection Bridge: userAgent: 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0', RTC Connection Bridge: capabilities: { RTC Connection Bridge: audio: { codecs: [Array], headerExtensions: [Array] }, RTC Connection Bridge: video: { codecs: [Array], headerExtensions: [Array] }
RTC Connection Bridge: screen: { devicePixelRatio: 1, width: 2560, height: 1440 }
RTC Connection Bridge: rtsp/tcp h264 RTC Connection Bridge: a/v h264 opus found h264 undefined RTC Connection Bridge: audio section not found in sdp. RTC Connection Bridge: bypassing ffmpeg, perfect codecs RTC Connection Bridge: first video packet 730 [WebRTC Plugin]: signalingState closed [WebRTC Plugin]: connectionState closed [WebRTC Plugin]: iceConnectionState closed Rebroadcast Plugin: Stream 1 active rebroadcast clients: 0
I've tested access through the frigate docker container using
docker run -it --net container:frigate nicolaka/netshoot f51e51c4b7d0 ~ ping 192.168.2.26 PING 192.168.2.26 (192.168.2.26) 56(84) bytes of data. 64 bytes from 192.168.2.26: icmp_seq=1 ttl=63 time=3.07 ms 64 bytes from 192.168.2.26: icmp_seq=2 ttl=63 time=2.96 ms 64 bytes from 192.168.2.26: icmp_seq=3 ttl=63 time=2.30 ms 64 bytes from 192.168.2.26: icmp_seq=4 ttl=63 time=2.01 ms
nmap shows port 9999 open from the host to the camera and from the docker container to the camera, i suspect thats ok as authenticating within scripted still works on port 19443 regardless