How do I setup frigate with Camera which has dynamic RTSP links changing all the time #22919
Replies: 9 comments
|
Your approach using ONVIF in go2rtc is correct for cameras with dynamic RTSP URLs - go2rtc will automatically discover and use the current stream path via ONVIF.(1) For the high CPU usage issue, here are some things to check: Verify Hardware Acceleration is WorkingYour config shows If you're running on Intel, ensure you have the correct driver. The default driver is Reduce ConnectionsSince you're already using the restream, your config looks correct. Make sure both detect and record are pulling from the go2rtc restream at Check Stream CodecIf your camera is sending H.265 and your browser/system doesn't support it natively, go2rtc may be transcoding. You can check this in the go2rtc web interface at port 1984.(3) If transcoding is occurring, that would explain the high CPU usage. Try adding hardware-accelerated transcoding if needed: go2rtc:
streams:
vimtag:
- "onvif://admin:password@192.168.1.22:80"
- "ffmpeg:vimtag#video=h264#hardware"Additional Recommendations
📚 Sources: Have another question? Just tag @inkeep. |
|
@inkeep how do I check sub stream resolution in Frigate UI? |
|
Frigate can automatically detect your stream resolution, so you don't need to manually specify the However, I don't have specific documentation on where in the Frigate UI you can view the detected stream resolution. You can check your stream details through the go2rtc web interface which runs on port 1984. This will show you information about your streams including resolution and codec details. For the detect stream specifically, if you want to explicitly set or verify the resolution, you can configure it in your camera config: cameras:
vimtag:
detect:
width: 640 # <- optional, by default Frigate tries to automatically detect resolution
height: 480 # <- optional, by default Frigate tries to automatically detect resolutionYou might also find useful information in Settings → Debug in the Frigate UI, which shows debug views for your cameras including detection information.(2) 📚 Sources: Have another question? Just tag @inkeep. |
|
@inkeep this is info from go2rtc , fo you see reason why CPU usage would be high? { "producers": [ { "id": 23, "format_name": "rtsp", "protocol": "rtsp+tcp", "remote_addr": "192.168.20.51:554", "url": "rtsp://admin:November78%2A@192.168.20.51:554/live/1jfiegbshazua_p0_IGHHPFOVUNAX", "sdp": "v=0\r\no=shenzhenmining\r\ns=sample\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=framerate:25\r\na=fmtp:96 profile-level-id=4D0032; packetization-mode=1; sprop-parameter-sets=Z00AMo2NQBQAWtNwEBAUAAAjKAAFfkAQ,aO44gA==\r\na=control:trackID=1\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 mpeg4-generic/16000/1\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;constantDuration=1024;config=1408\r\na=control:trackID=2\r\n", "user_agent": "go2rtc/1.9.10", "medias": [ "video, recvonly, H264", "audio, recvonly, MPEG4-GENERIC/16000" ], "receivers": [ { "id": 25, "codec": { "codec_name": "h264", "codec_type": "video", "level": 50, "profile": "Main" }, "childs": [ 26 ], "bytes": 54121660, "packets": 60339 }, { "id": 31, "codec": { "codec_name": "aac", "codec_type": "audio", "sample_rate": 16000 }, "childs": [ 32 ], "bytes": 1078125, "packets": 8625 } ], "bytes_recv": 56338853 }, { "url": "ffmpeg:vimtag#video=h264#hardware" } ], "consumers": [ { "id": 21, "format_name": "rtsp", "protocol": "rtsp+tcp", "remote_addr": "127.0.0.1:54336", "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.9.10\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 profile-level-id=4D0032; packetization-mode=1; sprop-parameter-sets=Z00AMo2NQBQAWtNwEBAUAAAjKAAFfkAQ,aO44gA==\r\na=recvonly\r\na=control:trackID=0\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 MPEG4-GENERIC/16000\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;constantDuration=1024;config=1408\r\na=recvonly\r\na=control:trackID=1\r\n", "user_agent": "FFmpeg Frigate/0.17.1-416a9b7", "medias": [ "video, sendonly, ANY", "audio, sendonly, ANY" ], "senders": [ { "id": 26, "codec": { "codec_name": "h264", "codec_type": "video", "level": 50, "profile": "Main" }, "parent": 25, "bytes": 54121660, "packets": 60339 }, { "id": 32, "codec": { "codec_name": "aac", "codec_type": "audio", "sample_rate": 16000 }, "parent": 31, "bytes": 1078125, "packets": 8625 } ], "bytes_send": 56303209 } ] } |
|
Looking at your go2rtc output, I can see a potential issue: You have Since your stream is already H.264, you don't need the ffmpeg transcoding line. Try removing it from your go2rtc config: go2rtc:
streams:
vimtag:
- "onvif://admin:password@192.168.1.22:80"
# Remove the ffmpeg line - your stream is already H.264The transcoding line is only needed when your camera sends H.265 and you need H.264 for compatibility.(1) Additional observations from your stream info:
Check Frigate logs for any FFmpeg errors related to hwaccel to verify hardware decoding is actually being used.(3) 📚 Sources: Have another question? Just tag @inkeep. |
|
@inkeep how to remove audio stream to avoid reencoding? |
|
If your camera does not have audio or you want to strip the audio stream to avoid any processing, configure go2rtc to send video only:(1) go2rtc:
streams:
vimtag:
- ffmpeg:rtsp://admin:password@192.168.20.51:554/live/stream_path#video=copyFor your ONVIF setup, you can apply the same approach: go2rtc:
streams:
vimtag:
- "ffmpeg:onvif://admin:password@192.168.1.22:80#video=copy"The 📚 Sources: Have another question? Just tag @inkeep. |
|
@inkeep if I use this go2RTC setup they both point to the main 2K stream . How should I configur go2RTC to pick up lower sub stream?
|
|
Your ONVIF substream configuration syntax with go2rtc supports many stream types beyond ONVIF.(1) If the ONVIF substream discovery isn't working, you can try using the direct RTSP URL for the substream instead. You'll need to find the actual RTSP path your camera uses for the substream (check your camera's settings or documentation). For example, based on similar camera configurations: go2rtc:
streams:
vimtag:
- "onvif://admin:password@192.168.1.22:80"
vimtag_sub:
- rtsp://admin:password@192.168.1.22:554/0/av1 # Direct RTSP path to substreamThen in your Frigate camera config, use the substream for detection: cameras:
vimtag:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/vimtag
roles:
- record
- path: rtsp://127.0.0.1:8554/vimtag_sub
roles:
- detectTo find your camera's substream RTSP path, check the go2rtc web interface at port 1984 - it may show the available streams discovered via ONVIF.(1) Alternatively, consult your Vimtag camera's documentation or settings page for the substream URL format. 📚 Sources: Have another question? Just tag @inkeep. |
Uh oh!
There was an error while loading. Please reload this page.
rtsp://admin:****@192.168.20.51:554/live/1jfiegbshazua_p3_BUQIBZRTFARN
the last part of the stream is chaging all the time. This setup works but my ffmpeg is using 30% of CPU all the time. Tried increasing threshold for motion lower fps , using low res for detection, nothing helps.
the camera is 15$ Amazon Vimtag
`go2rtc:
streams:
vimtag: # Name it whatever you want
- "onvif://admin:@192.168.1.22:80" # Main ONVIF connection
vimtag_sub: # Optional lower-res stream for detection
- "onvif://admin:@192.168.1.22:80?profile=sub"
cameras:
vimtag:
ffmpeg:
hwaccel_args: preset-vaapi # Change based on your hardware (nvidia, intel-qsv, etc.)
inputs:
- path: rtsp://127.0.0.1:8554/vimtag
roles:
- record
- path: rtsp://127.0.0.1:8554/vimtag_sub
roles:
- detect
detect:
width: 640
height: 480
fps: 5
onvif: # Optional – for PTZ if your camera supports it
host: 192.168.1.22
port: 80
user: admin
password: *`
All reactions