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.
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
Built Distribution
Hashes for mxcube_video_streamer-1.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a8e5fd917c4407e50d9c92f4717854ec88b33ee5edb32426f1ec5d7f78d219 |
|
MD5 | a4709729db0fd2d13f4c642fe642d07c |
|
BLAKE2b-256 | 2c95a714180ee0beec2d5062dc8f3a27db1da79644b65e21feef3e9516a136f1 |
Hashes for mxcube_video_streamer-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 905f78208224b890c5e0f442a5da661f8ec1e0b63f95a0e42a79f5f026d61c22 |
|
MD5 | 18cb774deb1e226b9b8d4ae9f022cd94 |
|
BLAKE2b-256 | cb0f46f9de8e48bef8abad498e4f72c1917247ac189f3bd28f9f2b478bb3a033 |