[Config Support]: Home Assistant + Frigate Integration - Slow / Laggy Live Cam Stream #22753
Replies: 3 comments
|
Your WebRTC issues and laggy Home Assistant streams are likely caused by missing WebRTC configuration. WebRTC requires additional setup beyond just enabling go2rtc. WebRTC Configuration RequiredWebRTC works by creating a TCP or UDP connection on port 8555, but it requires extra configuration:(1) 1. Add WebRTC candidates to your go2rtc config: For internal/local access, you need to set the WebRTC candidates list. If go2rtc:
streams:
alfresco_main:
- rtsp://redacted:redacted@192.168.1.20:554/cam/realmonitor?channel=1&subtype=0
alfresco_live:
- rtsp://redacted:redacted@192.168.1.20:554/cam/realmonitor?channel=1&subtype=2
alfresco_detect:
- rtsp://redacted:redacted@192.168.1.20:554/cam/realmonitor?channel=1&subtype=3
webrtc:
candidates:
- 192.168.1.10:8555
- stun:85552. Expose port 8555 in Docker: Your docker-compose is missing the WebRTC port. Add these lines to your ports section:(1) ports:
- "5000:5000"
- "8971:8971"
- "8554:8554"
- "1984:1984"
- "8555:8555/tcp"
- "8555:8555/udp"Home Assistant RTSP AccessFor live streams to function in Home Assistant, they need to be accessible on the RTSP port (default: 8554) at Camera Settings RecommendationsFor the best live view experience, adjust these settings in your camera's firmware:(1)
Audio TranscodingIf MSE works but WebRTC doesn't, you may need to transcode audio to opus for WebRTC support. MSE requires PCMA/PCMU or AAC audio, while WebRTC requires PCMA/PCMU or opus audio:(1) go2rtc:
streams:
alfresco_live:
- rtsp://redacted:redacted@192.168.1.20:554/cam/realmonitor?channel=1&subtype=2
- "ffmpeg:alfresco_live#audio=opus"After making these changes, restart Frigate and test WebRTC again in the go2rtc web interface at port 1984. 📚 Sources: Have another question? Just tag @inkeep. |
|
Thanks BOT! :) I also added live_provider to my card to force choice of stream. `type: vertical-stack
|
|
It might also be worth looking at the 'Use Frigate-native WebRTC support' setting in HA Settings -> Devices + Services -> Frigate -> Options. I was struggling with similar problems yesterday (intermittent/lagging/no video) trying to get live views working with the Picture Entity card and enabling this resolved all issues for me. I think it's documented here: https://docs.frigate.video/configuration/live/ |



Your WebRTC issues and laggy Home Assistant streams are likely caused by missing WebRTC configuration. WebRTC requires additional setup beyond just enabling go2rtc.
WebRTC Configuration Required
WebRTC works by creating a TCP or UDP connection on port 8555, but it requires extra configuration:(1)
1. Add WebRTC candidates to your go2rtc config:
For internal/local access, you need to set the WebRTC candidates list. If
192.168.1.10is your Frigate host IP:(1)