Giter VIP home page Giter VIP logo

eufyp2pstream's Introduction

EufyP2PStream

A small project that provides an audio/video WebRTC stream from Eufy cameras that don't directly support RTSP. Main goal of this addon is to allow blazing-fast activation of the video-stream on Home Assistant. See Example Use Cases

Howto install

The addon requires a few other addons to provide the live stream.

Prerequisites

Install and configure the Eufy Security WS Addon. Install the go2RTC Addon.

Install this addon

Copy this directory to /addons/eufyp2pstream on your Home Assistant host and install the addon.

Open the Addon's WebUI and enjoy a camera stream with audio via WEBRTC.

Setting up a camera in go2RTC

Go to the go2RTC Webui and select Config. Enter a new configuration for the Eufy camera:

streams:
  doorbell:
    - exec:ffmpeg -thread_queue_size 512 -an -sn -dn -analyzeduration 1200000 -f h264 -fflags +discardcorrupt+nobuffer -flags low_delay -i tcp://127.0.0.1:63336?timeout=100000000 -thread_queue_size 512 -vn -sn -dn -analyzeduration 1200000 -fflags +discardcorrupt+nobuffer -flags low_delay -i tcp://127.0.0.1:63337?timeout=100000000 -preset ultrafast -tune zerolatency -sc_threshold 0 -fflags genpts+nobuffer+flush_packets -map 0:v -map 1:a -preset ultrafast -c:a opus -application lowdelay -frame_duration 20 -codec:v copy -tune zerolatency -movflags +faststart -g 15 -r 15 -strict -2 -rtsp_transport tcp -f rtsp {output}
    - "exec:ffmpeg -fflags nobuffer -f alaw -ar 8000 -i pipe: -vn -sn -dn -c:a aac -b:a 24k -ar 16k -ac 2 -f adts tcp://127.0.0.1:63338#backchannel=1#killsignal=15#killtimeout=3"

This configures two ffmpeg processes. The first one is for video+audio, the second one is for Talkback.

References

This project is inspired by:

Example Use Cases

Audio/Video Streaming with WebRTC card

With the WebRTC Camera Custom Card you can show the camera stream on your lovelace dashboard. It ensures that the stream is only started when the card is visible. It makes sense to display it only on conditions (e.g. as part of a conditional card that pops up when your doorbell rings or when an input_boolean is on):

Install the WebRTC Camera Custom Component and create a card as follows:

type: custom:webrtc-camera
url: doorbell               # Use the camera name from the go2RTC configuration
mode: webrtc                # For faster activation you can force it to use webrtc instead of auto-detection
style: 'video {aspect-ratio: 16/12; object-fit: fill;}' # Use this to ensure your lovelace layouts doesn't jump when the stream is activated 

Talkback with WebRTC card

Append the following line to your webrtc-camera card in lovelace: media: video,audio,microphone to enable talkback. Note that your Home Assistant instance needs to use https with a valid certificate. Otherwise browsers will not allow microphone access.

eufyp2pstream's People

Contributors

oischinger avatar conorsham avatar beilm 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.