Giter Site home page Giter Site logo

arlo-streamer's Introduction

CodeQL

arlo-streamer

Python script that turns arlo cameras into continuous streams through ffmpeg This allow arlo cameras to be used in the NVR of your choosing. (e.g. Frigate)

The streams will provide an "idle" picture when the camera is not actively streaming. Motion will trigger an active stream, replacing the "idle" picture with the actual camera stream.

Note: For ideal operation, the arlo cameras should not be set to record on motion in the arlo app. This slows down stream setup significantly, leading to loss of valuable frames at the start of the event. A common approach is to choose push notification only, then disable notifications for the arlo app.

Usage

For frigate, see this example

Config through environment variables, if .env is present it will be checked for variables. Where applicable {name} will be replaced by camera name.

Required

ARLO_USER: Arlo account name
ARLO_PASS: Arlo password
IMAP_HOST: imap server to use for 2FA (see [pyaarlo](https://github.com/twrecked/pyaarlo) for details)
IMAP_USER: imap account
IMAP_PASS: imap password
FFMPEG_OUT: out-string for ffmpeg. (e.g. -c:v copy -c:a copy -f flv rtmp://127.0.0.1:1935/live/{name})

Optional

MOTION_TIMEOUT: How long to provide active stream after motion (in seconds) (default: 60)
MQTT_BROKER: If specified, will be used to publish snapshots and status, and control the camera (see MQTT).
MQTT_PORT: broker port (default: 1883)
MQTT_USER: broker username. Not setting this will result in an anonymous connection (default: None)
MQTT_PASS: broker password (default: None)
MQTT_TOPIC_PICTURE: snapshots will be published to this topic. (default: arlo/picture)
MQTT_TOPIC_STATUS: status will be published to this topic. (default: arlo/status/{name})
MQTT_TOPIC_CONTROL: control will be read on this topic. (default: arlo/control/{name})
MQTT_TOPIC_MOTION: motion events will be published to this topic. (default: arlo/motion/{name})
MQTT_RECONNECT_INTERVAL: Wait this amount before retrying connection to broker (in seconds) (default: 5)
STATUS_INTERVAL: Time between published status messages (in seconds) (default: 120)
DEBUG: True enables full debug (default: False)
PYAARLO_BACKEND: Pyaarlo backend. (default determined by pyaarlo). Options are `mqtt` and `sse`.
PYAARLO_REFRESH_DEVICES: Pyaarlo backend device refresh interval (in hours) (default: never)
PYAARLO_STREAM_TIMEOUT: Pyaarlo backend event stream timeout (in seconds) (default: never)
PYAARLO_STORAGE_DIR: Pyaarlo storage_dir. Define it if you want to change the Pyaarlo storage directory. (default determined by pyaarlo)

Running

python main.py

or

docker run -d --env-file .env kaffetorsk/arlo-streamer

MQTT

Pictures

JSON with "payload" set to base64 encoded image. "filename" set to "timestamp camera_name.jpg"

Status

JSON

Motion

Boolean

Control

Cameras

Payload in a simple string.

"START" and "STOP": Starts and stops active stream
"SNAPSHOT": Requests snapshot to be taken
Base Stations

JSON payload, all keys are optional.

{
    "mode": name of mode,
    "siren": "on"/"off"/{"duration": X seconds, "volume": 1-8}
}

Note: "siren": "on" defaults to 300 seconds, volume 8

Troubleshooting

socket.gaierror: [Errno -2] Name or service not known

Most likely due to Arlo backend MQTT event stream not working. Try:

PYAARLO_BACKEND=sse

Motion trigger stops after a while

Try:

PYAARLO_REFRESH_DEVICES=3
PYAARLO_STREAM_TIMEOUT=180

See Pyaarlo readme for more info

Notes

This repo is in early development, treat it as such and feel free to submit PRs.

arlo-streamer's People

Contributors

kaffetorsk avatar tyr84 avatar ypno 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.