All Projects → mrlt8 → docker-wyze-bridge

mrlt8 / docker-wyze-bridge

Licence: other
RTMP/RTSP/LL-HLS bridge for Wyze cams in a docker container

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Dockerfile
14818 projects
CSS
56736 projects

Projects that are alternatives of or similar to docker-wyze-bridge

wyzecam-hls
Converts MP4 files from WyzeCam NFS to HLS stream. Much more stable alternative to RTSP firmware.
Stars: ✭ 58 (-94.94%)
Mutual labels:  rtsp, hls, wyze, wyzecam
ZLMediaKit
WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181/SRT server and client framework based on C++11
Stars: ✭ 7,790 (+579.76%)
Mutual labels:  rtsp, hls, rtmp
Awesome Home Assistant
A curated list of amazingly awesome Home Assistant resources.
Stars: ✭ 3,487 (+204.28%)
Mutual labels:  homeassistant, hassio, hassio-addons
Media Server
RTSP/RTP/RTMP/FLV/HLS/MPEG-TS/MPEG-PS/MPEG-DASH/MP4/fMP4/MKV/WebM
Stars: ✭ 1,363 (+18.94%)
Mutual labels:  rtsp, hls, rtmp
smart rtmpd
RTMP server, smart, compact, high performance(c, c++), high concurrency, easy to maintain, easy to deploy, (supports multiple operating systems Windows and Linux, ARM, FreeBSD)
Stars: ✭ 159 (-86.13%)
Mutual labels:  rtsp, hls, rtmp
hassio-addons
My homeassistant addons
Stars: ✭ 646 (-43.63%)
Mutual labels:  homeassistant, hassio, hassio-addons
wsa
WSA(Websocket Streaming Agent) is a stream server target for mp4/h264 streaming over websocket
Stars: ✭ 35 (-96.95%)
Mutual labels:  rtsp, hls, rtmp
addon-shinobi
Shinobi Pro - Community Hass.io Add-on for Home Assistant
Stars: ✭ 22 (-98.08%)
Mutual labels:  homeassistant, hassio, hassio-addons
Rapidvms
rapidvms(open source VMS/NVR Video Management System/ Network Video Recorder) mail to [email protected] for latest version
Stars: ✭ 370 (-67.71%)
Mutual labels:  rtsp, hls, rtmp
Monibuca
🧩 Monibuca is a Modularized, Extensible framework for building Streaming Server
Stars: ✭ 307 (-73.21%)
Mutual labels:  rtsp, hls, rtmp
Zlmediakit
WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181 server and client framework based on C++11
Stars: ✭ 5,248 (+357.94%)
Mutual labels:  rtsp, hls, rtmp
Lal
🔥 Golang live stream lib/client/server. support RTMP/RTSP/HLS/HTTP[S]-FLV/HTTP-TS, H264/H265/AAC, relay, cluster, record, HTTP API/Notify, GOP cache. 官方文档见 https://pengrl.com/lal
Stars: ✭ 480 (-58.12%)
Mutual labels:  rtsp, hls, rtmp
Easyplayer Rtsp Android
An elegant, simple, fast android RTSP/RTMP/HLS/HTTP Player.EasyPlayer support RTSP(RTP over TCP/UDP)version & Pro version,cover all kinds of streaming media!EasyPlayer是一款精炼、高效、稳定的流媒体播放器,分为RTSP版和Pro版本,支持各种各样的流媒体音视频播放!
Stars: ✭ 437 (-61.87%)
Mutual labels:  rtsp, hls, rtmp
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+2289.35%)
Mutual labels:  rtsp, hls, rtmp
Gear Lib
Gear-Lib, C library for IOT Embedded Multimedia and Network
Stars: ✭ 2,381 (+107.77%)
Mutual labels:  rtsp, rtmp
Aquila
IPCamera, aim to support V4L2/UVC/RaspberryPi/Hisi/XXX SDK production
Stars: ✭ 173 (-84.9%)
Mutual labels:  rtsp, rtmp
Rtsp.player.android
RTSP player for Android / IP camera viewer
Stars: ✭ 199 (-82.64%)
Mutual labels:  rtsp, rtmp
Easyrtsplive
Streaming media middleware:RTSP to RTMP,拉流IPC摄像机或者NVR硬盘录像机RTSP流转成RTMP推送到阿里云CDN/腾讯云CDN/RTMP流媒体服务器,支持多路RTSP流同时拉取并以RTMP协议推送发布,EasyRTSPLive我们支持任何平台,包括但不限于Windows/Linux/Android/ARM
Stars: ✭ 130 (-88.66%)
Mutual labels:  rtsp, rtmp
Ffmpegandroid
android端基于FFmpeg实现音频剪切、拼接、转码、编解码;视频剪切、水印、截图、转码、编解码、转Gif动图;音视频合成与分离,配音;音视频解码、同步与播放;FFmpeg本地推流、H264与RTMP实时推流直播;FFmpeg滤镜:素描、色彩平衡、hue、lut、模糊、九宫格等;歌词解析与显示
Stars: ✭ 2,858 (+149.39%)
Mutual labels:  rtsp, rtmp
Nodemediaclient Ios
NodeMedia RTMP/RTSP/HTTP Play/Publish Client SDK for iOS
Stars: ✭ 221 (-80.72%)
Mutual labels:  rtsp, rtmp

RTMP/RTSP/HLS Bridge for Wyze Cam

Docker GitHub release (latest by date) Docker Image Size (latest semver) Docker Pulls

Docker container to expose a local RTMP, RTSP, and HLS or Low-Latency HLS stream for ALL your Wyze cameras including the outdoor, doorbell, and 2K cams. No third-party or special firmware required.

It just works!

Cameras stream locally without additional bandwidth.

View all your cameras in one place with the Web-UI!

Based on @noelhibbard's script with kroo/wyzecam and aler9/rtsp-simple-server.

Please consider ⭐️ starring or ☕️ sponsoring this project if you found it useful, or use our affiliate link if shopping on amazon!

Quick Start

Install docker and use your Wyze credentials to run:

docker run \
  -e [email protected] \
  -e WYZE_PASSWORD=yourpassw0rd \
  -p 1935:1935 -p 8554:8554 -p 8888:8888 -p 5000:5000 \
  mrlt8/wyze-bridge:latest

You can then use the web interface at http://localhost:5000 where localhost is the hostname or ip of the machine running the bridge.

See basic usage for additional information.

What's Changed in v1.10.1

  • Home Assistant: disable WEB_AUTH #638

What's Changed in v1.10.0

  • New: Optional basic auth for WebUI with WEB_AUTH=True #612 Thanks @yeahme49!
    • Note: this will only protect the WebUI. API and snapshot endpoints are unprotected at this time.
    • Will use your wyze email/password for auth by default.
    • Use WEB_USERNAME and/or WEB_PASSWORD to customize the authentication.
  • New: API endpoints and MQTT topic to send commands to the camera.
  • Updated: Wyze app and iOS version for the Web API
  • Updated: rtsp-simple-server to v0.20.4

View previous changes

Features

  • Web-UI with dark mode to view all Wyze cameras in one place. details
  • Access to video and audio for all Wyze-supported cameras via RTSP/RTMP/HLS/Low-Latency HLS. details
  • Access to 2K, HD, or SD stream with configurable bitrate. details
  • Local and remote access to any of the cams on your account just like the app. details
  • Runs on almost any x64 or armv7/arm64 based system like a Raspberry Pi that supports docker. details
  • Support for Wyze 2FA. details
  • Optional on-demand connection to cameras. details
  • Ability to rotate video for Wyze Doorbell. details
  • Ability to record streams locally. details
  • Ability to take snapshots on an interval or on demand. details
  • Ability to live stream directly from the bridge. details
  • Ability to send a IFTTT webhook when a camera is offline (-90). details
  • Start an HTTP server on the camera for local SD card access on older firmware. details
  • Trigger MQTT/Webhook/HTTP on a motion event on older firmware. details
  • On-demand high quality photos on the camera. details

Supported Cameras

Wyze Cam v1 Wyze Cam V2 Wyze Cam V3 Wyze Cam V3 Pro Wyze Cam Floodlight Wyze Cam Pan Wyze Cam Pan V2 Wyze Cam Pan Pro Wyze Cam Outdoor Wyze Cam Outdoor V2 Wyze Cam Doorbell

Wyze Cam Doorbell Pro

Camera Model Supported
Wyze Cam v1 [HD only] WYZEC1
Wyze Cam V2 WYZEC1-JZ
Wyze Cam V3 WYZE_CAKP2JFUS
Wyze Cam V3 Pro [2K] HL_CAM3P
Wyze Cam Floodlight WYZE_CAKP2JFUS
Wyze Cam Pan WYZECP1_JEF
Wyze Cam Pan v2 HL_PAN2
Wyze Cam Pan Pro [2K] HL_PANP
Wyze Cam Outdoor WVOD1
Wyze Cam Outdoor v2 HL_WCO2
Wyze Cam Doorbell WYZEDB3
Wyze Cam Pan v3 HL_PAN3
Wyze Battery Cam Pro AN_RSCW
Wyze Cam Doorbell Pro GW_BE1 ⚠️
Wyze Cam Doorbell Pro 2 AN_RDB1

Firmware Compatibility

The bridge should be compatible with the latest official firmware from wyze.

Compatibility

Supports armv7 Architecture Supports aarch64 Architecture Supports amd64 Architecture

Home Assistant Add-on Homebridge Portainer stack Unraid Community App

Should work on most x64 systems as well as on some arm-based systems like the Raspberry Pi.

The container can be run on its own, in Portainer, Unraid, as a Home Assistant Add-on, locally or remotely in the cloud.

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

Basic Usage

docker-compose (recommended)

This is similar to the docker run command, but will save all your options in a yaml file.

  1. Install Docker Compose.
  2. Use the sample as a guide to create a docker-compose.yml file with your wyze credentials.
  3. Run docker-compose up.

Once you're happy with your config you can use docker-compose up -d to run it in detached mode.

Updating your container

To update your container, cd into the directory where your docker-compose.yml is located and run:

docker-compose pull # Pull new image
docker-compose up -d # Restart container in detached mode
docker image prune # Remove old images

🏠 Home Assistant

Visit the wiki page for additional information on Home Assistant.

Additional Info

Special Characters

If your email or password contains a % or $ character, you may need to escape them with an extra character. e.g., pa$$word should be entered as pa$$$$word

Web-UI

The bridge features a basic Web-UI which can display a preview of all your cameras as well as direct links to all the video streams.

The web-ui can be accessed on the default port 5000:

http://localhost:5000/

Snapshots for each camera are accessible using the URI:

http://localhost:5000/img/camera-nickname.jpg

New snapshots can also be generated on demand using the URI:

http://localhost:5000/snapshot/camera-nickname.jpg

If you're running the WebUI behind a reverse-proxy or need to change the hostname and/or port for each stream, you can do so by passing the needed ENVs:

environment:
  - WB_RTSP_URL=rtsp://my-hostname-or-ip:1234/
  - WB_RTMP_URL=rtmp://my-hostname-or-ip:5678/
  - WB_HLS_URL=http://my-hostname-or-ip:9090/

Query params to adjust web-ui:

  • Fullscreen/kiosk mode http://localhost:5000/?fullscreen
  • Number of columns http://localhost:5000/?columns=4
  • Preview refresh interval http://localhost:5000/?refresh=60
  • Camera order http://localhost:5000/?order=front-cam,back-cam,garage,other
  • autoplay http://localhost:5000/?autoplay

NOTE: You can combine multiple queries into a single request:

http://localhost:5000/?fullscreen&autoplay&columns=2&refresh=0&order=front,side

Camera Stream URIs

By default, the bridge will create three streams for each of your cameras which can be accessed at the following URIs, where camera-nickname is the name of the camera set in the Wyze app and converted to lower case with hyphens in place of spaces. e.g. 'Front Door' would be /front-door

Replace localhost with the hostname or ip of the machine running the bridge:

rtmp://localhost:1935/camera-nickname

rtsp://localhost:8554/camera-nickname

http://localhost:8888/camera-nickname/stream.m3u8
  • HLS can also be viewed in the browser using:

    http://localhost:8888/camera-nickname
    
  • Low-Latency HLS (enable with LLHLS=true):

    https://localhost:8888/camera-nickname
    or
    https://localhost:8888/camera-nickname/stream.m3u8
    

API Endpoints

In addition to the WebUI, you can also access the internal json API with the camera status/details:

http://localhost:5000/api
http://localhost:5000/api/<camera-name>
http://localhost:5000/api/<camera-name>/status

Submit a Two-Factor Authentication (2FA) code:

http://localhost:5000/mfa/123456

On-demand controls:

http://localhost:5000/api/<camera-name>/start
http://localhost:5000/api/<camera-name>/stop

Camera controls (see Camera Control for commands):

http://localhost:5000/api/<camera-name>/<command>

Server Sent Event with status for all cameras:

http://localhost:5000/api/sse_status

Advanced Options

WYZE_EMAIL and WYZE_PASSWORD are the only two required environment variables.

The following envs are all optional.

On-Demand Streaming

NOTE: on-demand settings will be ignred if local recording is enabled for a particular camera.

The bridge will always attempt to connect and maintain an active connection to each of the non-battery powered cameras, however, you can change this default behavior to only connect to the cameras when needed by setting the ENV:

  environment:
    - ON_DEMAND=True

Audio

Audio is disabled by default and must be enabled in the ENV.

Enable audio

  • For all cameras:

    environment:
        ..
        - ENABLE_AUDIO=True
  • For a specific camera:

    where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

      - ENABLE_AUDIO_CAM_NAME=True
      - ENABLE_AUDIO_OTHER_CAM=True

    🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

    - CAM_NAME: Cam Name
      AUDIO: true
    - CAM_NAME: other cam
      AUDIO: true

Audio output codec

By default, the bridge will attempt to copy the audio from the camera without re-encoding unless the camera is using a codec that isn't supported by RTSP, in which case the audio will be converted to AAC.

The AUDIO_CODEC ENV can be used should you need to re-encode the audio to another format for compatibility:

  - AUDIO_CODEC=AAC

Audio filtering

Custom ffmpeg audio filters can be set with AUDIO_FILTER, but please note that audio filters will only be applied if re-encoding to another codec.

  - AUDIO_FILTER=highpass=f=300,lowpass=f=2500,volume=volume=2

Filtering

The default option will automatically create a stream for all the cameras on your account, but you can use the following environment options in your docker-compose.yml to filter the cameras.

All options are case-insensitivE, and take single or comma separated values.

Examples

  • Whitelist by Camera Name (set in the wyze app):

    environment:
        ..
        - FILTER_NAMES=Front Door, Driveway, porch cam
  • Whitelist by Camera MAC Address:

    - FILTER_MACS=00:aA:22:33:44:55, Aa22334455bB
  • Whitelist by Camera Model:

    - FILTER_MODELS=WYZEC1-JZ
  • Whitelist by Camera Model Name:

    - FILTER_MODELS=V2, v3, Pan
  • Blacklisting:

    You can reverse any of these whitelists into blacklists by setting FILTER_BLOCK.

    environment:
        ..
        - FILTER_NAMES=Bedroom
        - FILTER_BLOCK=true

Network Connection Modes

Like the wyze app, the tutk library has three different modes to connect to the camera and will attempt to stream directly from the camera when on the same LAN as the camera in "LAN mode". If the camera is not available locally, it will either attempt to stream directly from your network using "P2P Mode" or relay the stream via the wyze servers (AWS) in "relay mode".

LAN mode is more ideal as all streaming will be local and won't use additional bandwidth.

LAN Mode

By default, the bridge will attempt to connect via "LAN Mode", but will fallback to other methods if LAN mode fails. You can restrict streaming to LAN only by setting the NET_MODE=LAN environment variable:

environment:
    ..
    - NET_MODE=LAN

P2P Mode

NET_MODE=P2P is ideal when running the bridge remotely on a different network or on a VPS and will allow the bridge to stream directly from the camera over the internet while blocking "Relay Mode".

ANY Mode

NET_MODE=ANY is the equivalent to leaving NET_MODE unset and will allow the connection to fallback to P2P or relay mode.

NET_MODE for a specific camera

In the event that you need to allow the bridge to access a select number of cameras outside of your LAN, you can specify them by appending the camera name to NET_MODE, where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

    ..
    - NET_MODE=LAN
    - NET_MODE_CAM_NAME=P2P

🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

- CAM_NAME: Cam Name
  NET_MODE: P2P

Proxy stream from RTSP firmware

For cameras on official RTSP FW (4.19.x, 4.20.x, 4.28.x, 4.29.x, 4.61.x.) only.

The bridge can pull the credentials from the camera and proxy the stream over the bridge.

The secondary stream will be available with the fw suffix e.g., cam-namefw.

# Add cameras that have RTSP enabled in the app:
RTSP_FW=true
# or use force to turn on the rtsp stream:
RTSP_FW=force

Snapshot/Still Images

See web-ui to pull snapshots on-demand.

  • SNAPSHOT=API Will run ONCE at startup and will grab a high-quality thumbnail from the wyze api and save it to /img/cam-name.jpg on docker installs or /config/www/cam-name.jpg in Home Assistant mode.

  • SNAPSHOT=RTSP Will run every 180 seconds (configurable) and wll grab a new frame from the RTSP stream every iteration and save it to /img/cam-name.jpg on standard docker installs or /config/www/cam-name.jpg in Home Assistant mode. Can specify a custom interval with SNAPSHOT=RTSP(INT) e.g. SNAPSHOT=RTSP30 to run every 30 seconds

  • IMG_DIR=/img/ Specify the directory where the snapshots will be saved within the container. Use volumes in docker to map to an external directory.

  • IMG_TYPE Specify the file type of the image, e.g. IMG_TYPE=png. Will default to jpg.

Camera Control

This is a work in progress and feedback would be appreciated

Some basic commands can be sent to the camera over the WebUI's API or MQTT if enabled.

  • API: Make a GET request to /api/<camera-name>/<command>
  • MQTT: Publish a command to the topic wyzebridge/<camera-name>/cmd

Can be disabled with DISABLE_CONTROL=True.

Available commands:

Command Description Response
take_photo Take a photo on the camera 1 for success
get_status_light Get status light config 1 = On, 2 = Off
set_status_light_on Turn on status light 1 for success
set_status_light_off Turn off status light 1 for success
get_night_vision Get night vision 1 = On, 2 = Off, 3 = Auto
set_night_vision_on Turn on night vision 1 for success
set_night_vision_off Turn off night vision 1 for success
set_night_vision_auto Set night vision to auto 1 for success
get_irled_status Get IR/LED status 1 = On/850nm long range IR, 2 = Off/940 nmm close range IR.
set_irled_on Turn on IR/LED 1 for success
set_irled_off Turn off IR/LED 1 for success
get_camera_time Get current timestamp on the camera unix timestamp
set_camera_time Set time on the camera using the bridge time 1 for success
get_night_switch_condition Get condition for auto night vision 1 = Dusk, 2 = Dark
set_night_switch_dusk Set auto night to dusk 1 for success
set_night_switch_dark Set auto night to dark 1 for success
set_alarm_on Turn on siren 1 for success
set_alarm_off Turn off siren 1 for success
get_alarm_status Get siren status (1,1) = On, (2,2) = off

Boa HTTP Server

NOTE: It appears that Boa has been disabled/removed in modern versions of the wyze firmware.

Some wyze cams have have a built-in http server "boa" that is enabled when downloading a time lapse from the camera. By enabling this http server, we can have full local access to the SD card on the camera, so you can download whatever you need off the SD card without having to take each camera down.

Enable Boa

SD Card and local connection REQUIRED.

This will enable the boa server on each camera http://<cam-ip>:80/ that has the boa server and has an SD card in the camera. PLEASE NOTE: If enabled, anyone on your local network will be able to access/download stuff from the SD Card on the camera.

environment:
    ..
    - ENABLE_BOA=true

Boa Interval

The boa server will go down after some time and needs to be restarted from time to time. This interval will keep the server up and pull any new images at the same time.

This will default to 5 if not set.

    - ENABLE_BOA=true
    - BOA_INTERVAL=30

Take Photo

SD Card and local connection REQUIRED.

This will take a high quality photo on the camera on each BOA_INTERVAL.

    - ENABLE_BOA=true
    - TAKE_PHOTO=true

Photos can also be taken on-demand by publishing to the MQTT topic wyzebridge/<camera-name>/takePhoto.

Pull Photo

SD Card and local connection REQUIRED.

This will pull the latest photo from the camera on each BOA_INTERVAL.

Files will be saved to your local img_dir as cam-name_YYYMMDD_HH_MM_SS.jpg or cam-name.jpg if TAKE_PHOTO is enabled.

    - ENABLE_BOA=true
    - PULL_PHOTO=true

Pull Alarm

SD Card and local connection REQUIRED.

In addition to pulling the latest alarm image from the camera on each BOA_INTERVAL, this will also trigger a motion event to the MQTT topic wyzebridge/<camera-name>/motion if available.

Files will be saved to your local img_dir as cam-name_alarm.jpg.

    - ENABLE_BOA=true
    - PULL_PHOTO=true

Motion Alerts

SD Card and local connection REQUIRED.

If the MQTT options are configured and enabled, motion events will be sent to the MQTT topic wyzebridge/<camera-name>/motion.

Motion alerts can also be sent via Webhook/HTTP to any url by specifying the url and using the variable {cam_name}:

    - ENABLE_BOA=true
    - MOTION_HTTP=http://localhost/triggerMotion?cam={cam_name}

Motion Cooldown

The number of seconds to keep the motion flag set to true in MQTT before it gets cleared or resending another HTTP/webhook event.

This will default to 10 if not set.

    - ENABLE_BOA=true
    - MOTION_COOLDOWN=30

Stream Recording

The bridge can be configured to record all or select camera streams to the container which can be mapped to a local directory.

Enable recording

environment:
...
  - TZ=America/New_York
  - RECORD_ALL=True
volumes:
  - /local/path/:/record/

Or to specify select cameras, where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

  - RECORD_CAM_NAME=True
  - RECORD_OTHER_CAM=True

🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

- CAM_NAME: Cam Name
  RECORD: true
- CAM_NAME: Other cam
  RECORD: true

See the Stream Recording wiki page page for additional options.

Offline camera IFTTT webhook (BETA)

This option can send a trigger to IFTTT's webhooks integration when the camera is detected as being offline (-90).

Note:This is still experimental as the connection will sometimes just timeout a number of times before going "offline".

  - OFFLINE_IFTTT=MyEventName:my_IFTTT_Webhooks_Key

The bridge should then trigger your event with the following values:

{
  "value1" : "cam-name", // camera name
  "value2" : -90, // error no
  "value3" : "IOTC_ER_DEVICE_OFFLINE" // error name
}

Livestream

Basic livestream support is available for YouTube and Facebook, but you can also specify any custom rtmp server for other services like Twitch.

To use this feature, set a new env in your docker-compose.yml with the service (YOUTUBE_ or FACEBOOK_) prefix followed by the camera name in UPPERCASE with _ in place of spaces and hyphens, and set your stream key as the value. Custom rtmp servers can be specified using the LIVESTREAM_ prefix:

  - YOUTUBE_FRONT_DOOR=MY-STREAM-KEY
  - FACEBOOK_OTHER_CAM=MY-STREAM-KEY
  # twitch example:
  - LIVESTREAM_CAM_NAME=rtmp://jfk.contribute.live-video.net/app/MY-STREAM-KEY

🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

- CAM_NAME: Cam Name
  LIVESTREAM: rtmp://jfk.contribute.live-video.net/app/MY-STREAM-KEY
- CAM_NAME: other cam
  LIVESTREAM: rtmp://a.rtmp.youtube.com/live2/my-youtube-key

MQTT (beta)

Some basic MQTT support is now available in v0.7.0.

MQTT auth and discovery should be automatic in Home Assistant mode - can be disabled by setting MQTT_HOST to False.

ENV Name Description Example
MQTT_HOST IP/Hostname AND Port of the MQTT broker core-mosquitto:1883
MQTT_AUTH Username AND password; leave blank if none user:pass
MQTT_TOPIC Optional - Specify topic prefix myhome
MQTT_DTOPIC Optional - Discovery topic for home assistant homeassistant

Bitrate and Resolution

Default option will select HD/2K resolution with 120 for bitrate (180 for doorbells).

Bitrate and resolution of the stream from the wyze camera can be adjusted with:

Set quality for all cameras

environment:
    - QUALITY=HD120

Set quality for single camera

where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

environment:
    - QUALITY_CAM_NAME=HD120

Additional info:

  • Resolution can be set to SD (360p in the app), HD - 640x360/1920x1080 for cams or 480x640/1296x1728 for doorbells.
  • Use HD to select the 2K (2560x1440) stream on the Pro cameras.
  • Bitrate can be set from 30 to 255. Some bitrates may not work with certain resolutions.
  • Adjusting the bitrate and resolution in the bridge will also change the stream in the wyze app and vice versa.
  • App equivalents would be:
    • 360p - SD30
    • SD - HD60 (HD120 for doorbell)
    • HD - HD120 (HD180 for doorbell)

Custom FFmpeg Commands

You can pass a custom command to FFmpeg by using FFMPEG_CMD in your docker-compose.yml:

For all cameras

environment:
    ..
    - FFMPEG_CMD=-f h264 -i - -vcodec copy -f flv rtmp://rtsp-server:1935/{cam_name}

For a specific camera

where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

- FFMPEG_CMD_CAM_NAME=ffmpeg -f h264 -i - -vcodec copy -f flv rtmp://rtsp-server:1935/{cam_name}

🏠 Home Assistant - Use CAM_OPTIONS and add a new entry for each camera:

- CAM_NAME: Cam Name
  FFMPEG: ffmpeg -f h264 -i - -vcodec copy -f flv rtmp://rtsp-server:1935/{cam_name}

Additional info:

  • The ffmpeg command is implied and is optional.
  • The camera name is available as a variable {cam_name} for lowercase and {CAM_NAME} for uppercase.
  • The audio pipe and format are available as the variable {audio_in}.

Custom FFmpeg Flags

Custom ffmpeg flags can easily be tested with:

environment:
    ..
    - FFMPEG_FLAGS=-fflags +flush_packets+genpts+discardcorrupt+nobuffer

or where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

- FFMPEG_FLAGS_CAM_NAME=-flags low_delay

Rotate Video

NOTE: The bridge may require additional resuorces when rotation is enabled as the video has to be re-encoded.

Hardware Acceleration may be available for h264 encoding on certain devices.

  • Rotate all doorbells:

    environment:
        ..
        - ROTATE_DOOR=True
  • Rotate other cameras where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens:

    Rotate by 90 degrees clockwise:

    environment:
        ..
        - ROTATE_CAM_CAM_NAME=True

    Rotate video in other directions:

        - ROTATE_CAM_OTHER_CAM=1 # 90 degrees clockwise.
        - ROTATE_CAM_THIRD_CAM=2 # 90 degrees counter-clockwise.

Available options:

  • 0 - Rotate by 90 degrees counter-clockwise and flip vertically.
  • 1 - Rotate by 90 degrees clockwise. This is the default.
  • 2 - Rotate by 90 degrees counter-clockwise.
  • 3 - Rotate by 90 degrees clockwise and flip vertically.

rtsp-simple-server

rtsp-simple-server options can be customized as an environment variable in your docker-compose.yml by prefixing RTSP_ to the UPPERCASE parameter.

e.g. use - RTSP_RTSPADDRESS=:8555 to overwrite the default rtspAddress.

or - RTSP_PATHS_ALL_READUSER=123 to customize a path specific option like paths: all: readuser:123

For camera specific options with spaces in the name of the camera (e.g. Front Door), be sure to replace the spaces with the URI_SEPARATOR which defaults to -. So Front Door would be represented as FRONT-DOOR, and paths: Front Door: runOnReady: ffmpeg... could be set in your docker-compose as:

environment:
  ...
  - RTSP_PATHS_FRONT-DOOR_RUNONREADY=ffmpeg...
  • 🏠 For Home Assistant: Enter each customization into RTSP_SIMPLE_SERVER, e.g. use paths_all_readusers=123 for paths: all: readuser:123.

Debugging options

environment options:

  • FRESH_DATA (bool) Remove local cache and pull new data from wyze servers.

  • ON_DEMAND (bool) Connect to and start streams on-demand/only when the stream is being viewd.

  • URI_SEPARATOR (-|_|#) Customize the separator used to replace spaces in the URI; available values are -, _, or use # to remove spaces.

  • CONNECT_TIMEOUT (int) Adjust the number of seconds to wait before timing out when connecting to camera. Default: 15

  • KEEP_BAD_FRAMES (bool) Keep frames that may be missing a keyframe or preceding frames.

  • IGNORE_OFFLINE (bool) Ignore offline cameras until container restarts.

  • OFFLINE_TIME (int) Customize the sleep time when a camera is offline. Default: 10

  • DEBUG_FRAMES (bool) Show all lost/incomplete frames.

  • DEBUG_LEVEL (debug|info|warning|error) Adjust the level of upstream logging.

  • RTSP_READTIMEOUT (str) Adjust the max number of seconds of missing frames allowed before a stream is restarted. Be sure to include the s after the number. Default: 20s

  • RTSP_LOGLEVEL (debug|info|warn) Adjust the verbosity of rtsp-simple-server; available values are "warn", "info", "debug".

  • SKIP_RTSP_LOG (bool) Prevent "read" spam in the logs when using RTSP based snapshots. Works by only logginng clients that stay connected for longer than 3s.

  • DEBUG_FFMPEG (bool) Enable additional logging from FFmpeg.

  • FORCE_FPS_CAM_NAME (int) Force a specific camera to use a different FPS, where CAM_NAME is the camera name in UPPERCASE and _ in place of spaces and hyphens.

  • FPS_FIX (bool) Set camera parameter to match the actual FPS being sent by the camera. Potential fix slow/fast SD card and cloud recordings.

  • WEBRTC (bool) Display WebRTC credentials for cameras.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].