Script that integrates with rffmpeg to automagically create server nodes for transcoding using Hetzner API (hcloud-python library).
Go to file
Aleksa Siriški 7eb087ed49
Update LICENSE
2023-03-30 11:49:36 +02:00
.github Create FUNDING.yml 2023-02-11 13:21:31 +01:00
Dockerfile /config 2023-02-03 15:30:14 +01:00
LICENSE Update LICENSE 2023-03-30 11:49:36 +02:00
README.md rewrite in Go 2023-02-21 18:47:40 +01:00
docker-compose.example.yml JELLYFIN_LAN_ONLY_IP 2023-02-03 15:58:42 +01:00
hcloud-rffmpeg.py removed swap 2023-02-03 15:35:23 +01:00
requirements.txt first commit 2022-11-10 00:42:49 +01:00

README.md

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.

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

Environment variables

Name Default value Description
STATE_DIR /config Path to rffmpeg config
LOG_FILE STATE_DIR + /log/hcloud-rffmpeg.log Path to log file
DB_PATH STATE_DIR + /rffmpeg/rffmpeg.db Path to SQLite database file used by rffmpeg script
SSH_KEY STATE_DIR + /rffmpeg/.ssh/id_ed25519.pub Path to rffmpeg public ssh key generated by rffmpeg on jellyfin host
JELLYFIN_LAN_ONLY_IP Must 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_TOKEN Must be explicitly set! Hetzner Cloud API token
MEDIA_USERNAME "" Username for the media share
MEDIA_PASSWORD "" Password for the media share
SERVER_TYPE cx21 The type of server from Hetzner that should be used for workers
IMAGE_TYPE docker-ce The OS image used on workers, docker-ce is Ubuntu with Docker preinstalled
SSH_KEY_NAME root@jellyfin The name of the ssh key that will be saved on Hetzner and used for connecting to workers
NETWORK_NAME rffmpeg-workers The name of the network created for local communication between the workers and the Jellyfin host
FIREWALL_NAME rffmpeg-workers The name of the firewall created for workers, recommended to block access to ssh over the internet
PLACEMENT_GROUP_NAME rffmpeg-workers The name of the placement group created to spread the workers over the datacenter
LOCATION_NAME nbg1 The name of the location in which the workers should be created
CLOUD_CONFIG string The string that setups the workers after creation, the default uses my docker compose and inserts needed env variables
JOBS_PER_WORKER 2 Number 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.