Realtime camera streaming without any delay - WebRTC

I haven’t had any issue with WebRTC for days now !
I don’t know what has changed, but my CPU consumption is now OK, even when I watch my cameras streams form a remote location ! :slight_smile:

Very pleased. Good job !

2 Likes

Great addition to HA< many thanks @AlexxIT .

Is there any way to adjust the size of the video on a Lovelace dashboard? The video is quite small and does not resize to match the page size. Is this something that can be configured in Lovelace in general? Using the old “glance” cards I could tweak the aspect ratio to get a nice fit for particular devices at least.

This is still streets ahead though as I can now see what’s going on now, rather than who I just missed at the front gate 30s ago!

2 Likes

Did you manage to get a 16: 9 stream? I also have 4: 3

I’m guessing you guys are accessing the Substream rather than the main stream. The Substream on my Hikvision cameras is also 4x3 whereas the main stream is 16x9.

No, the main stream is set. The problem, as I can see, occurs in more people.

Hello, anyone knows how to add PTZ commands with a Synology Surveillance Station camera please ?

Just installed this from HACS, decided to give it a go. It’s not working. Container is running on host mode so it’s not a port issue on the local network. It’s not working either locally or via my domain going through the reverse proxy.

I don’t get anything on the HA logs, but the card I added to lovelace shows this error at the top:

error: invalidstateerror: failed to execute ‘addsourcebuffer’ on ‘mediasource’: the mediasource’s readystate is not ‘open’.

Any ideas? I scanned the thread and only found mention of running on Chrome being the cause of that error… but only if the stream is h265 which is not my case. Definitely h264.

Edit: further to the above, I am using the existing entities added by my ONVIF integration, I tried substream and mainstream. They are hikvision-based cameras.

I am in the same boat. Got really excited when I saw that the Nest integration uses RTSP, but sad to see that the WebRTC card doesn’t like the Nest camera entities :frowning:

1 Like

By Apple devices does it mean MacOS or should it work on iOS devices too?

This integration is working great, but half of my cameras are h265, so I’m trying to figure out how to get them to stream. Appreciate it!

EDIT - I’m also not trying to use Home Assistant Cast to project a dashboard to a Chromecast I have a dedicated screen. It seems to be hit or miss for working with this component. Some will load, but ultimately my Nabu Casa URL becomes unresponsive for accessing HA after some time (local IP works fine during those periods). This was with 3 WebRTC minimal cards on the dashboard.

Hi there
I am trying to set this up. After the installation the default bunny was work fine. I setup my camera but it is not working.

The documentation mentions installing the integration however I cannot find a WebRTS integration. I have cleared browser cache and I have checked the online Integration page at Integrations - Home Assistant

When I click Start Session nothing happens, however I do get an error in the browser log from the adapter-latest.js file
Uncaught (in promise) DOMException: Failed to execute ‘setRemoteDescription’ on ‘RTCPeerConnection’: Failed to parse SessionDescription. Expect line: v=
at RTCPeerConnection.setRemoteDescription

adapter-latest.js:1440

Has anyone experienced any similar issues?

I have no idea if anyone has reported that there is a bug in the HACS installation. The resources entry is wrong. It is webrtc/webrtc-camera…instead of the real one or if you copy the js file to www folder than is should be /local/webrtc-camera.js…

Why you think /local/... is right url?

No. It is not. It report the webrtc_camera does not exist while it was found in “/config/custom_components/webrtc/www”, the resources was set to a some what different location.
As many resources are in the /local/… I have manually changed the path and put the js file in this place.
Of course I could have fixed the location to the correct one without copying the js file to the above location.

@AlexxIT i have tested h265 on an IPAD with activated h265 Feature in Safari. I can see only a black screen and the playbutton. The icon on the upper right corner says connected.

Other thing is. On IOS i can’t see rounded Corners from the webrtc plugin. When i open the site on Windows everything is fine but on IOS no rounded corners :frowning:

What version of iOS?

@AlexxIT I am having the same issue as these guys: https://github.com/AlexxIT/WebRTC/issues/6
I have a quite fresh Home Assistant installation, v. 2021.8.8, hacs 1.15.2, and after installation from hacs when trying to add the BigBuckBunny sample I’m getting the Custom element doesn’t exist: ‘webrtc-camera’ error when trying to add it to dashboard. I can see the WebRTC camera in hacs integrations, also there is a folder in custom_components. I’ve tried also manual installation, removed in hacs, and copied the folder manually - it didn’t get pick up at all, in hacs or integration. Could you take a look at what might be the issue?

2 Likes

Did you take this steps:
Configuration > Integrations > Add Integration > WebRTC
?

14.7.1 is the IOS Version

Yes, and still having the same issue:

1 Like

I was hoping to use WebRTC for a diy baby monitor based on a RPi, RPi camera & USB mic. Using UV4L-raspicam and v4l2-rtspserver gets me a rtsp video and audio stream that I can see and hear fine in vlc. The video is fine in HA with WebRTC (impressive lack of delay), but there is no audio.

Any ideas why this is the case, and what can be done about it please?