FFmpeg-Easy-Unraid

FFmpeg-Easy-Unraid

Docker app from nade's Repository

Overview

FFmpeg-Easy-Unraid is a "Set and Forget" Batch Transcoder designed for Unraid. Features: * Run-Once Workflow: This container scans /import on startup, processes the queue, and stops. To process new files, simply restart the container. It does not monitor continuously. * Structure: Recursively scans directories and preserves the exact folder structure (Great for TV Series). * Codecs: H.265 (HEVC) and AV1. (Note: AV1 requires modern GPU hardware like RTX 40xx or Intel Arc). * Hardware: CPU, Nvidia (NVENC), Intel (QuickSync/Arc). * Safety: Detects CPU pinning. Limits threads to 50% if no pinning is detected to prevent server freeze. IMPORTANT FOR NVIDIA USERS: To enable GPU support, you MUST enable "Advanced View" (top right) and add --runtime=nvidia to the "Extra Parameters" field! You must also set the "Nvidia Visible Devices" variable. IMPORTANT FOR INTEL GPU USERS: To enable QuickSync/Arc support, you must pass the device /dev/dri to the container (Add Device -> /dev/dri).

FFmpeg-Easy-Unraid

A "Set and Forget" Batch Transcoder designed for Unraid. Convert your media library (Movies, TV Series) to modern, space-saving formats (H.265/HEVC or AV1) with ease.


📖 About The Project

FFmpeg-Easy-Unraid is a Docker container built to simplify the process of shrinking large video libraries. It automatically scans an input directory, converts video files to highly efficient formats, and moves the original files to a "finished" folder upon success.

It is designed to be robust ("fail-safe"), supporting modern hardware acceleration while protecting your server from freezing via intelligent CPU monitoring.

Key Features

  • Run-Once Workflow: This container is designed to run on demand. It scans the /import directory on startup, processes the queue, and stops automatically when finished. It does not continuously monitor the folder to save resources. To process a new batch, simply restart the container.
  • Modern Codecs: Supports H.265 (HEVC) and AV1.
  • Hardware Acceleration: Full support for Nvidia NVENC, Intel QuickSync/Arc, and optimized CPU encoding.
  • Smart Workflow:
    • Scans /import for media.
    • Transcodes to /export.
    • Moves successfully processed originals to /import/finished.
    • Directory Preservation: Perfect for TV Shows! Recursively scans folders and recreates the exact directory structure (e.g., Series Name/Season 1/) in the output.
  • Safety First: Detects if CPU pinning is active. If not, it automatically limits thread usage to 50% of available cores to prevent Unraid from freezing.
  • Detailed Stats: Displays exact space savings (GB/MB and %) after every run.
  • Container Standardization: Automatically outputs to .MKV for maximum compatibility with subtitles and audio tracks.

🟢 How to Enable Nvidia Support (Important!)

By default, Docker containers cannot see your Graphics Card. To enable Nvidia NVENC support, follow these steps strictly:

Step 1: Install the Driver

In Unraid, go to the "Apps" tab (Community Applications) and install the "Nvidia Driver" plugin. Reboot if asked.

Step 2: Configure the Container

When adding or editing this container in Unraid:

  1. Switch to "Advanced View" (toggle in the top right corner).

  2. Find the field "Extra Parameters".

  3. Add the following text to the end of the line (separated by a space):

    --runtime=nvidia
    *(Note: Do not remove `--cap-add=SYS_NICE` if it is already there. Just add this after it.)*
    
  4. Find the Variable "Nvidia Visible Devices" (in Advanced View).

  • Set this to your GPU UUID (recommended, found in the Nvidia Driver Plugin settings).
  • OR set it to all if you only have one GPU.
  1. Apply the changes.

The container will now perform a hardware check on startup. If successful, logs will show [INIT] Hardware check passed.


⚖️ CPU vs. GPU Encoding: What should I choose?

  • Choose CPU Encoding (cpu_h265) if you want the best possible compression efficiency and quality preservation. CPU encoders (libx265) are generally smarter than GPU encoders, resulting in smaller files for the same visual quality. Ideally, use this for long-term archiving.
  • Choose GPU Encoding (nvidia_... / intel_...) if speed is your priority. GPUs can process files much faster, but the file size might be slightly larger to achieve the same visual quality compared to CPU encoding.

⚙️ Prerequisites

1. For Intel GPU Encoding (QuickSync / Arc)

  • Device Mapping: You must pass the device /dev/dri to the container.
  • AV1 Support: Requires an Intel Arc GPU or newer iGPU (Meteor Lake+).

2. For CPU Encoding

  • Recommendation: Use CPU Pinning in the Unraid Docker settings to assign specific cores. If you forget this, the script's safety mode will engage (limiting to 50% load).

🚀 Configuration & Environment Variables

The container is controlled via Environment Variables.

A Note on Defaults

Why these default values? The default settings (CRF 18 for H.265 / CRF 24 for AV1) are chosen based on extensive personal testing. In my experience, these values represent the "Sweet Spot": they provide significant file size reduction while maintaining visual quality that is virtually indistinguishable from the source. Unless you have specific needs, I recommend leaving the Quality fields empty to use these smart defaults.

Variable List

Variable Default Description
ENCODE_METHOD cpu_h265 The Encoder Engine.
Options: cpu_h265, cpu_av1, nvidia_h265, nvidia_av1, intel_h265, intel_av1.
ENCODE_PRESET default Speed vs. Efficiency.
default automatically picks medium (CPU) or p4 (Nvidia).
Manual options: slow, fast, p1-p7 (Nvidia), 0-13 (SVT-AV1).
ENCODE_THREADS 0 CPU Usage.
0 = Auto-Detect (Checks for pinning).
Set a number (e.g., 4) to force a specific thread count. Only affects CPU encoding.
ENCODE_CRF (Smart) Quality for CPU/Intel.
Lower value = Better Quality, Larger File.
Defaults: 18 (H.265), 24 (AV1).
ENCODE_CQ (Smart) Quality for Nvidia.
Lower value = Better Quality, Larger File.
Defaults: 19 (H.265), 24 (AV1).
FFMPEG_CUSTOM_ARGS (Empty) Audio/Subtitles Override.
Default behavior is -c:a copy -c:s copy.
Use this to convert audio, e.g., -c:a aac -b:a 192k.
NVIDIA_VISIBLE_DEVICES all GPU Selection.
Set to your GPU UUID (e.g., GPU-xxxx...) or all.
UNRAID_UID 99 User ID for file permissions (Standard Unraid: 99).
UNRAID_GID 100 Group ID for file permissions (Standard Unraid: 100).

📂 Folder Structure (Mappings)

You need to map two volumes in Docker/Unraid:

  1. Input: Map your source media folder to /import.
  • Note: The container needs Read/Write access to move finished files to /import/finished.
  1. Output: Map your destination folder to /export.

Example Workflow:

  1. You place a TV Show folder MySeries/Season 1/Episode 1.mkv in /import.
  2. Script converts it and saves the new version to /export/MySeries/Season 1/Episode 1.mkv.
  3. Script moves the original to /import/finished/MySeries/Season 1/Episode 1.mkv.
  4. Container Stops. To convert new files later, simply restart the container.

📜 License

Distributed under the GPL-3.0 license. See LICENSE for more information.


Author: metronade


Install FFmpeg-Easy-Unraid on Unraid in a few clicks.

Find FFmpeg-Easy-Unraid in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for FFmpeg-Easy-Unraid Review the template variables and paths Click Install

Download Statistics

836
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
metronade/ffmpeg-easy-unraid
Last Updated2026-01-05
First Seen2026-05-12

Runtime arguments

Network
bridge
Shell
bash
Privileged
false
Extra Params
--cap-add=SYS_NICE

Template configuration

Input Path (Source)Pathrw

Path to source files. Originals move to /finished after success.

Target
/import
Default
/mnt/user/import/
Output Path (Destination)Pathrw

Destination for converted files.

Target
/export
Default
/mnt/user/export/
Encoding MethodVariable

cpu_h265 (Best Quality), cpu_av1, nvidia_h265, nvidia_av1 (Requires RTX 40xx), intel_h265, intel_av1

Target
ENCODE_METHOD
Default
cpu_h265
PresetVariable

'default' (recommended) or manual (slow, fast, p1-p7).

Target
ENCODE_PRESET
Default
default
Quality (CRF - CPU/Intel)Variable

Lower = Better. Empty = Smart Default (18/24).

Target
ENCODE_CRF
Quality (CQ - Nvidia)Variable

Lower = Better. Empty = Smart Default (19/24).

Target
ENCODE_CQ
CPU ThreadsVariable

0 = Auto (Safety Mode: 50% if no pinning). Set number to force.

Target
ENCODE_THREADS
Default
0
Custom FFmpeg ArgsVariable

Override audio/sub args (Default: -c:a copy -c:s copy).

Target
FFMPEG_CUSTOM_ARGS
Nvidia Visible DevicesVariable

Set your GPU UUID here (e.g. GPU-xxxx) or leave as 'all'. REQUIRED for Nvidia encoding.

Target
NVIDIA_VISIBLE_DEVICES
Default
all
Nvidia Driver CapabilitiesVariable

Keep this as 'all' or 'compute,video,utility'.

Target
NVIDIA_DRIVER_CAPABILITIES
Default
all
Unraid User IDVariable

UID

Target
UNRAID_UID
Default
99
Unraid Group IDVariable

GID

Target
UNRAID_GID
Default
100