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.5.0.tar.gz (175.2 kB view details)

Uploaded Source

Built Distribution

mxcube_video_streamer-1.5.0-py3-none-any.whl (175.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mxcube_video_streamer-1.5.0.tar.gz
  • Upload date:
  • Size: 175.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.14 Linux/5.14.0-1059-oem

File hashes

Hashes for mxcube_video_streamer-1.5.0.tar.gz
Algorithm Hash digest
SHA256 998a8a909e9b69a55bb3776e56ae7725479ec3b196990bf15f6849c3fb824f37
MD5 33549a4cb26041e4e66e408a13889f79
BLAKE2b-256 893fef551851804e7dc00c01ad8357ae4c259b9f1ece783d74e12aa7a7253058

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mxcube_video_streamer-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd9d337aad522f60b69182050f9ddfe81d3d2490c2bc8e86ccc669f3e5855718
MD5 0eae740b118c0f6dcdc089fb44c48294
BLAKE2b-256 900635a55a1efad3231da79b75db4bdbad36206a2d6656000a9f59268c233a0d

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