ONVIF Integration and H265

I recently started to run into storage issues with my surveillance cameras on my NAS.
I was running all of them on H264. Three of them supported H265 so to save storage I changed them to H265.
This gave me a 30% improvement in storage.
I had also enabled ONVIF on all cameras so that I could use the ONVIF integration in HA.

Now when I double click on the still image, I cannot stream the cameras in HA that are running H265 (but do get a still image in my lovelace).

Looking at the ONVIF integration documentation it specifically looks for H264 to stream. I am guessing that the RTSP is set up to only look at the first stream profile now this is in H265 it’s broken?

Firefox gives a MIME error and Chrome just gives a black box
Firefox
image
Chrome
image

Is there any way around this?

This is error in Log
image
I note that @hunterjm is the owner of this code. Can you offer any solution please?

I have found a workaround.
All cameras concerned have at least two streams and some three.
The workaround was to set the Mainstream to H265. This is what Surveillance Station is using.
I then set the sub-stream to H264.
The entities for this sub-stream had been disabled in HA so I enabled them.
I then reconfigured my lovelace cards to use the sub-stream entitie(s) rather than the mainstream.
It worked. Now I have my streaming back in HA for these cameras.
The down side is that the highest resolution on sub-stream is 640x480 but at least it works.

The other thing that it proves is the H265 was definitely the problem and it would be great if this could be addressed.

You usually find that the second substream can do higher res then the first substream. However you can loose some features (certain smart alarms) when you turn on the 3rd stream, it will warn if you if that is the case.

1 Like

Thank You!
I had not enabled the third stream on my cameras so therefore I could not see it.
Once I scoured the manual on how to enable the third stream I was good to go.
Yes functions such as Face Detection, HDMI, H.264+ and H265+, are not supported when you enable the 3rd stream but I was not using them at this stage anyway.

In my efforts to understand what was happening I came across ONVIF profile T. It is supposed to support H264 and H265. I am not sure how the ONVIF integration is compiled but I could pose the question. Is it missing this profile or is the answer in the fact that Apple HLS is to blame again?

homeassistant media player needs to be updated to support h265, or just drop the media player alltogether and just use web player from default browser.