ONVIF Camera Stream Troubleshooting and Solution

I’ve been trying to get my ONVIF camera stream to work in Home Assistant, and I wanted to share my journey in case anyone else is facing similar issues. Initially, I set up the camera using the ONVIF platform in my configuration.yaml file. Everything seemed to work fine at first—the picture glance card updated every 10 seconds, and I could see the live feed. However, when I clicked on the camera to view the stream in a larger popup, it just wouldn’t load. I also noticed that the pan/tilt/zoom controls weren’t responding, which was a bit frustrating.

After some research, I found that the issue might be related to how FFmpeg was handling the stream. I tried running the FFmpeg command directly in the terminal, and it worked perfectly. This made me think that the problem was somewhere within Home Assistant’s configuration. I checked the logs and noticed that FFmpeg was using the rtsp:// protocol, which I knew worked because I could stream it in VLC.

I decided to tweak the configuration a bit. Instead of using the default settings, I added some extra parameters to the FFmpeg command to ensure it was handling the stream correctly. I also made sure that the camera’s RTSP port was properly configured and that there were no firewall issues blocking the connection.

After making these changes, I restarted Home Assistant and tested the stream again. This time, it worked like a charm! The larger popup loaded the stream without any issues, and the pan/tilt controls started responding as expected. It was a relief to finally get everything working smoothly.

For anyone else struggling with similar issues, I’d recommend checking your FFmpeg configuration, ensuring that the camera’s settings are correctly configured, and verifying that there are no network restrictions blocking the stream. If you’re still having trouble, reaching out to the Home Assistant community forums can be a great way to get additional support. Happy streaming everyone! :movie_camera: