# HEVC Re-Encode Dashboard & Worker A lightweight, self-hosted web dashboard and queue worker for scanning media libraries and transcoding video files to **HEVC MKV** with selectable audio handling. It includes a modern dark dashboard, server-side CPU/GPU detection, folder browsers, live logs, safe rename and remux handling, and an optional force re-encode mode for normalizing an entire library. --- ## Features - ๐Ÿ–ฅ๏ธ **Cross-Platform Support**: Runs on Windows and Linux hosts. - โš™๏ธ **Zero Hardcoded Paths**: Configure Media and Temporary directories directly inside the dashboard. - ๐Ÿงฌ **Hardware Detection**: Automatically queries and displays the host CPU and GPU names. - ๐ŸŽฅ **Video Encoders**: Support for CPU `libx265`, NVIDIA NVENC, AMD AMF, and Intel QSV. - ๐ŸŽต **Audio Handling**: Copy original audio, keep source-aware audio behavior, or transcode to AAC/AC3. - ๐Ÿ” **Force Re-encode Mode**: Re-encode files to HEVC plus the selected audio codec even when the output is not smaller. - ๐Ÿท๏ธ **Optional Safe Renaming**: Rename outputs to Plex/Radarr/Sonarr-friendly names while preserving the library structure. - ๐Ÿงฑ **Remux Support**: Remux compatible files to MKV without re-encoding when possible. - ๐Ÿ”ง **Custom Binaries**: Set custom FFmpeg and FFprobe paths from the UI. - โšก **Auto-detected Worker Threads**: Recommends a thread count based on CPU cores, with manual override. - ๐Ÿ”” **Discord Webhooks**: Sends structured completion embeds with a built-in test button. - ๐Ÿ“ **Filesystem Browser Modal**: Browse drives and directories to choose media and temp folders. - ๐Ÿ“ˆ **Real-Time Progress & Logs**: Shows FPS, speed, ETA, progress bars, and live worker logs. - ๐Ÿงน **Safe Move and Temp Cleanup**: Handles cross-filesystem moves and cleans up failed temp outputs. --- ## Installation & Setup Before running, ensure **Python 3, FFmpeg, and FFprobe** are installed on the host machine. If you use the `start_dashboard.sh` script on Linux, it will attempt to **automatically detect your OS and install missing dependencies**! - **Windows**: Download from [gyan.dev](https://www.gyan.dev/ffmpeg/builds/) and add its `bin` folder to your system environment variables (`PATH`), or set custom paths in the Dashboard UI. - **Linux (CachyOS / Arch)**: ```bash sudo pacman -Sy python ffmpeg ``` - **Linux (Debian / Ubuntu)**: ```bash sudo apt update && sudo apt install -y python3 python3-venv ffmpeg ``` --- ## How to Run ### Windows 1. Double-click the `start_dashboard.bat` script in this repository. - This automatically creates virtual environments, installs lightweight dependencies (`Flask`, `Flask-CORS`, `requests`), and launches the worker API (port 5001) and web dashboard (port 5000). 2. Open your browser and go to **http://localhost:5000**. ### Linux 1. Make the startup script executable and run it: ```bash chmod +x start_dashboard.sh ./start_dashboard.sh ``` - This launches the worker API in the background (logging output to `server/worker.log`), runs the dashboard in the foreground, and automatically tears down the background processes when stopped (Ctrl+C). 2. Open your browser and go to **http://localhost:5000**. --- ## Usage Guide 1. **Media Directory**: Click the **Browse** button, choose an active drive/root volume, navigate to your media folder, and click **Select Folder** (or type it in manually). 2. **Temporary Directory**: Set this to a fast local SSD drive to prevent network performance bottlenecks during active transcoding. 3. **Hardware / Codec Limits**: Set your video encoder, audio format, and custom FFmpeg paths if required. 4. **Rename Output Files**: Enable this if you want safer library-friendly names during scan and processing. 5. **Force Re-encode**: Enable this if you want every queued file normalized to HEVC plus the selected audio codec, even when the result is larger. 6. **Threads**: Defaults to the server's auto-detected recommended thread count, or select a manual override. 7. **Discord Webhook**: (Optional) Paste your webhook URL. Click the **Test** button to confirm a success notification embed is received. 8. **Scan Media Library**: Scans files recursively. Files smaller than the _Min Size_ or already matched by the current target format are skipped or marked done. 9. **Run Processing**: Starts the transcode queue. ## Open Source Notes - The project is designed to be self-hosted and does not require cloud services. - Keep any test media out of the repository unless it is explicitly licensed for redistribution. - If you publish on GitHub, include a short note that the worker depends on FFmpeg/FFprobe being installed on the host.