Package: galene-stream
Galène streaming gatewayGateway to send streams such as RTMP or SRT toGalène videoconference server.
It is based on Gstreamer and implements the Galène protocol.:warning:This project is not production ready, and you might experience
jittering and crashes.See future plans.InstallationReal-time video conversion requires resources. If many users are going to use
this gateway simultaneously, you should scale your machine resources
accordingly.Installation works on Ubuntu 20.10 and Debian Bullseye or any later version.For Windows users, we recommend to useWindows Subsystem for Linux.Dependencies# On Debian/Ubuntu-based distributionssudoaptinstallpython3-gipython3-gi-cairopython3-websocketsgir1.2-gst-plugins-bad-1.0gstreamer1.0-plugins-goodgstreamer1.0-plugins-badgstreamer1.0-plugins-uglygstreamer1.0-libavgstreamer1.0-nice# On ArchLinux-based distributionssudopacman-Spython-setuptoolspython-pippython-websocketspython-gobjectgobject-introspectiongst-pythongst-plugins-basegst-plugins-badgst-plugins-uglygst-libav# On NixOSnix-shell-pgobject-introspection-pgst_all_1.gst-libav-pgst_all_1.gst-plugins-bad-pgst_all_1.gst-plugins-base-pgst_all_1.gst-plugins-good-pgst_all_1.gst-plugins-ugly-plibnice-ppython3-ppython3Packages.gst-python-ppython3Packages.pygobject3-ppython3Packages.websocketsThen you should be able to either run./galene-stream.pyin this repository,
or install it using pip.Configuration for UDP streamingLaunch the gateway using:galene-stream --input "udp://127.0.0.1:8888" --output "wss://galene.example.com/ws" --group test --username botThen you can stream toudp://127.0.0.1:8888with 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 providednginx.conf. You can launch NGINX as user using:nginx -c nginx.conf -p $PWDYou may launch the gateway after the NGINX server using:galene-stream --input "rtmp://127.0.0.1:1935/live/test" --output "wss://galene.example.com/ws" --group test --username botThen you can stream tortmp://127.0.0.1:1935/livewith stream keytest.Configuration for SRT streamingSRT 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, runffmpeg -protocols | grep srt.
On Windows and MacOS, OBS comes with his own FFMpeg that will work.Launch the gateway using:galene-stream --input "srt://127.0.0.1:9710?mode=listener" --output "wss://galene.example.com/ws" --group test --username botThen you can stream tosrt://127.0.0.1:9710with no stream key.More information onOBS Wiki, Streaming With SRT Or RIST Protocols.Configuration for file streamingFor debugging purposes you can directly stream a file,galene-stream --input "file://source.webm" --output "wss://galene.example.com/ws" --group test --username botContributingWe welcome contributions that stays in the scope of this project.
Please format your code usingblackand test it usingpytest.Collecting statistics about GStreamer WebRTC elementDuring a stream, you can send!webrtcin the chat to get some statistics
about the connectivity between the gateway and Galène.Debugging GStreamer pipelineLogging pipeline statisticsYou may use these environment variables,GST_DEBUG="GST_TRACER:7" GST_TRACERS="latency;stats;rusage" GST_DEBUG_FILE=trace.logThen you may inspect logs usinggst-stats-1.0 trace.log.Plotting pipeline graphIt is possible to plot pipeline status just before exiting the script by settingGST_DEBUG_DUMP_DOT_DIRenvironnement 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.Future plansThe WISH IETF workgroup is working on theWebRTC-HTTP ingestion protocol (WHIP).
Galène hasan experimental branchwhipimplementing a WHIP server.
OBS Studio is currently working (as of December 2022) onadding WHIP output support.Using WHIP directly removes the need for a transcoding gateway, and make
streamers life simpler. Galène-stream should be considered as a temporary
solution until WHIP gets standardized and implemented.LicenseThis gateway is developed by former members ofCransandAurorenetwork organizations to build a self-hosted
free and open-source streaming server based onGalène.We believe in open source software.
This project is licensed underMIT.