Realtime camera streaming without any delay - WebRTC

@AlexxIT do you have any idea to solve my problem? (video with bunny works in my phone without problem)

Donā€™t know. Some problem with camera codec

Hey @AlexxIT, thanks for the awesome integration, works great, any idea how I would create the ā€œlink to a special web pageā€ without it being generated using the local hostname?, possibly using the ā€œexternal_urlā€ specified in "configuration.yaml?,

The Config below creates the following link:

http://hassos:8123/webrtc/embed?url=3596277716216461436319234692659150079666

but I would prefer if it was

http://mydns:8123/webrtc/embed?url=3596277716216461436319234692659150079666

Config

alias: Create Temporary DoorBell Camera Link
sequence:
  - variables:
      link_id: "{% for _ in range(40) %}{{ range(10)|random }}{% endfor %}"
  - service: webrtc.create_link
    data:
      link_id: '{{ link_id }}'
      entity: camera.doorbell
      open_limit: 0
      time_to_live: 0
  - service: persistent_notification.create
    data:
      message: >-
        <a href="/webrtc/embed?url={{ link_id }}" target="_blank">View
        Camera</a>
mode: single

Also, is it possible to enable sound by default when generating the link?, possibly ā€œmuted: falseā€ as an option?

Config below doesnā€™t add any hostname. You can enter your hostname here:

<a href="XXXXX/webrtc/embed...

Very nice work! I have just a problem, my camera stream doesnā€™t work every time, sometimes will not load and i need to clear browser cache, then come back working. What should i do? Thanks

Thanks.
Is it possible to enable sound by default when generating the link?

This is such amazing work!! something Iā€™ve been looking for, for a very long time!! THANK YOU.

How many cameras are people using this with on their lovelace dashboards? I have 5 cameras and when on my LAN everything is damn near perfect, however externally there is a lot of intermittent connection issues. I have read all the FAQā€™s addressing the external connection issues but Iā€™m curious if Iā€™m just trying to run too many cameras in my dashboard?

Side question would pursuing the TURN and STUN servers fix all the external connection issues?

I have already gone to ā€œ#2. Medium tech wayā€ and not seeing any performance improvement. I am using nabu casa and tested with the iOS companion app and my computer at my office (WIN10, most current Edge browser)

1 Like

What icon do you see outside the home? The documentation contains the meanings of all icons

I get all the way the ā€œloading video (WebRTC)ā€ icon but the feed never comes in, very occasionally it will start one or two cameras but itā€™s not really a live feed more like a static image eventually it will show a ā€œResart connectionā€ message.

1 Like

Good Evening AlexxIT, Thanks for your custom component !
I have the same problem explained by bmutari: when i see my 4 sonoff cams from LAN Homeassistant Interface i see images perfectly, with low latency (in real time), but when i try to see my 4 Sonoff cams from an external connection, i see some camā€™s images, but every second i see also the round symbol that means that application is loading dataā€¦
In the High Right corner i can see the ā€œloading video (WebRTC)ā€ icon but video stream is not fluidā€¦

PS: i forwarded UDP port from 50000 to 51000 in WebRTC Component in home assistant integrations, and also in my router ! Range 50000 to 51000 UDP port to my home assistant IP Address.

Thanks in advance for your help.
Best regards

2nd way works ONLY if you have public IP address. If you donā€™t - using this method will reduce the chances that the video stream will work

1 Like

Isnā€™t nabu casa functioning as a public IP?

Thanks for your answer!
I have public dynamic ip address and i use ddns in the HA mobile app to connect it to my HA server! I also Forwarded the 8123 Port on my router!

Thanks a lot

Hi to al

Can someone please enlighten me on how to install this/a custom component on HA Core?
I have been searching for this left and right but cannot find an answer.

Thanks a lot in advance!

@Zagor4 Dynamic IP address is not a problem. The main thing is that it should be public. And why you forward 8123 port? No one should do it.

@bmutari WebRTC doesnā€™t use NabuCasa channel for video transfer. It use only direct connection between browser and your home/server. Only exception if you use a own TURN serverā€¦

Good Evening @AlexxIT ,
My IP is Public and Dynamic (iā€™m able to open ports on my router in order to use same services) and iā€™m not behind a NAT.
I forwarded a xxxx port to 8123 local port ! I have to activate SSL protocol in Home Assistant.

But i canā€™t understand why iā€™m not able to see video streems from an external connectionā€¦ I tried also with only 1 Sonoff Cam but the video is in continuos loading statusā€¦ :frowning:
Have you some advice ?
Thanks a lot

This component is great! I have been using it for a month or so now with my Reolink 410 cameras and have not touched the Reolink camera since!

I have a HASS setup at my parents house, with a table displaying a constant stream, however, they have a Nest Hello doorbell. My understanding is the official nest integration pulls an rtsp stream from the SDM API, so in theory the following Lovelace should work;

type: 'custom:webrtc-camera'
entity: camera.front_door

This results in ā€œERROR: Support only RTSP-Streamā€

Is this something that could be adapted in WebRTC, or would this require a change for the official Nest integration?

Thank you in advance! and for all your hard work

3 Likes

Still getting this same error with the latest version

I have a camera with H265 that Iā€™d be happy to test, but if I understand correctly H265 will only work with Apple devices. I get the following error in Chrome when using H265:
ERROR: NotSupportedError: Failed to execute ā€˜addSourceBufferā€™ on ā€˜MediaSourceā€™: The type provided (ā€˜video/mp4; codecs=ā€œhvc1.016000ā€ā€™) is unsupported.