⚠️ Pre-Alpha Status: This project is in a very early development stage. Features may be incomplete, and breaking changes are expected.
- Overview
- Motivation
- Architecture
- Docs
- Features
- Deployment
- Development
- Building for Production
- Inspiration
- Contact
Screen.Recording.2025-03-09.at.17.18.22.1.mp4
HydraSRT is an open-source, high-performance alternative to the Haivision SRT Gateway. It is designed to provide a scalable and flexible solution for Secure Reliable Transport (SRT) video routing, with support for multiple streaming protocols.
HydraSRT aims to deliver a robust and adaptable solution for video routing, offering a scalable alternative to proprietary systems. It supports multiple streaming protocols, ensuring flexibility and high performance.
HydraSRT is structured into three core layers, each designed for efficiency, reliability, and modularity:
- Manages streaming pipelines and dynamic route configurations.
- Exposes a REST API for frontend interaction.
- Uses Khepri as a persistent tree-based key-value store for system state and configurations.
Coming soon...
- Memory safety & stability – The C-based application runs as a separate, isolated process, ensuring that memory leaks do not affect the Elixir control layer. Elixir can monitor for issues and terminate pipelines if necessary to maintain system stability.
- High-performance video processing via GStreamer.
- Secure interprocess communication with the Elixir layer.
- Communicates with the backend via REST API for real-time control.
- Provides a dashboard and route management tools for users to interact with the system.
- Supports user authentication and session management to ensure secure access.
- Displays route status and allows for route configuration through a user-friendly interface.
Coming soon.
- SRT Source Modes:
- Listener
- Caller
- Rendezvous
- SRT Destination Modes:
- Listener
- Caller
- Rendezvous
- SRT Authentication
- SRT Source Statistics
- SRT Destination Statistics
- UDP Support:
- Source
- Destination
- Cluster Mode
- Dynamic Routing
- RTSP
- RTMP
- HLS
- MPEG-DASH
- WebRTC
Missed something? Add a request!
Before deploying HydraSRT, ensure your system has the following dependencies installed:
-
Elixir (version 1.17.1 or later)
-
Erlang/OTP (version 27.0 or later)
-
Node.js and npm (version 18.13.0 or later, for building the web ui)
Recommended: Use asdf for managing Elixir, Erlang, and Node.js versions. The project includes a
.tool-versions
file with the following versions:- Elixir 1.17.1-otp-27
- Erlang 27.0
- Node.js 18.13.0
-
GStreamer and related libraries for the C application:
# Ubuntu/Debian sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ libcjson-dev libsrt-dev libcmocka-dev libgio2.0-dev pkg-config # macOS (using Homebrew) brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad \ cjson srt cmocka pkg-config
-
Verify C application dependencies are correctly installed:
pkg-config --libs gstreamer-1.0 libcjson cmocka gio-2.0 srt
This command should output the linking flags without errors. If you see errors, ensure all required packages are installed.
To run HydraSRT locally, you'll need to start both the Elixir backend and the web UI.
# Start the Elixir node
make dev
# Start the web UI
cd web_app && yarn dev
⚠️ Pre-Alpha Warning: As HydraSRT is in pre-alpha stage, production builds may have unexpected behaviors, bugs, or breaking changes. Use in production environments at your own risk and be prepared to troubleshoot issues.
-
Clone the repository:
git clone https://github.com/abc3/hydra-srt.git cd hydra-srt
-
Build the release:
# Get Elixir dependencies mix deps.get # Install JavaScript dependencies for the web application cd web_app && npm install && cd .. # Compile the project MIX_ENV=prod mix compile # Create the release (this will automatically build the web app and C application) MIX_ENV=prod mix release
The release process will:
- Compile the Elixir application
- Build the C application using
make
- Build the web application using
npm run build
- Package everything into a self-contained release
⚠️ Pre-Alpha Stability Notice: During this early development phase, the interactive shell mode (start_iex
) is strongly recommended as it allows you to monitor and debug issues in real-time. Expect frequent updates and potential breaking changes.
-
Start the application:
# Start the application with interactive Elixir shell (recommended during early development) API_AUTH_USERNAME=your_username API_AUTH_PASSWORD=your_password _build/prod/rel/hydra_srt/bin/hydra_srt start_iex
Or in daemon mode (for stable production environments):
# Start the application in the background API_AUTH_USERNAME=your_username API_AUTH_PASSWORD=your_password _build/prod/rel/hydra_srt/bin/hydra_srt start
-
Additional commands:
# To stop the application _build/prod/rel/hydra_srt/bin/hydra_srt stop # To connect to a running application remotely _build/prod/rel/hydra_srt/bin/hydra_srt remote # To see all available commands _build/prod/rel/hydra_srt/bin/hydra_srt
-
Accessing the Web UI:
After starting the application, the web interface will be available at:
http://your_server_ip:4000
Where:
your_server_ip
is the IP address or hostname of your server4000
is the default port (can be changed using thePORT
environment variable)
You'll need to use the credentials specified in
API_AUTH_USERNAME
andAPI_AUTH_PASSWORD
to log in.
Configure HydraSRT using the following environment variables:
Variable | Description | Default |
---|---|---|
API_AUTH_USERNAME |
Username for API authentication | (required) |
API_AUTH_PASSWORD |
Password for API authentication | (required) |
PORT |
HTTP port for the API server | 4000 |
RELEASE_COOKIE |
Erlang distribution cookie | (auto-generated) |
DATABASE_DATA_DIR |
Directory for Khepri database storage | ./khepri#node() |
VICTORIAMETRICS_HOST |
Host for VictoriaMetrics metrics export | (optional) |
VICTORIAMETRICS_PORT |
Port for VictoriaMetrics metrics export | (optional) |
-
C Application Issues:
- Verify all dependencies are installed with
pkg-config --libs gstreamer-1.0 libcjson cmocka gio-2.0 srt
- Check the C application logs in
_build/prod/rel/hydra_srt/log/
- Verify all dependencies are installed with
-
Web Application Issues:
- Ensure Node.js and npm are installed and working correctly
- Try building the web app manually:
cd web_app && npm install && npm run build
-
Elixir Application Issues:
- Ensure all required environment variables are set
-
Metrics Monitoring:
- To enable metrics export to VictoriaMetrics, set both
VICTORIAMETRICS_HOST
andVICTORIAMETRICS_PORT
environment variables - Example:
VICTORIAMETRICS_HOST=localhost VICTORIAMETRICS_PORT=8428 API_AUTH_USERNAME=admin API_AUTH_PASSWORD=password _build/prod/rel/hydra_srt/bin/hydra_srt start_iex
- You can visualize these metrics using Grafana or any other compatible dashboard tool
- To enable metrics export to VictoriaMetrics, set both
To run HydraSRT using Docker and Docker Compose, follow these steps:
-
Build the Docker image:
docker-compose build
-
Start the application:
docker-compose up
This will start the application and all its dependencies in Docker containers.
-
Access the Web UI:
After starting the application, the web interface will be available at:
http://127.0.0.1:4000
Use the credentials specified in
API_AUTH_USERNAME
andAPI_AUTH_PASSWORD
to log in. -
Stop the application:
To stop the application and remove the containers, run:
docker-compose down
When using Docker Compose, setting network_mode: "host"
allows the container to share the host's networking namespace. This means:
- The container will use the host's IP address and network interfaces.
- Ports exposed by the container will be accessible on the host's network interfaces.
- This mode is useful for applications that require high network performance or need to access services running on the host.
Implications:
- Performance: Network performance can be improved since there is no network translation between the host and the container.
- Security: The container has access to the host's network, which can pose security risks if not managed properly.
- Port Conflicts: Since the container shares the host's network, ensure that there are no port conflicts with other services running on the host.
For support or inquiries, create an issue here: https://github.com/abc3/hydra-srt/issues.