Camera Live View not working

HASS is 0.117.5 and supervisor 2020.11 running in docker on a RPI 3B+ on Raspbian 9 (Stretch)

I have a camera set up through Blue Iris, and the snapshot view works fine and updates every few seconds. However if I click on the view to see the live view (or select live view instead of auto in the lovelace configuration) it just gives me the broken graphic image (? in a box) instead of a live view.

I used to have zone minder before Blue Iris, and I had exactly the same issues there as well. Occasionally the live view worked, but most of the time it was broken.

I have looked at the camera entity under developer tools and if I cut and paste the stream_source URL into my web browser its very happily gives me a live stream from Blue Iris, but when its backed off through the camera_proxy_stream api url for live view it does not work.

If I try the camera_proxy_stream URL directly in my browser it also does not work. The URL looks like this:

https://external_domainname_for_hass:8123/api/camera_proxy_stream/camera.blueiris_driveway?token=xxxxxxxxx

The unhelpful error message from Safari is:

Safari can’t open the page.

The error is: “The operation couldn’t be completed. ( error 0.)” (:0)

In the logs I can see this :

2020-11-19 13:22:26 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy/camera.blueiris_driveway to xxx.xxx.xxx.xxx (auth: True)
2020-11-19 13:22:31 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy_stream/camera.blueiris_driveway to xxx.xxx.xxx.xxx (auth: False)
2020-11-19 13:22:36 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 92.27.243.137 for /api/camera_proxy/camera.blueiris_driveway using signed request
2020-11-19 13:22:36 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy/camera.blueiris_driveway to xxx.xxx.xxx.xxx (auth: True)

And I wonder if the (False) on auth has anything to do with the problem for the stream?

I have also just tested connecting directly to the raspberry pi URL

https://internal_ip_address_for_hass:8123/api/camera_proxy_stream/camera.blueiris_driveway?token=xxxxxxxxx

and the stream works directly on safari, but the log still shows auth: False, so I guess that has nothing to do with it.

2020-11-19 13:29:24 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/camera_proxy_stream/camera.blueiris_driveway to xxx.xxx.xxx.xxx (auth: False)

Im using OPNsense 20.7.4-amd64 as my firewall router, and have a port forward setup to send traffic on port 8123 to the raspberry pi. Its not doing anything fancy, but clearly must be screwing things up somehow I guess. I have no other issues with anything else on hass with this port forward.

Ok,

So I’m thinking this is not a configuration thing as after a bit more experimentation it works with CURL and in the Chrome Browser, but not in Safari.

Did you find a solution for this? I have the same problem in Safari on macOS and iOS but it works fine in Chrome / Brave, etc in macOS and find in the companion app on iOS.

No it’s still not working now.

Although there was a while it worked fine for a bit. Not sure if it was a OS upgrade of a Hass upgrade where it stopped working again, I didn’t really keep track of it unfortunately as we don’t watch the cameras all the time :slight_smile:

It seems to depend on the type of camera being used for me.

  • Reolink cameras via RTSP feed
    Works in all browsers / apps on all OSs as “live” camera view
  • IoT Link screen as camera via MQTT in “Binary (PNG)” format
    Only works in the companion app on iOS or Chrome / Brave, not Safari on any device, when set to “live”. Works on all devices / browsers if set to “auto” but then has caching issues where it will show the screen from days ago even if the PC is not on.
  • Camera from an Android tablet on the wall (used for a dashboard) via Wallpanel setup as an mjpeg stream
    Works on all devices / browsers if set to “auto” but no devices if set to “live”. Digging deeper it shows an underlying error of “Failed to load resource: the server responded with a status of 401 (Unauthorized)”. When I tried to set this up as a webpage card just pointing to the stream itself (i.e. http://192.168.1.199:2971/camera/stream) it complains with “Unable to load iframes pointing at websites using http: if Home Assistant is served over https:.”, wonder if that’s why.