Reviewed-on: http://git.jdbnet.co.uk/jamie/goencode/pulls/14
GoEncode
GoEncode is a lightweight, high-performance media transcoding server written in Go. Originally built as a Flask app, it has been rewritten from the ground up as a single, self-contained binary. GoEncode features a modern web UI, a robust job queue, automatic watch folder monitoring, real-time log streaming, and MariaDB-backed persistence.
Features
- Watch Folders: Automatically monitor designated directories for new media files.
- Smart Queue & Debouncing: Prevents incomplete files from being processed while they are still being copied to the watch folder.
- Background Processing: Processes media sequentially with up to 3 worker threads. Files are safely copied to a temporary directory before encoding to avoid hammering network-attached storage (NAS).
- Format Intelligence: Probes media to detect codecs and resolution, automatically skipping files that already meet the target codec/resolution.
- Web Dashboard: Modern, responsive interface with Server-Sent Events (SSE) for live tracking of job progress, queue stats, and server logs.
- Robust Persistence: Job history, metrics (size saved, time taken), and configuration are all saved to a MariaDB/MySQL database.
- Webhook Notifications: Optional integration to send a JSON webhook payload when an encoding job fails.
- Docker-Ready: Packaged in an ultra-slim container image based on Debian, with
ffmpegbuilt-in.
Deployment with Docker
The easiest way to run GoEncode is via Docker using the pre-built image.
Image Registry
cr.jdbnet.co.uk/public/goencode:latest
Example docker-compose.yml
services:
goencode:
image: cr.jdbnet.co.uk/public/goencode:latest
container_name: goencode
restart: unless-stopped
ports:
- "8080:8080"
environment:
- GOENCODE_DB_HOST=db
- GOENCODE_DB_PORT=3306
- GOENCODE_DB_USER=goencode
- GOENCODE_DB_PASS=goencode_password
- GOENCODE_DB_NAME=goencode
- GOENCODE_SERVER_LISTEN=0.0.0.0
- GOENCODE_SERVER_PORT=8080
- GOENCODE_ENCODER_TEMP=/tmp/goencode
- TZ=Europe/London
# Web UI Authentication (Optional)
- GOENCODE_AUTH_USER=admin
- GOENCODE_AUTH_PASS=secret
# Notifications (Optional)
- GOENCODE_WEBHOOK_URL=http://your-webhook-endpoint.com/webhook
volumes:
- /path/to/your/media:/media
depends_on:
- db
db:
image: mariadb:10.11
container_name: goencode-db
restart: unless-stopped
environment:
- MARIADB_DATABASE=goencode
- MARIADB_USER=goencode
- MARIADB_PASSWORD=goencode_password
- MARIADB_ROOT_PASSWORD=root_password
volumes:
- goencode_db_data:/var/lib/mysql
volumes:
goencode_db_data:
Deployment with Binary
We also build the binary for Linux AMD64 which you can download from https://apps.jdbnet.co.uk/goencode
You'll need to make sure ffmpeg and gzip are available on your system
You'll also need to create the config file at /etc/goencode/goencode.yaml. You can copy and edit the example here
Configuration
GoEncode can be configured via goencode.yaml or entirely via environment variables (ideal for Docker/Kubernetes). Environment variables take precedence over the YAML file.
Available Environment Variables
| Variable | Description | Default |
|---|---|---|
GOENCODE_DB_HOST |
Database host | 127.0.0.1 |
GOENCODE_DB_PORT |
Database port | 3306 |
GOENCODE_DB_USER |
Database username | goencode |
GOENCODE_DB_PASS |
Database password | |
GOENCODE_DB_NAME |
Database name | goencode |
GOENCODE_SERVER_LISTEN |
IP to bind the web interface | 0.0.0.0 |
GOENCODE_SERVER_PORT |
Port for the web interface | 8080 |
TZ |
Container TimeZone | UTC |
GOENCODE_AUTH_USER |
Username for the web UI | |
GOENCODE_AUTH_PASS |
Password for the web UI | |
GOENCODE_WEBHOOK_URL |
Webhook URL for job failure notifications | |
GOENCODE_ENCODER_TEMP |
Temp directory for processing jobs | /tmp/goencode |