Distribute your video encoding tasks across a cluster of nodes!
4.2K
Automatically convert your movies and TV shows from one file format to another using ffmpeg in a cluster.

I hate long docker run commands with tons of arguments, so here is a docker-compose template:
version: "2.2"
services:
clustercode:
restart: always
image: braindoctor/clustercode:latest
container_name: clustercode
cpu_shares: 512
ports:
- "7600:7600/tcp"
- "8080:8080"
volumes:
- "/path/to/input:/input"
- "/path/to/output:/output"
- "/path/to/profiles:/profiles"
# If you need modifications to the xml files, persist them:
# - "/path/to/config:/usr/src/clustercode/config"
environment:
# overwrite any settings from the default using env vars!
- CC_CLUSTER_JGROUPS_TCP_INITIAL_HOSTS=your.other.docker.node[7600],another.one[7600]
- CC_CLUSTER_JGROUPS_EXT_ADDR=192.168.1.100
The external IP address is needed so that other nodes will be available to contact the local node. Use the physical address of the docker host.
This is untested, as I don't have a Swarm. Just make sure to limit the CPU resources somehow, so that other containers still work reliably. I'm assuming that encoding is a low-priority service that takes forever anyway.
version: "3.2"
services:
clustercode:
image: braindoctor/clustercode:stable
ports:
- "7600:7600/tcp"
- "7600:7600/udp"
volumes:
- "/path/to/input:/input"
- "/path/to/output:/output"
- "/path/to/profiles:/profiles"
# If you need modifications to the xml files, persist them:
# - "/path/to/config:/usr/src/clustercode/config"
deploy:
restart_policy:
condition: any
max_attempts: 3
window: 30s
delay: 3s
resources:
limits:
cpus: "3"
When you first start the container using docker compose, it will create a default configuration
file in /usr/src/clustercode/config (in the container). You can view the settings in the
clustercode.properties file and deviate from the default behaviour of the software. However, you should
modify the settings via Environment variables (same key/values syntax). Environment variables always take precedence
over the ones in clustercode.properties. If you made changes to the XML files, you need to mount a path from outside
in order to have them persistent.
Sporadic Maintenance as of February 2018.
The REST API and WebAdmin are easy to support with SSL/https. Just put a reverse proxy in front of clustercode that handles https client connections and forwards the request via http to clustercode. Check out https://github.com/jwilder/nginx-proxy for an excellent docker nginx proxy with SSL support.
The cluster communication is more difficult to set up with encryption. Even though the traffic is binary and hard enough to intercept, it is not encrypted by default. You need to change the JGroups configuration. Instructions can be found in the manual.
Generally this image and software is built with flexibility and simplicity in mind, not security. Use it at your own risk.
Content type
Image
Digest
Size
147.8 MB
Last updated
over 8 years ago
docker pull braindoctor/clustercode