RemoteWebViewServer icon indicating copy to clipboard operation
RemoteWebViewServer copied to clipboard

Investigate inability to play video in the headless browser (missing H.264 codec?)

Open strange-v opened this issue 1 year ago • 8 comments

Two options:

  1. Add the required codecs to Chromium.
  2. Switch to Chrome; it ships with proprietary codecs.

Note: decoding may fall back to software if hardware video acceleration isn’t exposed to the container.

strange-v avatar Oct 14 '25 05:10 strange-v

How to do point 2?

Vol4ik0531 avatar Oct 14 '25 07:10 Vol4ik0531

Both options require me to tinker with the Docker image creation and the server code. I’ll try to look into this soon.

strange-v avatar Oct 14 '25 08:10 strange-v

A few updates — not the ones you'll want to hear, probably.

  1. You can’t simply add the H.264 codec to Chromium; it has to be compiled in.
  2. Switching to Chrome makes the main functionality unstable (though video works). Chrome's new headless mode doesn't let us set the screen size when creating a tab for a new device; instead, it relies on somewhat hacky timing with Emulation.setVisibleSize and Emulation.setDeviceMetricsOverride. I haven’t been able to make this reliable — the screen size is sometimes incorrect.

strange-v avatar Oct 16 '25 20:10 strange-v

Related question - will it be possible to get WebRTC streams working? I am using the WebRTC Card addon from HACs and it doesn't work at the moment

RyanEwen avatar Nov 02 '25 21:11 RyanEwen

That's the same issue, missing codecs in the headless browser.

strange-v avatar Nov 03 '25 05:11 strange-v

I've found a Workaround, is not a live-feed, but is the closest. you just need to change the settings inside the "Picture entity card configuration" - "camera view" from Live to Auto.

IT will refresh the picture every couple of seconds.

so far i've found possible only live-feed with esp32-cams as they work with MJPEG.

PerryFabregas avatar Mar 18 '26 19:03 PerryFabregas

Hello all, I got a huge improvement today, you can have the live view on the headless browser with the WebRTC custom card, you just need to transcode to mjpeg, just be aware that this can be CPU intensive on low end HA

` Step 1 — Define your camera stream with an FFmpeg transcode directive. The key syntax for H.264 → MJPEG is: url: "ffmpeg:rtsp://user:password@:554/stream#video=mjpeg"

If your ONVIF camera needs TCP for RTSP (common), add the transport flag: url: "ffmpeg:rtsp://user:password@:554/stream#video=mjpeg#input=rtsp/tcp"

Step2 - WebRTC card configuration type: custom:webrtc-camera url: mode: mjpeg `

Hopefully this will be helpful for your applications

PerryFabregas avatar Mar 23 '26 21:03 PerryFabregas

Fixed in the latest server release.

strange-v avatar Oct 10 '26 15:10 strange-v