octoplex

command module
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2025 License: AGPL-3.0-or-later Imports: 25 Imported by: 0

README

Octoplex 🐙

build status scan status GitHub Release Go Report Card

Octoplex is a Docker-native live video restreamer.

  • Restream RTMP/RTMPS to unlimited destinations
  • Broadcast using OBS or any standard tool
  • Add and remove destinations on-the-fly
  • Automatic reconnections on drop
  • Terminal UI with live metrics and health status
  • Powered by FFmpeg, Docker & other open source tools

How it works

         +------------------+             +-------------------+
         |      OBS          |  ---->     |     Octoplex      |
         | (Video Capture)   |   RTMP     |                   |
         +------------------+             +-------------------+
                                                 |
                                                 | Restream to multiple destinations
                                                 v
              +------------+     +------------+     +------------+     +--------------+
              |  Twitch.tv |     |   YouTube  |     | Facebook   |     |  Other       |
              +------------+     +------------+     +------------+     | Destinations |
                                                                       +--------------+

Installation

Docker Engine (only if you'll run Octoplex locally)

Linux: See https://docs.docker.com/engine/install/.

macOS: https://docs.docker.com/desktop/setup/install/mac-install/

Octoplex
Homebrew

Octoplex can be installed using Homebrew on macOS or Linux.

$ brew tap rfwatson/octoplex
$ brew install octoplex
From GitHub

Alternatively, grab the latest build for your platform from the releases page.

Unarchive the octoplex binary and copy it somewhere in your $PATH.

With Docker

See Running with Docker.

Starting Octoplex

Octoplex can run as a single process (all-in-one), or in a client/server pair.

Mode Pick this when you...
All-in-one Are testing locally, debugging, or streaming from the same machine that runs Docker (e.g. your laptop).
Client/server Want the server on a remote host (e.g., cloud VM) for long-running or unattended streams.
All-in-one
$ octoplex run

Starts the Octoplex server and the terminal UI in one process.

Docker must be running on the same machine.

Client/server
  1. Start the server (on the host that has Docker):
$ octoplex server start
  1. Connect the client (from your laptop or any host):
$ octoplex client start # --host my.remotehost.com if on a different host

client start is a lightweight TUI and does not need Docker to be installed.

  1. Stop the server (and clean up any Docker resources) on the remote host:
$ octoplex server stop
Subcommand reference
Subcommand Description
octoplex run Launch both server and client in a single process
octoplex server start Start the Octoplex server
octoplex server stop Stop the Octoplex server
octoplex client start Start the Octoplex TUI client
octoplex version Print the version
octoplex help Print help screen
Server flags
Flag Alias Modes Env var Default Description
--help -h All Show help
--data-dir server all-in-one OCTO_DATA_DIR $HOME/.local/state/octoplex (Linux) or$HOME/Library/Caches/octoplex (macOS) Directory for storing persistent state and logs
--listen-addr -a server OCTO_LISTEN_ADDR 127.0.0.1:50051 Listen address for gRPC API.
⚠ Must be set to a valid IP address to receive connections from other hosts. Use 0:0.0.0:50051 to bind to all network interfaces.
--hostname -H server OCTO_HOSTNAME localhost DNS name of server
--tls-cert server all-in-one OCTO_TLS_CERT Path to custom TLS certifcate (PEM-encoded, must be valid for hostname). Used for gRPC and RTMPS connections.
--tls-key server all-in-one OCTO_TLS_KEY Path to custom TLS key (PEM-encoded, must be valid for hostname). Used for gRPC and RTMPS connections.
--in-docker server OCTO_DOCKER false Configure Octoplex to run inside Docker
--stream-key server all-in-one OCTO_STREAM_KEY live Stream key, e.g. rtmp://rtmp.example.com/live
--rtmp-enabled server all-in-one true Enable RTMP server
--rtmp-listen-addr server all-in-one 127.0.0.1:1935 Listen address for RTMP sources.
⚠ Must be set to a valid IP address to receive connections from other hosts. See --listen-addr.
--rtmps-enabled server all-in-one false Enable RTMPS server
--rtmps-listen-addr server all-in-one 127.0.0.1:1936 Listen address for RTMPS sources.
⚠ Must be set to a valid IP address to receive connections from other hosts. See --listen-addr.
Client flags
Flag Alias Default Description
--help -h All
--host -H localhost:50051 Remote Octoplex server to connect to
--tls-skip-verify false Skip TLS certificate verification (insecure)
--log-file Path to log file
All-in-one mode

ℹ When running in all-in-one mode (octoplex run) some flags may be overridden or unavailable.

Usage

Restreaming with OBS
RTMP

Use the following OBS stream configuration:

OBS streaming settings for RTMP

RTMPS

Or to connect with RTMPS:

OBS streaming settings for RTMPS

⚠ Warning: OBS may not accept self‑signed certificates.

If you see the error

"The RTMP server sent an invalid SSL certificate."

then either install a CA‑signed TLS certificate for your RTMPS host, or import your self‑signed cert into your OS’s trusted store. See the server flags section above.

Restreaming with FFmpeg
RTMP
$ ffmpeg -i input.mp4 -c copy -f flv rtmp://localhost:1935/live
RTMPS
$ ffmpeg -i input.mp4 -c copy -f flv rtmps://localhost:1936/live

Advanced

Running with Docker

octoplex server can be run from a Docker image on any Docker engine.

⚠ By design, Octoplex needs to launch and terminate Docker containers on your host. If you run Octoplex inside Docker with a bind-mounted Docker socket, it effectively has root-level access to your server. Evaluate the security trade-offs carefully. If you’re unsure, consider running Octoplex directly on the host rather than in a container.

docker run

Run the Octoplex gRPC server on all interfaces (port 50051):

docker run \
  --name octoplex                              \
  -v octoplex-data:/data                       \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e OCTO_LISTEN_ADDR=":50051"                 \
  -p 50051:50051                               \
  --restart unless-stopped                     \
  ghcr.io/rfwatson/octoplex:latest

ℹ Note: Running the client — or the all-in-one server mode — from Docker is not recommended. Install Octoplex natively via Homebrew or download a release from GitHub instead. See Installation for details.

docker-compose

See docker-compose.yaml.

Contributing

See CONTRIBUTING.md.

Bug reports

Open bug reports on GitHub.

Acknowledgements

Octoplex is built on and/or makes use of other free and open source software, most notably:

Name License URL
Docker Apache 2.0 GitHub
FFmpeg LGPL Website
MediaMTX MIT GitHub
tview MIT GitHub

Licence

Octoplex is released under the AGPL v3 license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
mediaserver
package mediaserver is responsible for managing the media server, which is currently an instance of MediaMTX.
package mediaserver is responsible for managing the media server, which is currently an instance of MediaMTX.
tls
xdg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL