Encode on a PC you own
Connect a computer with a GPU, at home or in an office, as an encoder for your ClipMux server.
A PC agent is a computer you own that encodes for your ClipMux server, with its GPU if it has one. It connects out to the server, so it works behind NAT, and it holds no storage credentials: each job gives it a token and signed URLs for that job alone. It suits a small server with a GPU elsewhere, or a library of videos already on one machine.
This is a command-line option. The dashboard doesn't list PCs: you pair,
route and revoke them with clipmux commands and the
management API. Most installs don't need
one, because the server's own encoder already uses its GPU, and a VPS can
use Modal or
RunPod.
Before you start
- On Linux: amd64 or arm64 with glibc 2.39 or newer, such as Ubuntu 24.04, Debian 13 or Fedora 40 and later. Elsewhere (Windows, macOS, or another Linux), Docker.
- The server's public URL, for example
https://video.example.com, reachable from the PC. With videos stored on the server's disk, the PC downloads sources and uploads output through it. - A shell on the ClipMux server, to make a pairing code.
Install the agent on Linux
Make a pairing code
On the server:
cd /opt/clipmux && sudo docker compose exec app clipmux admin create-pairing --app studio-pc--app names the PC (the default is its hostname). The code is already
approved, works once, and expires after 15 minutes. POST /v1/agents/pairings
makes one through the API.
Run the installer on the PC
curl -fsSL https://clipmux.com/install-agent.sh | sudo sh -s -- \
--server https://video.example.com --pair ABCD-EFGHThe installer downloads the agent for the PC's architecture, checks it
against the release's SHA256SUMS, and sets up a systemd service that
starts it at boot. The agent comes with its own FFmpeg, Shaka Packager and
VAAPI drivers, so nothing else needs installing.
- With
sudo, it installs to/opt/clipmux-agent, with a system service that runs as aclipmux-agentuser in thevideoandrendergroups, for the GPU. - Without
sudo, it installs to~/.local/share/clipmux-agent, with a user service, and asks systemd to keep it running while you're logged out.
On a machine without systemd, it prints the command to run the agent yourself.
| Option | What it does |
|---|---|
--server URL | The ClipMux server's public URL. |
--pair CODE | The pairing code. Not needed to upgrade. |
--name NAME | What to call this PC. The default is its hostname. |
--version vX.Y.Z | Install that release instead of the latest. |
--uninstall | Stop and remove the agent. Its connection is kept for a reinstall. |
--purge | With --uninstall, also forget the connection. |
Run the installer again to upgrade; the connection is kept.
Or connect from the PC itself
If clipmux is already on the PC, start it with the server's URL:
clipmux worker --server https://video.example.comIt prints a code and opens the server's Connect a PC page
(/workers/connect) in your browser. Check the code matches, and choose
Connect. On a machine without a browser, open the printed link anywhere
you're signed in to the dashboard. The agent keeps its key in agent.json
(mode 0600) in your config directory, so from then on clipmux worker alone
starts it.
Run the agent in Docker
On Windows, macOS, or a Linux without glibc 2.39, the ClipMux image is also the agent:
docker run -d --name clipmux-agent --restart unless-stopped --no-healthcheck \
--user "$(id -u):$(id -g)" \
-v "$HOME/.config/clipmux:/var/lib/clipmux-agent" -e CLIPMUX_AGENT_DIR=/var/lib/clipmux-agent \
ghcr.io/visheshgubrani/clipmux:v1.0.0 worker --server https://video.example.com --pair ABCD-EFGHThe image tag is your server's own release, so the agent speaks its worker
API. It runs as your user and keeps its connection in ~/.config/clipmux, where
a restarted container finds it again. For a GPU, add one of these after
docker run:
- NVIDIA (Linux, or Windows through WSL2 and Docker Desktop):
--gpus all. This needs the NVIDIA Container Toolkit. - AMD or Intel (Linux):
--device /dev/dri --group-add "$(getent group render | cut -d: -f3)".
Docker Desktop on a Mac runs Linux in a VM without the GPU, so it encodes on the CPU. The sandbox still holds there.
Send jobs to PCs
A fresh install sends jobs to this server and paired PCs alike, so a PC starts taking jobs as soon as it connects. Choosing This server or a cloud GPU on Encoding changes that: PCs then take only the jobs of videos they registered themselves (below).
To send jobs to PCs again, set routing through the API, signed in as the owner (the routes need the dashboard's session cookie):
curl -X PUT https://video.example.com/v1/settings/routing \
-H 'Content-Type: application/json' \
--cookie "__Host-clipmux_session=…" \
-d '{"primary_executor": "workers"}'workers is this server and PCs; agents is PCs only. See
Routing, fallback and spend limits.
Encoders
The agent tests each GPU path when it starts and offers only the ones that
pass: nvenc, vaapi, cuda-decode, then cpu, with the hybrid paths for
sources the GPU can't decode. It's the same choice as on the server; see
Encode on this server. --encoder
(or CLIPMUX_ENCODER) picks the first path to try, CLIPMUX_VAAPI_DEVICE
picks a render node, and --encoder cpu skips the GPU.
The Linux agent has no CUDA build of whisper.cpp, so on an NVIDIA card it transcribes with Vulkan.
Videos that stay on the PC
clipmux push --local ~/Videos/courseThe files aren't uploaded. The agent on this PC registers them, encodes them
where they are, and uploads only the encrypted output. Without an API key
they become your own uploads, as if from the dashboard; with
CLIPMUX_API_KEY set, the key's app owns them.
- Jobs for these videos run only on this PC. While it's asleep they wait,
and they fail as
agent_unavailableif it stays away for 7 days. - A file that changes or disappears before it's encoded fails its job as
source_changedorsource_missing, and the video keeps playing what it had. --upload-sourcealso uploads each file to the server's storage after encoding it here, so any encoder can re-encode it later.- To limit which folders
push --localmay hand over, list them inagent.json:{ "roots": ["/home/me/Videos"] }. - In Docker, mount the videos at the same path inside the container, for
example
-v "$HOME/Videos:$HOME/Videos:ro".
These videos' sources never leave the PC unless you pass
--upload-source. Back them up yourself: if the PC's disk dies, the
videos keep playing, but can't be re-encoded.
The sandbox
Every ffmpeg and packager run on the PC is confined: no network, writes
only to the job's own directory, reads only system paths and the job's
source, with CPU, memory and file limits. An agent where the sandbox can't
hold (not Linux, or an old kernel) refuses to start unless you pass
--unsandboxed. It then takes only jobs pinned to it and the files you
upload in the dashboard, never an app's uploads or a file imported from a
URL.
Check it works
clipmux worker doctorIt checks the connection, the server, the key, the tool versions, the
sandbox, each encoder and scratch disk space, marking each with ✓ or ✗. Fix
the first ✗. clipmux worker doctor --offline skips the first three, to
check a machine before it's connected. With the system service, run it as
the service's user:
sudo -u clipmux-agent /usr/local/bin/clipmux worker doctor.
key accepted✗: the server revoked this PC. Removeagent.jsonand pair again.scratch disk: a source needs about three times its size free.- The installer says the agent didn't connect: the code expired or was used. Make a new one.
GET /v1/agents lists the PCs the server knows, with whether each is online
and sandboxed. The service's log is in journalctl -u clipmux-agent (or
journalctl --user -u clipmux-agent for a user install).
Disconnect a PC
DELETE /v1/agents/{id} revokes the PC at once: its key stops working, and
a job it was running moves to another encoder without using up a retry. If
you no longer trust what it encoded, POST /v1/agents/{id}/reencode
re-encodes every video whose current version that PC made. The dashboard
lists no PCs, so revoke one you no longer use: it keeps its key until you
do. Then run the installer with --uninstall --purge on the PC.