Home

Awesome

HCLOUD-RFFMPEG

NOTICE!

I've rewritten this script in Go which is much easier to use and does more things automatically.

Kubernetes

Check this out!

Setup

  1. Set the required environment variables
  2. Share the volume of rffmpeg config directory with Jellyfin
  3. Make sure the cloud-init string works manually first
  4. All of your workers need Jellyfin's /config/transcodes and /config/data/subtitles directories available and mounted at the same path as the Jellyfin host. Best solution is to use NFSv4 with sync option.
  5. Also, I'm assuming you're using Hetzner Storage Box so the defaults will work for you, but if you aren't using a network drive for media you will need to share that directory via NFS as well.

If you need a reference docker compose file use this one.

Recommended images

I made and tested these images to use with this script:

Environment variables

NameDefault valueDescription
STATE_DIR/configPath to rffmpeg config
LOG_FILESTATE_DIR + /log/hcloud-rffmpeg.logPath to log file
DB_PATHSTATE_DIR + /rffmpeg/rffmpeg.dbPath to SQLite database file used by rffmpeg script
SSH_KEYSTATE_DIR + /rffmpeg/.ssh/id_ed25519.pubPath to rffmpeg public ssh key generated by rffmpeg on jellyfin host
JELLYFIN_LAN_ONLY_IPMust be explicitly set!The IP address of the jellyfin host / nfs share that workers use to access Jellyfin's transcodes and subtitles directories
HCLOUD_API_TOKENMust be explicitly set!Hetzner Cloud API token
MEDIA_USERNAME""Username for the media share
MEDIA_PASSWORD""Password for the media share
SERVER_TYPEcx21The type of server from Hetzner that should be used for workers
IMAGE_TYPEdocker-ceThe OS image used on workers, docker-ce is Ubuntu with Docker preinstalled
SSH_KEY_NAMEroot@jellyfinThe name of the ssh key that will be saved on Hetzner and used for connecting to workers
NETWORK_NAMErffmpeg-workersThe name of the network created for local communication between the workers and the Jellyfin host
FIREWALL_NAMErffmpeg-workersThe name of the firewall created for workers, recommended to block access to ssh over the internet
PLACEMENT_GROUP_NAMErffmpeg-workersThe name of the placement group created to spread the workers over the datacenter
LOCATION_NAMEnbg1The name of the location in which the workers should be created
CLOUD_CONFIGstringThe string that setups the workers after creation, the default uses my docker compose and inserts needed env variables
JOBS_PER_WORKER2Number of jobs allowed per worker, the default of 2 tells the script to only create a new worker if there are 2 or more jobs on the previous one.