{"id":26124716,"url":"https://github.com/abc3/hydra-srt","last_synced_at":"2026-05-03T20:04:53.088Z","repository":{"id":281488153,"uuid":"945434151","full_name":"abc3/hydra-srt","owner":"abc3","description":"HydraSRT – An Open Source Alternative to Haivision SRT Gateway","archived":false,"fork":false,"pushed_at":"2026-04-26T18:45:05.000Z","size":3166,"stargazers_count":69,"open_issues_count":5,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-26T20:26:44.163Z","etag":null,"topics":["elixir","gstreamer","live-streaming","low-latency","multimedia","rust","srt","srt-gateway"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abc3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-09T12:17:33.000Z","updated_at":"2026-04-26T18:34:19.000Z","dependencies_parsed_at":"2025-03-09T13:23:59.986Z","dependency_job_id":"73083e9c-b267-4330-8a9f-7950ba12a6bf","html_url":"https://github.com/abc3/hydra-srt","commit_stats":null,"previous_names":["abc3/hydra-srt"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/abc3/hydra-srt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abc3%2Fhydra-srt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abc3%2Fhydra-srt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abc3%2Fhydra-srt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abc3%2Fhydra-srt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abc3","download_url":"https://codeload.github.com/abc3/hydra-srt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abc3%2Fhydra-srt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32582852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","gstreamer","live-streaming","low-latency","multimedia","rust","srt","srt-gateway"],"created_at":"2025-03-10T16:49:56.638Z","updated_at":"2026-05-03T20:04:53.082Z","avatar_url":"https://github.com/abc3.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HydraSRT – An Open Source Alternative to Haivision SRT Gateway\n\n\u003e **Project Status**: HydraSRT is under active development. Some features are still evolving, and occasional breaking changes may occur.\n\n- [Overview](#overview)\n- [Motivation](#motivation)\n- [Architecture](#architecture)\n- [Docs](#docs)\n- [Features](#features)\n- [Deployment](#deployment)\n  - [Prerequisites](#prerequisites)\n- [Development](#development)\n- [Building for Production](#building-for-production)\n- [Inspiration](#inspiration)\n- [Contact](#contact)\n\n## Overview\n\nhttps://github.com/user-attachments/assets/8230f902-b037-424f-a337-a3828dac6a3c\n\nHydraSRT 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.\n\n## Motivation\n\nHydraSRT 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.\n\n## Architecture\n\nHydraSRT is structured into **three core layers**, each designed for efficiency, reliability, and modularity:\n\n### **1. Management \u0026 Control Layer (Elixir)**\n\n- **Manages streaming pipelines** and dynamic route configurations.\n- **Exposes a REST API** for frontend interaction.\n- **Uses SQLite (Ecto + `ecto_sqlite3`)** as the **primary database** for system state and configurations.\n\n#### Cluster Mode\n\nComing soon...\n\n### **2. Streaming \u0026 Processing Layer (Isolated Rust + GStreamer)**\n\n- **Memory safety \u0026 stability** – The Rust pipeline runs as a separate, isolated process, so faults in the media layer do not compromise the Elixir control plane. Elixir can monitor the process and terminate pipelines if necessary to maintain system stability.\n- **High-performance video processing** via **GStreamer**.\n- **Secure interprocess communication** with the Elixir layer.\n\u003c!-- - **Support for dynamic routing**, allowing real-time addition/removal of destinations. --\u003e\n\n### **3. User Interface Layer (Vite + React + Ant Design)**\n\n- **Communicates with the backend via REST API** for real-time control.\n- **Provides a dashboard and route management tools** for users to interact with the system.\n- **Supports user authentication and session management** to ensure secure access.\n- **Displays route status and allows for route configuration** through a user-friendly interface.\n\n## Docs\n\n- [Backend API Documentation](docs/api.md)\n\n## Features\n\n- [x] SRT Source Modes:\n  - [x] Listener\n  - [x] Caller\n  - [x] Rendezvous\n- [x] SRT Destination Modes:\n  - [x] Listener\n  - [x] Caller\n  - [x] Rendezvous\n- [x] SRT Authentication\n- [x] UDP Support:\n  - [x] Source\n  - [x] Destination\n- [ ] Cluster Mode\n- [ ] Dynamic Routing\n- [ ] RTSP\n- [ ] RTMP\n- [ ] HLS\n- [ ] MPEG-DASH\n- [ ] WebRTC\n\n[Missed something? Add a request!](https://github.com/abc3/hydra-srt/issues/new)\n\n### Source Failover (Primary + Backup)\n\nHydraSRT supports route-level source failover with one active source at a time:\n\n- **Primary + N backup sources** per route.\n- **Automatic failover** when active source fails.\n- **Manual source switch** via UI/API.\n- **Realtime active source updates** in the route page.\n\n#### Failover Modes\n\n- **`active`**: fail over on active source failure and use background probing to return to primary when stable.\n- **`passive`**: fail over only when current active source fails; no background primary probing.\n- **`disabled`**: disables automatic failover.\n\n#### Operational Notes\n\n- Failover is implemented in Elixir control-plane by restarting the native pipeline with the selected source.\n- Native pipeline input selection is **not hot-swapped in-place**.\n- A short output interruption during source switch/restart is expected.\n\n## Deployment\n\n### Prerequisites\n\n#### System Dependencies\n\nBefore deploying HydraSRT, ensure your system has the following dependencies installed:\n\n1. **Elixir** (version 1.17.1 or later)\n2. **Erlang/OTP** (version 27.0 or later)\n3. **Node.js** and npm (version 18.13.0 or later, for building the web UI)\n\n   \u003e **Recommended**: Use [asdf](https://asdf-vm.com/) for managing Elixir, Erlang, and Node.js versions.\n   \u003e The project includes a `.tool-versions` file with the following versions:\n   \u003e\n   \u003e - Elixir 1.17.1-otp-27\n   \u003e - Erlang 27.0\n   \u003e - Node.js 18.13.0\n\n4. **Rust**, Cargo, **GStreamer**, and related libraries for the streaming pipeline:\n\n   ```bash\n   # Ubuntu/Debian\n   sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \\\n     gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \\\n     libsrt-openssl-dev libglib2.0-dev pkg-config cargo rustc\n\n   # macOS (using Homebrew)\n   brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad \\\n     srt pkg-config rust\n   ```\n\n5. **Verify streaming pipeline dependencies** are correctly installed:\n   ```bash\n   pkg-config --libs gstreamer-1.0 gstreamer-base-1.0 glib-2.0 srt\n   ```\n   This command should output the linking flags without errors. If you see errors, ensure all required packages are installed.\n\n6. **DuckDB CLI** (used for analytics inspection/debugging):\n\n   ```bash\n   # Ubuntu/Debian and most Linux distributions\n   curl -fsSL https://install.duckdb.org | sh\n\n   # macOS (using Homebrew)\n   brew install duckdb\n   ```\n\n## Development\n\nTo run HydraSRT locally, start the Elixir app and Phoenix will also launch the Vite dev server for the web UI.\n\n### Backend\n\n```bash\n# Start the Elixir node and the Vite web UI watcher\nmake dev\n```\n\n## Building for Production\n\n\u003e **Production Note**: HydraSRT can be built for production, but the project is still evolving. Plan upgrades carefully and validate in staging before rollout.\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/abc3/hydra-srt.git\n   cd hydra-srt\n   ```\n\n2. **Build the release**:\n\n   ```bash\n   # Get Elixir dependencies\n   mix deps.get\n\n   # Install JavaScript dependencies for the web application\n   cd web_app \u0026\u0026 npm install \u0026\u0026 cd ..\n\n   # Compile the project\n   MIX_ENV=prod mix compile\n\n   # Create the release (this will automatically build the web app and Rust pipeline)\n   MIX_ENV=prod mix release\n   ```\n\n   The release process will:\n\n   - Compile the Elixir application\n   - Build the Rust pipeline from `./rs-native` via `mix compile.rs_native`\n   - Build the web application using `npm run build`\n   - Package everything into a self-contained release\n\n### Running in Production\n\nFor day-to-day debugging, `start_iex` is usually easier than `start` (see the pre-alpha note under **Building for Production** above).\n\n1. **Start the application**:\n\n   ```bash\n   # Interactive Elixir shell (handy for logs and debugging)\n   PHX_SERVER=true DATABASE_PATH=/etc/hydra_srt/hydra_srt.db API_AUTH_USERNAME=your_username API_AUTH_PASSWORD=your_password _build/prod/rel/hydra_srt/bin/hydra_srt start_iex\n   ```\n\n   Or in daemon mode (for stable production environments):\n\n   ```bash\n   # Start the application in the background\n   PHX_SERVER=true DATABASE_PATH=/etc/hydra_srt/hydra_srt.db API_AUTH_USERNAME=your_username API_AUTH_PASSWORD=your_password _build/prod/rel/hydra_srt/bin/hydra_srt start\n   ```\n\n2. **Additional commands**:\n\n   ```bash\n   # To stop the application\n   _build/prod/rel/hydra_srt/bin/hydra_srt stop\n\n   # To connect to a running application remotely\n   _build/prod/rel/hydra_srt/bin/hydra_srt remote\n\n   # To see all available commands\n   _build/prod/rel/hydra_srt/bin/hydra_srt\n   ```\n\n3. **Accessing the Web UI**:\n\n   After starting the application, the web interface will be available at:\n\n   ```\n   http://your_server_ip:4000\n   ```\n\n   Where:\n\n   - `your_server_ip` is the IP address or hostname of your server\n   - `4000` is the default port (can be changed using the `PORT` environment variable)\n\n   You'll need to use the credentials specified in `API_AUTH_USERNAME` and `API_AUTH_PASSWORD` to log in.\n\n### Environment Variables\n\nConfigure HydraSRT using the following environment variables:\n\n| Variable               | Description                             | Default          |\n| ---------------------- | --------------------------------------- | ---------------- |\n| `API_AUTH_USERNAME`    | Username for API authentication         | (required)       |\n| `API_AUTH_PASSWORD`    | Password for API authentication         | (required)       |\n| `PORT`                 | HTTP port for the API server            | 4000             |\n| `RELEASE_COOKIE`       | Erlang distribution cookie              | (auto-generated) |\n| `DATABASE_PATH`        | Path to SQLite database file            | (required)       |\n| `POOL_SIZE`            | DB pool size                            | 5                |\n\n### Troubleshooting\n\n1. **Streaming Pipeline Issues**:\n\n   - Verify all dependencies are installed with `pkg-config --libs gstreamer-1.0 gstreamer-base-1.0 glib-2.0 srt`\n   - Rebuild the Rust binary with `mix compile.rs_native`\n\n2. **Web Application Issues**:\n\n   - Ensure Node.js and npm are installed and working correctly\n   - Try building the web app manually: `cd web_app \u0026\u0026 npm install \u0026\u0026 npm run build`\n\n3. **Elixir Application Issues**:\n\n   - Ensure all required environment variables are set\n\n## Running with Docker\n\nTo run HydraSRT using Docker and Docker Compose, follow these steps:\n\n\u003e `duckdb` CLI is installed in the Docker image during build.\n\n1. **Build the Docker image**:\n\n   ```bash\n   docker compose build\n   ```\n\n2. **Start the application**:\n\n   ```bash\n   docker compose up\n   ```\n\n   This will start the application in Docker.\n   On first start (fresh `./data/db` volume), the container will automatically run DB migrations.\n   To disable auto-migrations, set `RUN_MIGRATIONS=false`.\n   By default, `docker-compose.yml` uses `DATABASE_PATH=/app/db/hydra_srt.db` and mounts `./data/db` to persist the SQLite database file across restarts.\n\n   To override the DB path (and/or increase `POOL_SIZE`), create a `.env` file:\n\n   ```bash\n   echo \"DATABASE_PATH=/app/db/hydra_srt.db\" \u003e .env\n   echo \"POOL_SIZE=1\" \u003e\u003e .env\n   ```\n\n3. **Access the Web UI**:\n\n   After starting the application, the web interface will be available at:\n\n   ```\n   http://127.0.0.1:4000\n   ```\n\n   Use the credentials specified in `API_AUTH_USERNAME` and `API_AUTH_PASSWORD` to log in.\n\n4. **Stop the application**:\n\n   To stop the application and remove the containers, run:\n\n   ```bash\n   docker compose down\n   ```\n\n### Network Mode: Host\n\nHydraSRT supports two Docker networking modes:\n\n- **Default (recommended / portable)**: normal bridge networking with explicit port mappings (works on Linux + Docker Desktop).\n- **Host network (Linux-only)**: share the host network namespace (useful for certain high-performance or port-binding scenarios).\n\n#### Default mode (portable, recommended for macOS/Windows)\n\n```bash\ndocker compose up --build\n```\n\nThe Web UI will be available at:\n\n```\nhttp://127.0.0.1:4000\n```\n\nUse this mode when you want a simple local setup (for example, on macOS) and only need the mapped ports from `docker-compose.yml` (e.g. `4000/tcp` and `4100-4500/udp`).\n\n#### Host network mode (Linux-only, recommended on Linux servers)\n\nDocker Desktop (macOS/Windows) does not support Linux-style `network_mode: \"host\"` in the same way, so this mode is intended for Linux hosts only.\n\n```bash\ndocker compose -f docker-compose.yml -f docker-compose.host.yml up -d\n```\n\nTo stop:\n\n```bash\ndocker compose -f docker-compose.yml -f docker-compose.host.yml down\n```\n\nWhen using Docker Compose, setting `network_mode: \"host\"` allows the container to share the host's networking namespace. This means:\n\n- The container will use the host's IP address and network interfaces.\n- Ports exposed by the container will be accessible on the host's network interfaces.\n- This mode is useful for applications that require high network performance or need to access services running on the host.\n\n**Implications:**\n\n- **Performance**: Network performance can be improved since there is no network translation between the host and the container.\n- **Security**: The container has access to the host's network, which can pose security risks if not managed properly.\n- **Port Conflicts**: Since the container shares the host's network, ensure that there are no port conflicts with other services running on the host.\n\n## Inspiration\n\n- [Secure Reliable Transport](https://en.wikipedia.org/wiki/Secure_Reliable_Transport)\n- [Haivision SRT Gateway](https://www.haivision.com/products/srt-gateway/)\n\n## Contact\n\nFor support or inquiries, create an issue here: [https://github.com/abc3/hydra-srt/issues](https://github.com/abc3/hydra-srt/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabc3%2Fhydra-srt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabc3%2Fhydra-srt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabc3%2Fhydra-srt/lists"}