# 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](https://user-images.githubusercontent.com/4331447/222733892-c7d3af26-26ca-4a3c-b9f4-ab56fc91e390.png)
### 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"
}
}
}
```
Raw data
{
"_id": null,
"home_page": "http://github.com/mxcube/fast-api-streamer",
"name": "mxcube-video-streamer",
"maintainer": "Marcus Oskarsson",
"docs_url": null,
"requires_python": "<3.11,>=3.7",
"maintainer_email": "oscarsso@esrf.fr",
"keywords": "mxcube, fast-api-streamer, video_streamer, mxcubeweb",
"author": "Marcus Oskarsson",
"author_email": "oscarsso@esrf.fr",
"download_url": "https://files.pythonhosted.org/packages/3b/03/67b33930197483b213de77af515bf95b7b7caa8e313d35908f90ba8bc925/mxcube_video_streamer-1.3.0.tar.gz",
"platform": null,
"description": "# video-streamer\nVideo 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.\n\n![Screenshot from 2023-03-03 14-36-02](https://user-images.githubusercontent.com/4331447/222733892-c7d3af26-26ca-4a3c-b9f4-ab56fc91e390.png)\n\n### Installation\n\n```\ngit clone https://github.com/mxcube/video-streamer.git\ncd video-streamer\n\n# optional \nconda env create -f conda-environment.yml\n\n# For development\npip install -e .\n\n# For usage \npip install .\n```\n\n### Usage\n```\nusage: video-streamer [-h] [-c CONFIG_FILE_PATH] [-tu TANGO_URI] [-hs HOST] [-p PORT] [-q QUALITY] [-s SIZE] [-of OUTPUT_FORMAT] [-id HASH] [-d]\n\nmxcube-web Backend server command line utility.\n\noptions:\n -h, --help show this help message and exit\n -c CONFIG_FILE_PATH, --config CONFIG_FILE_PATH\n Configuration file path\n -tu TANGO_URI, --tango-uri TANGO_URI\n Tango device URI\n -hs HOST, --host HOST\n Host name to listen on for incomming client connections defualt (0.0.0.0)\n -p PORT, --port PORT Port\n -q QUALITY, --quality QUALITY\n Compresion rate/quality\n -s SIZE, --size SIZE size\n -of OUTPUT_FORMAT, --output-format OUTPUT_FORMAT\n output format, MPEG1 or MJPEG1\n -id HASH, --id HASH Sream id\n -d, --debug Debug true or false\n```\n\nThere 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.\n\n### Example command line (for testing):\n```\nvideo-streamer -d -of MPEG1 -tu test\n```\n\n#### Example configuration file (config.json):\nThe 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:\n \n MPEG1: http://localhost:8000/ui\n \n MJPEG: http://localhost:8001/ui\n\n\n```\nvideo-streamer -c config.json\n\nconfig.json:\n{\n \"sources\": {\n \"0.0.0.0:8000\": {\n \"input_uri\": \"test\",\n \"quality\": 4,\n \"format\": \"MPEG1\"\n },\n \"0.0.0.0:8000\": {\n \"input_uri\": \"test\",\n \"quality\": 4,\n \"format\": \"MJPEG\"\n }\n }\n}\n```\n \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "FastAPI Based video streamer",
"version": "1.3.0",
"project_urls": {
"Documentation": "http://github.com/mxcube/fast-api-streamer",
"Homepage": "http://github.com/mxcube/fast-api-streamer",
"Repository": "http://github.com/mxcube/fast-api-streamer"
},
"split_keywords": [
"mxcube",
" fast-api-streamer",
" video_streamer",
" mxcubeweb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6b0a6efc2cbe2502fca335981a96b6cf32c0c4353238dd7674c187531d89b13c",
"md5": "db35f1064e5a7fb012c9b97f439b4fd5",
"sha256": "79144318f749d583108fcc312c462e27c2f20d56bb45406376fb8439e31e2a8a"
},
"downloads": -1,
"filename": "mxcube_video_streamer-1.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "db35f1064e5a7fb012c9b97f439b4fd5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.11,>=3.7",
"size": 173896,
"upload_time": "2024-03-27T07:12:56",
"upload_time_iso_8601": "2024-03-27T07:12:56.889977Z",
"url": "https://files.pythonhosted.org/packages/6b/0a/6efc2cbe2502fca335981a96b6cf32c0c4353238dd7674c187531d89b13c/mxcube_video_streamer-1.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3b0367b33930197483b213de77af515bf95b7b7caa8e313d35908f90ba8bc925",
"md5": "01f22f91df988f212ae307591a99c12f",
"sha256": "34051fe7a1a67269e020de5e74c3d3f0679bd5a8d28f3d2c9c39e9d9b97008a0"
},
"downloads": -1,
"filename": "mxcube_video_streamer-1.3.0.tar.gz",
"has_sig": false,
"md5_digest": "01f22f91df988f212ae307591a99c12f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.11,>=3.7",
"size": 183549,
"upload_time": "2024-03-27T07:12:59",
"upload_time_iso_8601": "2024-03-27T07:12:59.054180Z",
"url": "https://files.pythonhosted.org/packages/3b/03/67b33930197483b213de77af515bf95b7b7caa8e313d35908f90ba8bc925/mxcube_video_streamer-1.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-27 07:12:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mxcube",
"github_project": "fast-api-streamer",
"github_not_found": true,
"lcname": "mxcube-video-streamer"
}