H.265 support in generic camera integration

I have a [generic Chinese] camera which only supports H.265, no H.264 option. RTSP streaming works fine to VLC but the HA generic camera integration spins forever when trying to create the preview, which I guess means that the generic camera integration does not support H.265.

Please can the generic camera support H.265?

afaik this is a problem with the browsers and not HA itself. Generic camera should use the stream component to stream the video and that supports h.265.

Note that while H.265 works on Android and iOS, it does not work in many browsers. This is a browser limitation and not a Home Assistant issue. Safari has native H.265 support, and H.265 also works in Edge on Windows when “HEVC Video Extensions” is installed. Chrome versions >= 104 may also work when started with the --enable-features=PlatformHEVCDecoderSupport option.

https://www.home-assistant.io/integrations/stream/#technical-details

The info collected here on the go2rtc github page is very useful for trying to figure out what is and isn’t supported when it comes to h.265 encoded video.

1 Like

@esand: that’s very useful, thanks. According to that, and to the webcodecs test page they point to, my installation of Chrome (v135) and my HW does support H.265 decoding, i.e. I can give the test page my laptop camera as source, let it encode this in H.265, HD resolution, and then view the decoded H.265 video, all in Chrome.

The unprefixed part of the caniuse tests page from the link in the integration’s “Technical Details” section also works.

So it doesn’t seem like a browser issue…?

If you’re up to a bit of sleuthing, I’d suggest you use/install VLC and point it to HA’s stream URL for the camera, and then check the stream info to find out what it’s trying to send out for the encoding (and also see if VLC can display the video).

Oh, also could be pertinent… do you have a valid SSL cert and domain name? Not sure if that’s needed, but it is for WebRTC. Maybe turn on developer tools on in your browser and see if it’s spitting out a security violation error or anything when trying to display the stream.

Hokay, will try that tomorrow. This is all internal on my LAN, the camera being accessed by IP address, so no domains involved.

You can also try the custom:webrtc-camera integration, as it will display some info about the reason why it can’t play a stream.

type: custom:webrtc-camera
url: rtsp://...

If it’s WebRTC, it will have to be over HTTPS, so that won’t work for them if it’s over LAN w/out a domain.

Not sure what do you mean, the integration supports more than just WebRTC. You can bind it to rtsp stream or to generic camera, etc. I don’t have domain/https, and below config works without problems (Reolink camera):

type: custom:webrtc-camera
url: rtsp://login:[email protected]:554/h264Preview_01_sub
muted: true
style: ".mode {display: none}"

Anyway, I suggested it mainly because when it can’t play a video, it shows some explanation why. So perhaps that could help Rob figure out what the problem is.