Gateway to send streams to Galène videoconference server.
Project description
Galène streaming gateway
Gateway to send streams such as RTMP or SRT to Galène videoconference server. It is based on Gstreamer and implements the Galène protocol.
Tested on Debian Bullseye, Ubuntu 20.04, Ubuntu 20.10, ArchLinux and NixOS 20.09.
This project is still not production ready, and you might experience jittering and crashes.
User guide
Real-time video conversion requires resources. If many users are going to use this gateway simultaneously, you should scale your machine resources accordingly.
Installation on Debian/Ubuntu
sudo apt install python3-pip python3-gi python3-gi-cairo python3-websockets gir1.2-gst-plugins-bad-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-nice
pip3 install --user galene-stream
Installation on ArchLinux
sudo pacman -S python-setuptools python-pip python-websockets python-gobject gobject-introspection gst-python gst-plugins-base gst-plugins-bad gst-plugins-ugly gst-libav
pip install --user galene-stream
Installation from source code using Python Virtualenv
Start by cloning the source code,
git clone https://github.com/erdnaxe/galene-stream
cd galene-stream
Then create a Python VirtualEnv and install galene-stream inside,
python -m venv venv --system-site-packages
source venv/bin/activate
pip install -e .
Installation on Windows
Running the gateway on Windows is not tested and not recommended.
Go to http://www.msys2.org/ and follow the instructions to set up a MSYS2
environment. Then run C:\msys64\mingw64.exe
, you should have a terminal
window. Then execute,
# Update MSYS2
pacman -Suy
# Install Python3 and GStreamer
pacman -S mingw-w64-x86_64-python mingw-w64-x86_64-gcc mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-gobject mingw-w64-x86_64-gst-python mingw-w64-x86_64-gst-plugins-base mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav
pip install galene-stream
python -m galene_stream --help
Configuration for UDP streaming
Launch the gateway using:
galene-stream --input "udp://localhost:8888" --output "wss://galene.example.com/ws" --group test --username bot
Then you can stream to udp://localhost:8888
with no stream key.
Configuration for RTMP streaming
+--------------------+ +----------+ +-------------+ +------+
|Streaming software | RTMP |NGINX RTMP| RTMP |Galène Stream| WebRTC |Galène|
|(such as OBS-Studio)+------> Server <------+ Gateway +--------> |
+--------------------+ +----------+ +-------------+ +------+
You need a NGINX RTMP server, you may remix the provided nginx.conf. You can launch NGINX as user using:
nginx -c nginx.conf -p $PWD
You may launch the gateway after the NGINX server using:
galene-stream --input "rtmp://localhost:1935/live/test" --output "wss://galene.example.com/ws" --group test --username bot
Then you can stream to rtmp://127.0.0.1:1935/live
with stream key test
.
Configuration for SRT streaming
SRT support is still experimental in some Linux distributions. It has been reported to work on ArchLinux (on 2021/03/30).
When using OBS, you need to have FFMpeg compiled with SRT support.
To check if SRT is available, run ffmpeg -protocols | grep srt
.
On Windows and MacOS, OBS comes with his own FFMpeg that will work.
Launch the gateway using:
galene-stream --input "srt://localhost:9710?mode=listener" --output "wss://galene.example.com/ws" --group test --username bot
Then you can stream to srt://localhost:9710
with no stream key.
More information on OBS Wiki, Streaming With SRT Protocol.
Configuration for file streaming
For debugging purposes you can directly stream a file,
galene-stream --input "file://source.webm" --output "wss://galene.example.com/ws" --group test --username bot
Contributing
Collecting statistics about GStreamer WebRTC element
During a stream, you can send !webrtc
in the chat to get some statistics
about the connectivity between the gateway and Galène.
Debugging GStreamer pipeline
Logging pipeline statistics
You may use these environment variables,
GST_DEBUG="GST_TRACER:7" GST_TRACERS="latency;stats;rusage" GST_DEBUG_FILE=trace.log
Then you may inspect logs using gst-stats-1.0 trace.log
.
Plotting pipeline graph
It is possible to plot pipeline status just before exiting the script by setting
GST_DEBUG_DUMP_DOT_DIR
environnement variable to a directory.
For example, export GST_DEBUG_DUMP_DOT_DIR=.
.
Then you can use GraphViz to generate an image from the dot file:
dot -Tpng pipeline.dot > pipeline.png
.
Authors
This gateway is currently developed by members from Crans and Aurore network organizations to build a self-hosted free and open-source streaming server.
Main contributors:
- Alexandre Iooss
License
We believe in open source software. This project is licensed under MIT.
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
File details
Details for the file galene-stream-0.1.4.tar.gz
.
File metadata
- Download URL: galene-stream-0.1.4.tar.gz
- Upload date:
- Size: 391.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26e99453eea90f2dc06f439ad195cb4b0ff09a145a8edf808ac80b1d903853bb |
|
MD5 | 96e71f9af75a5b94c06b9dbcd64216db |
|
BLAKE2b-256 | 0fbb53ca9c79283a3ba9cbc19e64b58846491bde39e7792cadecaecba623c10e |
File details
Details for the file galene_stream-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: galene_stream-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2dba0138fcb09f90f89a623e8a81ac2a268a3ae8dd6d4f08973af85d64cd4d4 |
|
MD5 | 1d90f40c703fdeb62c5dd6f5e09a50ab |
|
BLAKE2b-256 | a849c067f4b63d750904c16c081bbd1969c592db1afe53f3274392e6fa8a7f15 |