Home / Walkthroughs / Emby GPU Transcoding
 Media Servers

Emby Media Server
with NVIDIA GPU Transcoding

Set up Emby on Docker with full NVIDIA hardware acceleration for 4K transcoding โ€” multiple simultaneous streams with zero CPU strain. Includes Handbrake batch conversion and library automation.

Intermediate ~90 minutes Docker + NVIDIA GPU
Emby Docker NVIDIA GPU Passthrough 4K Transcoding Handbrake
๐Ÿ“–
Overview

Emby is a self-hosted media server โ€” think personal Netflix. With hardware transcoding enabled, your NVIDIA GPU handles video encoding/decoding on the fly, meaning you can serve 3โ€“5 simultaneous 4K streams with nearly zero CPU usage.

The setup we use here: Emby runs as a Docker container on a Linux host (Arch Linux VM on KVM, or Unraid directly), with the NVIDIA GPU passed through from the hypervisor. The media library is stored on a NAS (ODIN via NFS) and mounted into the container.

Real-world test: 3 simultaneous 4K streams on mobile โ€” 2 direct, 1 transcoding โ€” zero buffering. Additional remote clients handled smoothly as well. The GPU barely breaks a sweat.
GPU passthrough reliability varies by hypervisor and guest OS. If NVIDIA driver detection fails inside a KVM VM, switching the guest OS from Arch Linux to Debian often resolves the issue โ€” Debian's more conservative kernel and driver stack tends to be more compatible with passed-through GPUs. Also consider increasing the database cache size in Emby settings to improve UI responsiveness.
๐ŸŽฎ
NVIDIA Driver Setup

The host OS needs NVIDIA drivers installed before Docker can access the GPU.

# Ubuntu / Debian apt install nvidia-driver-535 nvidia-utils-535 # Verify GPU is detected nvidia-smi

You should see output showing your GPU model, driver version, and CUDA version. If the GPU is passed through from a hypervisor (bhyve, KVM, XCP-NG), install drivers inside the VM โ€” the host doesn't need them.

On Unraid, the NVIDIA plugin handles driver installation through the Community Apps store. Don't install NVIDIA drivers manually on Unraid โ€” use the plugin.
๐Ÿณ
NVIDIA Docker Runtime

The NVIDIA Container Toolkit allows Docker containers to use the host GPU.

# Install NVIDIA Container Toolkit curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list apt update && apt install -y nvidia-container-toolkit # Configure Docker runtime nvidia-ctk runtime configure --runtime=docker systemctl restart docker # Verify docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
๐ŸŽฌ
Deploy Emby via Docker
version: '3.8' services: emby: image: emby/embyserver:latest container_name: emby restart: unless-stopped runtime: nvidia # NVIDIA GPU runtime environment: - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=all - UID=1000 - GID=1000 ports: - "8096:8096" # HTTP - "8920:8920" # HTTPS volumes: - /opt/emby/config:/config - /mnt/media/movies:/media/movies:ro - /mnt/media/tv:/media/tv:ro devices: - /dev/dri:/dev/dri # Intel/AMD GPU device node
The NVIDIA runtime handles device exposure automatically. The NVIDIA_VISIBLE_DEVICES=all environment variable exposes all GPUs to the container. Use a specific GPU ID (GPU-4d31ca78-...) to pin to one GPU when multiple are present.
โš™๏ธ
Configure GPU in Emby
  1. 1

    Open Emby Admin Dashboard

    Navigate to http://<emby-ip>:8096, complete setup wizard, then go to Admin Dashboard โ†’ Playback โ†’ Transcoding.

  2. 2

    Enable Hardware Acceleration

    Set Hardware Acceleration to NVIDIA NVENC. Emby will detect your GPU automatically if the NVIDIA runtime is configured correctly.

  3. 3

    Enable Hardware Decoding

    Check Enable hardware decoding for H264, H265/HEVC, and VP9. This offloads video decode (not just encode) to the GPU โ€” critical for 4K HEVC content.

Emby GPU configuration in Unraid
Emby Docker container configuration in Unraid โ€” GPU runtime params and NVIDIA device passthrough
Emby hardware transcoding enabled
Emby transcoding settings with NVIDIA NVENC hardware acceleration enabled
Emby active transcoding session
Active transcoding session in Emby โ€” GPU handling encode, minimal CPU usage
๐Ÿ”ง
Handbrake Batch Conversion

Pre-converting your library to a compatible format (H.264, 8Mbps for movies, 4Mbps for TV) eliminates transcoding entirely โ€” clients can direct play. This is especially useful for older clients that can't handle HEVC.

  1. 1

    Install HandBrakeCLI

    apt install handbrake-cli # or on Unraid: install via Community Apps
  2. 2

    Batch Convert a Directory

    Convert all MKV files in a directory to H.264 MP4:

    for f in /media/movies/*.mkv; do HandBrakeCLI -i "$f" -o "${f%.mkv}.mp4" \ --preset="Fast 1080p30" \ --vb 8000 \ # 8Mbps for movies --encoder nvenc_h264 \ # use NVIDIA GPU --aencoder av_aac done
  3. 3

    Use NZBGET Categories for Auto-Convert

    If using NZBGet for downloads, configure post-processing categories to automatically trigger HandBrakeCLI on completed downloads โ€” different bitrates for TV vs movies.

Use mediainfo to inspect your library and identify files that need conversion: mediainfo --Output=CSV /media/movies/*.mkv | grep -E "HEVC|VC-1". You can script this to generate a report and batch-convert only the incompatible files.
๐Ÿ“ฑ
Client Testing

Test from multiple client types to confirm direct play and transcoding quality:

Route Emby behind Nginx Proxy Manager with a subdomain (e.g. watch.yourdomain.com) pointing to the internal Emby port. Use DNS-only mode in Cloudflare โ€” Cloudflare's proxy explicitly prohibits video streaming through their network and will throttle or block the traffic.
Client Expected Behavior
Emby mobile (iOS/Android) Direct play H.264, transcode HEVC on cellular
Roku 1080p direct play H.264, transcode 4K content
LG / Samsung TV Direct play most formats; HDR passthrough if supported
Chrome / Edge browser H.264 direct; HEVC transcode (no native browser HEVC)

Monitor the Emby Dashboard during streaming to confirm GPU is being used (CPU usage should stay below 10% during transcode sessions).

๐Ÿ”ง
GPU Setup on Unraid

On Unraid, GPU passthrough to Docker is handled differently:

  1. 1

    Install NVIDIA Plugin

    In Unraid: Community Apps โ†’ search "NVIDIA" โ†’ install Unraid NVIDIA plugin by ich777. This adds NVIDIA driver support to Unraid's kernel.

  2. 2

    Configure Emby Container

    In the Emby Docker template in Unraid, add an extra parameter in the Extra Parameters field:

    --runtime=nvidia

    Add environment variables:

    NVIDIA_VISIBLE_DEVICES=GPU-4d31ca78-d605-aa77-a116-610b356fc58b NVIDIA_DRIVER_CAPABILITIES=all

    The GPU ID is unique to your hardware โ€” find it with nvidia-smi -L from the Unraid terminal.

๐Ÿ“š
References