Git Product home page Git Product logo

webrtc's Introduction

WebRTC Camera

hacs_badge Donate Donate

Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC technology.

Based on:

Why WebRTC:

  • works in any modern browser, even on mobiles
  • the only browser technology with minimal camera stream delays (0.5 seconds and below)
  • works well with unstable channel
  • does not use transcoding and does not load the CPU
  • support camera stream with sound

FAQ

Q. I can't see video stream
A.

  • If your camera works with another integration - it doesn’t mean it will work with this integration
  • If your camera works in VLC - it doesn’t mean it will work with this integration
  • If your camera works remotely with another integration - it doesn’t mean it will work remotely with this integration

In case of any problems, check:

  1. Check that you have installed the integration on the "Configuration > Integrations" page
  2. Check that you are on the same network as your Hass server
  3. Check that you don't setup Hass server with forward only 8123 port (users with Virtual Machine or Docker installation or firewall), because WebRTC using 50000-50009 UDP ports for video streaming
  4. Check that you don't have any erros in "Configuration > Logs" page
  5. Check if default video with Bunny works:
type: 'custom:webrtc-camera'
url: 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov'

PS. Some mobile browsers can't show stream without HTTPS. There are also problems with the stream in the Firefox browser.

Q. Error: Custom element doesn't exist: webrtc-camera.
A. Component automatically adds custom card /webrtc/webrtc-camera.js to your resources.

Check if you install component in "Integrations" page. And try to clear your browser cache. Also, you can try to add this card to your resources manually.

Q. How to setup exernal access?
A. External access will work only if you have public IP-address (without provider NAT). Dynamic address is also supported.

You need to forward UDP ports 50000-50009 to Hass server on your router.

50000-50009 ports are used only during video streaming. At each start of the streaming, a random port is occupied. The port is released when the streaming ends. The data should theoretically be encrypted, but I haven't tested :)

WebRTC can't work with external access via Nabu Casa or Dataplicity if you have private IP-address.

Q. Some streams are not loaded when there are many cameras on the page.
A. The default settings only support 10 simultaneous streams (from Hass server to app or browser). Go to "Configuration > Integrations > WebRTC Camera > Options" and increase port range. You also need forward new port range on your router if you want external access to cameras.

Q. Which codecs are supported?
A. WebRTC supported: AVC/H.264 for video and G.711 PCM (A-law), G.711 PCM (µ-law) for audio.

WebRTC technology doesn't support HEVC/H.265 for video and AAC for audio.

Install

You can install component with HACS custom repo: HACS > Integrations > 3 dots (upper top corner) > Custom repositories > URL: AlexxIT/WebRTC > Category: Integration

Or manually copy webrtc folder from latest release to custom_components folder in your config folder.

Config

Video DEMO

WebRTC Camera real time streaming component for Home Assistant

With GUI. Configuration > Integration > Add Integration > WebRTC Camera.

If the integration is not in the list, you need to clear the browser cache.

Component doesn't create devices/entities/services. It creates only lovelace custom card:

Minimal

type: 'custom:webrtc-camera'
url: 'rtsp://rtsp:[email protected]:554/av_stream/ch0'

Full

type: 'custom:webrtc-camera'
url: 'rtsp://rtsp:[email protected]:554/av_stream/ch0'
poster: https://home-assistant.io/images/cast/splash.png  # still image when stream is loading
intersection: 0.75  # auto pause stream when less than 75% of video element is in the screen, 50% by default

About

Supported clients:

  • macOS: Google Chrome, Safari
  • Windows: Google Chrome
  • Android: Google Chrome, Home Assistant Mobile App
  • iOS: Home Assistant Mobile App

Limitations:

  • works only with H.264 camaras
  • for external access you need a public IP-address (without provider NAT), dynamic IP is also supported

Known work cameras:

  • ActiveCam AC-D2121IR3
  • ActiveCam AC-D7121IR1W (support sound)
  • EZVIZ C3S
  • Hikvision DS-2CD2T47G1-L, DS-2CD1321-I, DS-2CD2143G0-IS
  • Reolink: RLC-410, RLC-410W, E1 Pro, 4505MP
  • Sonoff GK-200MP2-B (support sound)
  • TP-Link Tapo C200
  • Wyze Cam v2 (support sound)
  • Dahua DH-IPC-HDPW1431FP-AS-0280B (support sound)
  • Yi 1080p Dome Hi3518e Chipset (with hack)
  • Yi 1080p Dome MStar Infinity Chipset (with hack)

webrtc's People

Contributors

alexxit avatar krystiancharubin avatar anonym-tsk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.