Coder Social home page Coder Social logo

spyglass's Introduction

Spyglass


Please note that this project is in a very early stage. Use at your own risk. Think about contributing to the project if you find that something is not working, and you are able to fix it. Every contribution is appreciated.


A simple mjpeg server for Picamera2.

With Spyglass you are able to stream videos from a camera that is supported by libcamera like the Raspberry Pi Camera Module 3.

Prerequisites

  • Raspberry Pi OS Bullseye
  • Picamera2 - Already installed on Raspberry Pi OS Bullseye
  • Python 3
  • A camera supported by libcamera and connected to the Raspberry Pi

Quick Start

The server can be started with

./run.py

This will start the server with the following default configuration:

  • Address the server binds to: 0.0.0.0
  • Port: 8080
  • Resolution: 640x480
  • Framerate: 15fps
  • Stream URL: /stream
  • Snapshot URL: /snapshot

Configuration

On startup the following arguments are supported:

Argument Description Default
-b, --bindaddress Address where the server will listen for new incoming connections. 0.0.0.0
-p, --port Port where the server will listen for new incoming connections. 8080
-r, --resolution Resolution of the captured frames. This argument expects the format x 640x480
-f, --fps Framerate in frames per second (fps). 15
-st, --stream_url Sets the URL for the mjpeg stream. /stream
-sn, --snapshot_url Sets the URL for snapshots (single frame of stream). /snapshot
-af, --autofocus Autofocus mode. Supported modes: manual, continous continuous
-l, --lensposition Set focal distance. 0 for infinite focus, 0.5 for approximate 50cm. Only used with Autofocus manual 0.0
-s, --autofocusspeed Autofocus speed. Supported values: normal, fast. Only used with Autofocus continuous normal

Starting the server without any argument is the same as

./run.py -b 0.0.0.0 -p 8080 -r 640x480 -f 15 -st '/stream' -sn '/snapshot' -af continous -l 0.0 -s normal

The stream can then be accessed at http://<IP of the server>:8080/stream

Using Spyglass with Mainsail

If you ant to use Spyglass as a webcam source for Mainsail add a webcam with the following configuration:

  • URL Stream: /webcam/stream
  • URL Snapshot: /webcam/snapshot
  • Service: V4L-MJPEG

Install as application

If you want to install Spyglass globally on your machine you can use python -m pip install . to do so.

spyglass's People

Contributors

roamingthings avatar mryel00 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.