Coder Social home page Coder Social logo

prusa_connect_rtsp's Introduction

What is prusa-connect-rtsp?

Inspired by nunofgs on GitHub and with the help of BillyAB, this project simplifies using RTSP and MJPEG cameras with Prusa Connect.

FFmpeg is used to take periodic snapshots of an RTSP or MJPEG camera stream, then curl is used to pass it through to the Prusa Connect Camera API. By default, snapshots are taken and sent every 10 seconds, with an additional interval of 1 second per camera configured.

Personally, I have it running 5 RTSP streams from Eufy C24 Wi-Fi cameras on a single Raspberry Pi Zero 2W, without issue.

Getting Prusa Connect Tokens

It's best to consult Prusa's official documentation, as the interface may change over time, but the steps below should point you in the right direction:

  1. Open Prusa Connect web interface
  2. On a printer dashboard, go to the Camera tab
  3. Click Add new other camera
  4. Give the camera a name (optional)
  5. Copy the token
  6. Paste the token in to your docker-compose file or docker command

Note: If setting up multiple cameras, the order of your camera stream URLs should match the order of your tokens.

Usage

Camera stream URLs and Prusa Connect tokens are passed through to the script using environment variables. Single camera stream URLs and tokens can be specified, or multiples can be added by separating them with a comma. Below are some examples of how to run the container using Docker Compose or the Docker CLI.

docker compose (recommended)

version: '3.8'
services:
  prusa_connect_rtsp:
    image: jtee3d/prusa_connect_rtsp:latest
    restart: always
    environment:
      CAMERA_URLS: >
        rtsp://username:[email protected]/live0,
        http://username:[email protected]/stream.mjpeg,
        rtsp://username:[email protected]/live0
      TOKENS: >
        5dvoIByhfG7AeODTiNNk,
        MdVaUadfw93MBdlZSlqM,
        fejnJhrhCGncXsDU0R8S

docker cli

docker run \
  -e CAMERA_URLS="\
rtsp://username:[email protected]/live0,\
http://username:[email protected]/stream.mjpeg,\
rtsp://username:[email protected]/live0" \
  -e TOKENS="\
5dvoIByhfG7AeODTiNNk,\
MdVaUadfw93MBdlZSlqM,\
fejnJhrhCGncXsDU0R8S" \
  jtee3d/prusa_connect_rtsp:latest

Optionally, the following environmental values can be speficified:

  • FRAME_CAPTURE_DELAY (default: 1, used as the delay between multiple cameras)
  • CAMERA_CYCLE_DELAY (default: 10, used as the delay after all cameras have been processed, before looping through them again)
  • CONNECTION_TIMEOUT_DELAY (default: 5, timeout for ffmpeg and curl)

Links

Docker Hub: jtee3d/prusa_connect_rtsp

GitHub: jtee3d/prusa_connect_rtsp

Support

If you would like to support this Docker build, please feel free to buy me a coffee!

prusa_connect_rtsp's People

Contributors

jtee3d 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.