diff --git a/README.md b/README.md index a0b29ac..c7cda8c 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,6 @@ Octoplex is a Docker-native live video restreamer. +--------------+ ``` -## Asciicast :video_camera: - -[![asciicast](https://asciinema.org/a/Es8hpa6rq82ov7cDM6bZTVyCT.svg)](https://asciinema.org/a/Es8hpa6rq82ov7cDM6bZTVyCT) - ## Installation ### Docker Engine @@ -64,10 +60,42 @@ Unarchive the `octoplex` binary and copy it somewhere in your $PATH. ## Usage -Launch the `octoplex` binary. +Octoplex can run as a single process (all-in-one), or in separate client/server mode. +Mode|Pick this when you... +---|--- +All-in-one|Are testing locally, debugging, or streaming from the same machine that runs Docker. +Client/server|Want the server on a remote host (e.g., cloud VM) for long-running or unattended streams. + +### All-in-one mode + +```bash +$ octoplex run ``` -$ octoplex + +Starts the media server and the terminal UI in one process. +Docker must be running on the same machine. + +### Client/server mode + +1. **Start the server** (on the host you want to handle the streams): + +```bash +$ octoplex server start +``` + +2. **Connect the client** (from your laptop or any host): + +```bash +$ octoplex client # --host my.remotehost.com if on a different host +``` + +Note: `client` is a lightweight TUI, it does not require Docker. + +3. **Stop the server** (and clean up and Docker resources) on the remote host: + +```bash +$ octoplex server stop ``` ### Restreaming with OBS diff --git a/main.go b/main.go index d30d4d5..ba10dc1 100644 --- a/main.go +++ b/main.go @@ -52,6 +52,14 @@ func main() { Name: "Octoplex", Usage: "Octoplex is a live video restreamer for Docker.", Commands: []*cli.Command{ + { + Name: "run", + Usage: "Run server and client in the same process", + Description: "Run the server and client in the same process. This is useful for testing, debugging or running for a single user.", + Action: func(c *cli.Context) error { + return runClientAndServer(c) + }, + }, { Name: "client", Usage: "Run the client", @@ -106,14 +114,6 @@ func main() { }, }, }, - { - Name: "run", - Usage: "Run server and client in the same process", - Description: "Run the server and client in the same process. This is useful for testing, debugging or running for a single user.", - Action: func(c *cli.Context) error { - return runClientAndServer(c) - }, - }, { Name: "version", Usage: "Print the version",