Frigate Stream Not Loading? Fix Go2rtc & WebRTC In Home Assistant

Alex Johnson
-
Frigate Stream Not Loading? Fix Go2rtc & WebRTC In Home Assistant

Hey there! If you're scratching your head because your Frigate streams aren't showing up in Home Assistant (HA), even though they work fine in VLC, you're in the right place. This guide will walk you through troubleshooting and getting those streams up and running using go2rtc and WebRTC. We'll break down the common issues, what might be causing them, and how to fix them.

Understanding the Problem: Frigate, go2rtc, and Home Assistant

Let's start with the basics. You've got Frigate running on one machine, happily capturing those RTSP streams, and Home Assistant on another, where you want to view them. The issue? Your HA isn't displaying the stream, even though VLC can play it. This often boils down to how Home Assistant handles these streams and how go2rtc can help. go2rtc is a powerful tool designed to simplify streaming by translating and relaying various stream formats, making them compatible with different platforms, including Home Assistant's WebRTC integration.

The Role of go2rtc and WebRTC

go2rtc acts as a bridge, converting your RTSP streams into a format that Home Assistant can easily understand and display. WebRTC is the technology that actually delivers the video to your browser, offering low-latency streaming. When these two work in harmony, you get a smooth, real-time view of your Frigate cameras within your Home Assistant dashboard. The problem typically arises when go2rtc isn't configured correctly, network issues are present, or there's a mismatch between the stream format and what HA expects.

Common Symptoms of the Problem

  • Your camera stream shows a loading spinner in HA but never loads.
  • You get an error message related to the stream or WebRTC.
  • The stream works in VLC but not in your Home Assistant card.
  • High latency or buffering issues, even when the network seems fine.

If you're experiencing any of these, don't worry! We'll go through the most likely causes and how to fix them.

Step-by-Step Troubleshooting: Fixing Your Frigate Stream

Now, let's dive into the troubleshooting steps. We'll go through each potential cause and how to address it. Remember to test after each step to see if the issue is resolved.

1. Verify Your Network Configuration

Network issues are a common culprit. Ensure your Home Assistant machine can communicate with your Frigate instance. This is especially important if they are on different networks or VLANs.

  • Ping Test: From your Home Assistant machine, try pinging the IP address of your Frigate server. If you don't get a response, you have a network problem.
  • Firewall: Check your firewalls (on both machines and your router) to ensure they aren't blocking traffic between the two. You might need to open specific ports. For RTSP, the default port is 554, and for WebRTC, you'll need ports for STUN/TURN servers.
  • DNS Resolution: Make sure your Home Assistant can resolve the hostname of your Frigate server if you're using one instead of an IP address. Incorrect DNS settings can cause connection failures. Double-check that your Home Assistant's DNS settings are configured correctly.

2. Check Your Frigate Configuration

Your Frigate configuration is key. Double-check your config.yml file for any errors. Specifically, make sure your RTSP streams are configured correctly and that the paths are accurate.

  • RTSP URL: Ensure the RTSP URL is correct. It should look something like rtsp://<frigate_ip_address>:<port>/<path>. The port is usually 554, but it might be different in your setup. The path depends on your camera configuration in Frigate.
  • Camera Configuration: Within your Frigate config, review your camera settings. Make sure that the stream is enabled and that there are no typos in the camera names or paths. Any small mistake can break the stream.
  • Example Configuration Snippet:
    cameras:
      your_camera_name:
        ffmpeg:
          inputs:
            - path: rtsp://192.168.1.100:8554/your_stream_path
              roles: [ 'detect' ]
        detect:
          enabled: True
    

3. Review Your go2rtc Configuration

This is where many issues originate. Ensure go2rtc is correctly configured to receive your RTSP streams and make them available to Home Assistant. This involves setting up the correct source and verifying the WebRTC settings.

  • go2rtc.yaml: This is your primary configuration file. Check for any syntax errors or misconfigurations. The file should specify how go2rtc receives the streams from Frigate. It also defines how WebRTC will be used to serve these streams. Make sure go2rtc knows where to find the RTSP stream.
  • Source Configuration: Typically, you'll define your RTSP source in the streams section. For example:
    streams:
      your_camera_name:
        - rtsp://<frigate_ip_address>:<port>/<path>
    
    Replace <frigate_ip_address>, <port>, and <path> with your Frigate's details.
  • WebRTC Settings: Double-check your WebRTC settings to ensure they are correctly configured, and that STUN/TURN servers are set up if needed for external access or for optimal performance. Without proper STUN/TURN configuration, WebRTC might not work.
  • Restart go2rtc: After making changes to the go2rtc.yaml file, restart the go2rtc service to apply the new settings.

4. Home Assistant Card Configuration

The way you set up the card in Home Assistant is crucial. Even if go2rtc is configured correctly, a mistake here can prevent the stream from loading.

  • WebRTC Card: You should be using the WebRTC camera card. Make sure this card is installed and configured. This card directly leverages WebRTC for low-latency streaming.
  • Camera Entity: The card needs to be linked to the correct camera entity. This is usually the entity provided by the go2rtc integration. It will look like camera.your_camera_name.
  • Stream URL (If Applicable): In some cases, you might need to specify the stream URL in the card configuration. This URL will point to the go2rtc instance. It should use the webrtc protocol. For instance: webrtc://<home_assistant_ip_address>:8083/your_camera_name.
  • Example Card Configuration:
    type: custom:webrtc-camera
    entity: camera.your_camera_name
    

5. Check Home Assistant Logs

Home Assistant logs provide invaluable clues. Check the logs for any errors related to the camera stream, WebRTC, or go2rtc. These logs can pinpoint the exact cause of the problem.

  • Home Assistant Log: Go to Configuration -> Logs in Home Assistant and look for any error messages related to your cameras or WebRTC. These logs often include detailed information about what went wrong.
  • go2rtc Log: If go2rtc runs separately, check its logs as well. These logs will show whether go2rtc is receiving the stream from Frigate and if it's experiencing any errors. You can usually access these logs through the command line or the go2rtc web interface.
  • Interpreting Logs: Look for error messages like

You may also like