Skip to main content

FastAPI Based video streamer

Project description

video-streamer

Video streamer to be used with MXCuBE. The streamer currently suports streaming from Tango (Lima) devices but can be extened to used with other camera solutons aswell. The output streams are either MJPEG or MPEG1.

Screenshot from 2023-03-03 14-36-02

Installation

git clone https://github.com/mxcube/video-streamer.git
cd video-streamer

# optional 
conda env create -f conda-environment.yml

# For development
pip install -e .

# For usage 
pip install .

Usage

usage: video-streamer [-h] [-c CONFIG_FILE_PATH] [-tu TANGO_URI] [-hs HOST] [-p PORT] [-q QUALITY] [-s SIZE] [-of OUTPUT_FORMAT] [-id HASH] [-d]

mxcube-web Backend server command line utility.

options:
  -h, --help            show this help message and exit
  -c CONFIG_FILE_PATH, --config CONFIG_FILE_PATH
                        Configuration file path
  -tu TANGO_URI, --tango-uri TANGO_URI
                        Tango device URI
  -hs HOST, --host HOST
                        Host name to listen on for incomming client connections defualt (0.0.0.0)
  -p PORT, --port PORT  Port
  -q QUALITY, --quality QUALITY
                        Compresion rate/quality
  -s SIZE, --size SIZE  size
  -of OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
                        output format, MPEG1 or MJPEG1
  -id HASH, --id HASH   Sream id
  -d, --debug           Debug true or false

There is the possibility to use a configuration file instead of command line arguments. All command line arguments except debug are ignored if a config file is used. The configuration file also makes it possible to configure several sources while the command line only allows configuration of a single source.

Example command line (for testing):

video-streamer -d -of MPEG1 -tu test

Example configuration file (config.json):

The configuration file format is JSON. A test image is used when the input_uri is set to "test". The example below creates one MPEG1 stream and one MJPEG stream from the test image. There is a defualt test/demo UI to see the video stream on http://localhost:[port]/ui. In example below case:

MPEG1: http://localhost:8000/ui

MJPEG: http://localhost:8001/ui

video-streamer -c config.json

config.json:
{
    "sources": {
        "0.0.0.0:8000": {
            "input_uri": "test",
            "quality": 4,
            "format": "MPEG1"
        },
        "0.0.0.0:8000": {
            "input_uri": "test",
            "quality": 4,
            "format": "MJPEG"
        }
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mxcube_video_streamer-1.0.0.tar.gz (183.8 kB view details)

Uploaded Source

Built Distribution

mxcube_video_streamer-1.0.0-py3-none-any.whl (173.6 kB view details)

Uploaded Python 3

File details

Details for the file mxcube_video_streamer-1.0.0.tar.gz.

File metadata

  • Download URL: mxcube_video_streamer-1.0.0.tar.gz
  • Upload date:
  • Size: 183.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.8 Linux/5.14.0-1059-oem

File hashes

Hashes for mxcube_video_streamer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c283f6e575e7e97d867cd2f746cc3e1d1b75920b781e736efd68228d667de8e0
MD5 1fd2a4fdd834ef911861a75b6d61b2b2
BLAKE2b-256 4547733b4e77d0e2c270d762dcf2dce6df7fc844b814d2647c50070e1bcadc30

See more details on using hashes here.

File details

Details for the file mxcube_video_streamer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mxcube_video_streamer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5338a55d4fedef510acdd25d6e8d3482d913c05a497e9749ceac1ffdbca5fbd
MD5 68272b4e3f0d7dd7375e9e6b91b880f6
BLAKE2b-256 885c1b17c21402df051b5c2a039eb09f330a1c3cd83fdd85c36617f56b375cfd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page