After many attempts to stream the same way we found that MediaMTX can publish the H.265 WebRTC stream, but Chromium 114 cannot decode or negotiate it, resulting in no playback. also on MediaMTX discussion maintainers often recommend converting H.265→H.264 for browser compatibility. RTSP to WEbrtc · bluenviron/mediamtx · Discussion #2923 · GitHub
And based on our research, Chromium 114 does not include any experimental flags related to enabling HEVC (H.265) decoding in WebRTC. Also, Chromium v127+ only supports H.265 encoding, not decoding. The WebRTC HEVC flags are available only on ChromeOS and Android, here is screenshot of it.
To quickly verify which browsers support H.265 WebRTC, you can test here:
https://vdo.ninja/h265
This page will clearly show that support currently exists only on Android and Apple devices. Also, please read the Important Compatibility Notice at the bottom of that page. On Android, it works without any flags because H.265 support is native after Chrome v136+, but still only for Android and ChromeOS.
Additional info we found about this WebRTC h265 streaming is that
HEVC/H.265 is patent-encumbered and was never made a mandatory WebRTC codec.
In practice:
- Encoding (sending) support is very limited or behind flags.
- Most browsers do not decode it at all.
- Many WebRTC servers and clients don’t include H.265 payloaders.
For Example from Wowza Streaming Engine documentation:
Even though Wowza can ingest H.265, to serve via WebRTC you must transcode to H.264, meaning: You will need to go from H.265 to H.264 if you want WebRTC to work.
here is discussion How to stream a H.265 IP Camera stream to WebRTC in H.265 format? - Wowza Community
So currently H.265 in WebRTC is a special-case feature, not a widely supported standard.
And if you really needed to do this here is some Possible Workarounds
-
Transcode H.265 > H.264 or VP8/VP9 on the server.
This is the most compatible solution for all browsers. -
Paid media servers
Some platforms like Ant Media Server and Nimble Streamer support H.265 → H.264 transcoding, but only work for Apple and Android users and are not free. -
go2rtc (opensource)
A community tool by AlexxIT that can ingest H.265 (RTSP, etc.) and serve via WebRTC. It supports Safari by formatting packets as Apple expects and can optionally transcode. Because it is free and widely used in IP camera projects, it is a good option.
check out this issue: Support H265 for WebRTC in Safari with go2rtc · Issue #5 · AlexxIT/Blog · GitHub
It does not explicitly mentioned about Android and ChromeOS support yet as its 3 years old issue but its may support now if this helps.

