Best Handbrake and FFmpeg Settings for Jellyfin in 2026: Encode for Direct Play on Every Device
You have a library of media files in random formats. Some are ancient XviD AVI files. Some are 80 GB Blu-ray remuxes. Some are H.264, some H.265, some have DTS audio that half your clients cannot play. The result: constant transcoding, buffering, and frustrated users.
The fix is encoding your files once, correctly, so every Jellyfin client Direct Plays them without your server lifting a finger. This guide gives you the exact settings.
The Goal: Zero Transcoding
A properly encoded file should:
- Direct Play on 95%+ of devices (phones, TVs, browsers, streaming sticks)
- Look indistinguishable from the source at normal viewing distance
- Use reasonable storage (not 80 GB per movie, not 1 GB either)
- Include compatible audio so no device triggers an audio transcode
- Use text subtitles so no device triggers a burn-in transcode
Quick Reference: Copy-Paste Settings
For 1080p Content (Most Libraries)
| Setting | Handbrake | FFmpeg equivalent |
|---|---|---|
| Video codec | H.265 (x265) | libx265 |
| Quality | RF 20 | -crf 20 |
| Preset | Medium | -preset medium |
| Profile | Main 10 | -profile:v main10 |
| Audio 1 | AAC Stereo 160 kbps | -c:a aac -b:a 160k |
| Audio 2 | EAC3 5.1 640 kbps (if source is surround) | -c:a:1 eac3 -b:a:1 640k |
| Container | MKV | .mkv |
| Subtitles | Passthrough (text only) | -c:s copy (SRT/ASS only) |
For 4K HDR Content
| Setting | Handbrake | FFmpeg equivalent |
|---|---|---|
| Video codec | H.265 (x265) 10-bit | libx265 -pix_fmt yuv420p10le |
| Quality | RF 18 | -crf 18 |
| Preset | Slow | -preset slow |
| HDR | Passthrough (HDR10 metadata) | See HDR section below |
| Audio 1 | EAC3 Atmos 768 kbps | -c:a eac3 -b:a 768k |
| Audio 2 | AAC Stereo 160 kbps | -c:a:1 aac -b:a:1 160k |
| Container | MKV | .mkv |
Understanding CRF (Constant Rate Factor)
CRF controls quality. Lower number = higher quality = larger file.
| CRF | Quality | Typical 1080p movie size | Use case |
|---|---|---|---|
| 16-17 | Near-transparent | 8-15 GB | Archival, reference quality |
| 18-20 | Excellent | 4-8 GB | Recommended for most libraries |
| 21-23 | Very good | 2-5 GB | Storage-constrained setups |
| 24-26 | Good | 1-3 GB | Mobile/remote streaming |
| 27+ | Noticeable loss | Under 1.5 GB | Not recommended |
The sweet spot for Jellyfin is CRF 18-20 for 1080p and CRF 16-18 for 4K. At these values, the encode is visually indistinguishable from the source on a normal TV at normal viewing distance.
Handbrake: Step-by-Step Configuration
Video Tab
- Video Encoder: H.265 (x265)
- Framerate: Same as source, Variable
- Quality: Constant Quality, RF 20 (1080p) or RF 18 (4K)
- Encoder Preset: Medium (balance of speed and compression)
- Slow gives ~10% better compression but takes 2-3x longer
- Fast saves time but files are 15-20% larger
- Encoder Profile: Main 10 (required for HDR, recommended for all)
- Encoder Level: Auto
Audio Tab
This is where most people make mistakes. You need two audio tracks for maximum compatibility:
Track 1 (surround, for home theater):
- Codec: E-AC3 (EAC3)
- Mixdown: 5.1 Surround (or passthrough if source is already EAC3)
- Bitrate: 640 kbps
Track 2 (stereo fallback, for phones and browsers):
- Codec: AAC (avcodec)
- Mixdown: Stereo
- Bitrate: 160 kbps
Why two tracks? EAC3 5.1 gives surround sound on TVs and receivers. AAC stereo ensures phones, tablets, and browsers never trigger an audio transcode. Every device picks the track it can handle.
Subtitles Tab
- Add all SRT/ASS subtitle tracks from the source
- Do NOT add PGS or VobSub (image-based subtitles force a full video transcode)
- If you need PGS subtitles, convert them to SRT first using SubtitleEdit or PGS2SRT
Container
- MKV is recommended. It supports all codecs, multiple audio tracks, and multiple subtitle tracks.
- MP4 works but has limitations with some subtitle formats and codec combinations.
FFmpeg: Command-Line Recipes
1080p H.265 Encode with Dual Audio
ffmpeg -i input.mkv \
-map 0:v:0 -map 0:a:0 -map 0:a:0 -map 0:s? \
-c:v libx265 -crf 20 -preset medium -profile:v main10 \
-c:a:0 eac3 -b:a:0 640k -ac:a:0 6 \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
-metadata:s:a:0 title="Surround 5.1" \
-metadata:s:a:1 title="Stereo" \
output.mkv
4K HDR10 Encode (Preserving HDR Metadata)
ffmpeg -i input.mkv \
-map 0:v:0 -map 0:a:0 -map 0:a:0 -map 0:s? \
-c:v libx265 -crf 18 -preset slow \
-profile:v main10 -pix_fmt yuv420p10le \
-x265-params "hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smt2084:colormatrix=bt2020nc:max-cll=1000,400" \
-c:a:0 eac3 -b:a:0 768k \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
output.mkv
Quick H.264 Encode (Maximum Compatibility)
For files that must play on absolutely everything, including old smart TVs and budget devices:
ffmpeg -i input.mkv \
-c:v libx264 -crf 22 -preset medium -profile:v high -level 4.1 \
-c:a aac -b:a 192k -ac 2 \
-c:s copy \
-movflags +faststart \
output.mp4
Batch Encode an Entire Folder
for f in *.mkv; do
ffmpeg -i "$f" \
-c:v libx265 -crf 20 -preset medium -profile:v main10 \
-c:a:0 eac3 -b:a:0 640k \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
"encoded/${f}"
done
H.264 vs H.265 vs AV1: Which Codec to Use
| Codec | File size (1080p) | Client support | Encode speed | Recommendation |
|---|---|---|---|---|
| H.264 | 6-12 GB | Universal (100%) | Fast | Legacy devices, maximum compatibility |
| H.265 | 3-7 GB | Very wide (95%+) | Medium | Recommended default for 2026 |
| AV1 | 2-5 GB | Growing (70-80%) | Very slow | Future-proof, bandwidth-constrained |
H.265 is the right choice for most Jellyfin libraries in 2026. It offers the best balance of compression, quality, and client support. H.264 is the fallback for maximum compatibility. AV1 is worth considering only if all your clients support it.
Preserving HDR: What You Need to Know
HDR10
HDR10 metadata is preserved automatically by both Handbrake and FFmpeg when encoding with 10-bit H.265. No special configuration needed beyond using Main 10 profile.
Dolby Vision
Dolby Vision is significantly harder to preserve during encoding. A standard Handbrake or FFmpeg encode strips Dolby Vision metadata entirely.
To preserve DV, you need specialized tools:
- Extract the DV layer with
dovi_tool - Encode the base layer with x265
- Re-inject the DV metadata with
dovi_toolandmp4muxer
For most users: if the file has Dolby Vision, keep the remux. Only encode DV content if you are comfortable with the specialized workflow.
HDR10+
HDR10+ dynamic metadata can be preserved with recent versions of x265 and FFmpeg. Add --dhdr10-info to your x265 parameters with the extracted metadata JSON.
GPU-Accelerated Encoding
Software encoding (x265) produces the best quality per bit. But if you have thousands of files to process, GPU encoding is 5-10x faster.
NVIDIA NVENC (FFmpeg)
ffmpeg -i input.mkv \
-c:v hevc_nvenc -preset p5 -rc constqp -qp 24 \
-c:a eac3 -b:a 640k \
output.mkv
Intel QSV (FFmpeg)
ffmpeg -i input.mkv \
-c:v hevc_qsv -preset medium -global_quality 22 \
-c:a eac3 -b:a 640k \
output.mkv
Quality note: GPU encoders produce slightly larger files at the same visual quality compared to software x265. Expect 20-30% larger files at equivalent quality. The trade-off is speed.
Automating Encodes with Tdarr
For large libraries, manual encoding is impractical. Tdarr automates the process:
- Point Tdarr at your media folders
- Configure a plugin: "If not H.265, transcode to H.265 CRF 20 with EAC3 + AAC audio"
- Tdarr processes files in the background
- Jellyfin library refreshes automatically
See our dedicated Tdarr guide for the full setup.
File Size Expectations After Encoding
| Source | H.265 CRF 20 | H.265 CRF 18 | Storage saved |
|---|---|---|---|
| 1080p Blu-ray remux (25 GB) | 4-7 GB | 6-10 GB | 60-80% |
| 4K Blu-ray remux (60 GB) | 12-20 GB | 18-30 GB | 50-70% |
| 1080p H.264 encode (8 GB) | 3-5 GB | 4-7 GB | 35-55% |
| DVD rip (4 GB) | 1-2 GB | 1.5-3 GB | 50-65% |
Common Encoding Mistakes
| Mistake | Why it is bad | Fix |
|---|---|---|
| Only AAC stereo audio | Surround sound lost | Add EAC3 5.1 as primary track |
| Including PGS subtitles | Forces burn-in transcode | Convert to SRT or exclude |
| CRF too high (26+) | Visible quality loss | Use CRF 18-22 |
| Using MP4 with ASS subs | ASS not supported in MP4 | Use MKV container |
| No 10-bit for HDR | HDR metadata lost | Always use Main 10 profile |
| Encoding at "Ultrafast" | Huge files, poor compression | Use Medium or Slow preset |
FAQ
What is the best CRF for Jellyfin? CRF 20 for 1080p, CRF 18 for 4K. These produce excellent quality with reasonable file sizes.
Should I use H.264 or H.265? H.265 for most libraries. It produces files 40-50% smaller than H.264 at the same quality. Use H.264 only if you have very old clients.
Does Handbrake preserve HDR? Yes, HDR10 is preserved when using H.265 10-bit. Dolby Vision is not preserved by standard Handbrake encodes.
How long does encoding take? A 2-hour 1080p movie at CRF 20 Medium preset takes roughly 1-3 hours on a modern CPU. 4K takes 3-8 hours. GPU encoding is 5-10x faster.
Can I encode directly on my Jellyfin server? Yes, but schedule encodes during off-peak hours. Encoding uses significant CPU/GPU resources that compete with active streams.
Is there a quality difference between Handbrake and FFmpeg? No. Both use the same underlying encoders (x265, x264). The output is identical with the same settings.
Should I keep the original files after encoding? Keep originals for at least a month after encoding. Verify the encodes look correct before deleting sources.
Encoded your library? Verify every stream is Direct Playing. Download JellyWatch on Google Play - see the exact playback method for every active session and confirm your encodes work perfectly on every device.
On Emby? Download EmbyWatch on Google Play - the same encoding verification for Emby servers.
GPU Encoding Recipes: NVENC, QSV, and AMF (Complete)
GPU encoding is 5-10x faster than software x265. Here are production-ready recipes for each GPU vendor, optimized for Jellyfin Direct Play.
NVIDIA NVENC (RTX 2000/3000/4000/5000 Series)
NVIDIA GPUs offer the best hardware encoding quality in 2026, especially the RTX 4000+ series with AV1 support.
H.265 NVENC - Best Quality (Recommended)
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv \
-c:v hevc_nvenc -preset p6 -tune hq -rc constqp -qp 22 \
-b:v 0 -profile:v main10 -tier high \
-spatial-aq 1 -temporal-aq 1 -aq-strength 8 \
-c:a:0 eac3 -b:a:0 640k -ac:a:0 6 \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy -map 0:v:0 -map 0:a:0 -map 0:a:0 -map 0:s? \
-metadata:s:a:0 title="Surround 5.1" \
-metadata:s:a:1 title="Stereo" \
output.mkv
Key parameters explained:
-preset p6: High quality preset (p1=fastest, p7=slowest/best)-tune hq: Optimizes for visual quality over speed-rc constqp -qp 22: Constant quality mode (similar to CRF)-spatial-aq 1 -temporal-aq 1: Adaptive quantization for better detail preservation-aq-strength 8: How aggressively AQ redistributes bits (1-15)
AV1 NVENC (RTX 4000+ only)
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mkv \
-c:v av1_nvenc -preset p5 -tune hq -rc constqp -qp 28 \
-profile:v main -tier main \
-c:a:0 eac3 -b:a:0 640k \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
output.mkv
AV1 NVENC produces files 20-30% smaller than HEVC NVENC at the same quality. Use QP 26-30 for AV1.
NVENC Quality Comparison (QP values)
| QP | Visual Quality | Typical 1080p Size | Equivalent Software CRF |
|---|---|---|---|
| 18-20 | Excellent (archival) | 6-10 GB | ~CRF 16-17 |
| 21-23 | Very good (recommended) | 4-7 GB | ~CRF 18-20 |
| 24-26 | Good | 3-5 GB | ~CRF 21-23 |
| 27-30 | Acceptable | 2-4 GB | ~CRF 24-26 |
Intel Quick Sync Video (QSV) - N100, 12th-14th Gen Core
Intel QSV is available on any Intel CPU with integrated graphics. The N100 and 12th+ gen Core CPUs offer excellent quality.
H.265 QSV - Best Quality
ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.mkv \
-c:v hevc_qsv -preset veryslow -global_quality 23 \
-profile:v main10 -look_ahead 1 -look_ahead_depth 40 \
-extbrc 1 -adaptive_i 1 -adaptive_b 1 \
-c:a:0 eac3 -b:a:0 640k -ac:a:0 6 \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy -map 0:v:0 -map 0:a:0 -map 0:a:0 -map 0:s? \
output.mkv
Key parameters:
-global_quality 23: Quality level (lower = better, 20-25 recommended)-look_ahead 1 -look_ahead_depth 40: Enables lookahead for better bitrate distribution-extbrc 1: Extended bitrate control for improved quality-adaptive_i 1 -adaptive_b 1: Adaptive I/B frame placement
AV1 QSV (Intel Arc / 14th Gen+)
ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i input.mkv \
-c:v av1_qsv -preset veryslow -global_quality 28 \
-look_ahead 1 -look_ahead_depth 40 \
-c:a:0 eac3 -b:a:0 640k \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
output.mkv
AMD AMF (RX 6000/7000/9000 Series)
AMD hardware encoding has improved significantly but still trails NVIDIA and Intel in quality-per-bit.
H.265 AMF
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
-vaapi_device /dev/dri/renderD128 -i input.mkv \
-c:v hevc_amf -quality quality -rc cqp -qp_i 22 -qp_p 24 \
-profile:v main10 \
-c:a:0 eac3 -b:a:0 640k \
-c:a:1 aac -b:a:1 160k -ac:a:1 2 \
-c:s copy \
output.mkv
AMD AMF produces files ~15-20% larger than NVENC at equivalent visual quality. Acceptable for batch processing where speed matters more than compression.
GPU Encoding Quality Ranking (2026)
| Rank | Encoder | Quality/Bit | Speed | Best For |
|---|---|---|---|---|
| 1 | Software x265 | Best | Slowest | Final archive, small libraries |
| 2 | NVENC (RTX 4000+) | Very good | Fast | Large libraries, daily use |
| 3 | Intel QSV (12th gen+) | Good | Fast | Budget builds, N100 servers |
| 4 | AMD AMF (RX 7000+) | Acceptable | Fast | AMD-only systems |
Batch Automation with Tdarr: Set It and Forget It
Manually encoding hundreds of files is impractical. Tdarr is a distributed transcoding automation tool that processes your entire library in the background.
What Tdarr Does
- Scans your media folders continuously
- Identifies files that do not match your target codec/settings
- Transcodes them automatically using your GPU or CPU
- Replaces the original file (or saves alongside)
- Integrates with Jellyfin to refresh the library after each file
Tdarr Docker Compose
services:
tdarr:
image: ghcr.io/haveagitgat/tdarr:latest
container_name: tdarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Paris
- serverIP=0.0.0.0
- serverPort=8266
- webUIPort=8265
- internalNode=true
- inContainer=true
- ffmpegVersion=7
- nodeName=InternalNode
volumes:
- ./tdarr/server:/app/server
- ./tdarr/configs:/app/configs
- ./tdarr/logs:/app/logs
- /mnt/media:/media
- /tmp/tdarr:/temp
ports:
- 8265:8265
- 8266:8266
devices:
- /dev/dri:/dev/dri # Intel QSV
# For NVIDIA, add:
# runtime: nvidia
# environment:
# - NVIDIA_VISIBLE_DEVICES=all
restart: unless-stopped
Recommended Tdarr Plugin Stack
Configure these plugins in order (Tdarr processes them sequentially):
Plugin 1: Skip if already H.265
- Plugin:
Tdarr_Plugin_MC93_Migz1FFMPEG_CPU - Condition: Skip if video codec is already
hevc
Plugin 2: Transcode video to H.265
- Plugin:
Tdarr_Plugin_MC93_Migz2CleanTitle(clean metadata first) - Then:
Tdarr_Plugin_Engine_NVENC_Tiered_H265(NVIDIA) orTdarr_Plugin_Engine_QSV_Tiered_H265(Intel) - Settings: CRF/QP 22, Medium preset, Main10 profile
Plugin 3: Normalize audio to EAC3 + AAC
- Plugin:
Tdarr_Plugin_MC93_Migz4CleanSubs(remove image subs) - Then:
Tdarr_Plugin_bsh1_Boosh_Audio_Converter - Settings: First track EAC3 5.1 640k, second track AAC Stereo 160k
Plugin 4: Remove image-based subtitles
- Plugin:
Tdarr_Plugin_MC93_Migz5ConvertSubs - Settings: Remove PGS and VobSub, keep SRT and ASS only
Tdarr + Jellyfin Integration
After Tdarr finishes processing a file, trigger a Jellyfin library refresh:
- In Tdarr: Settings → Post-processing → Webhook
- URL:
http://jellyfin:8096/Library/Refresh?api_key=YOUR_API_KEY - Method: POST
Or use the Tdarr Jellyfin plugin that triggers a targeted scan of the specific file.
Tdarr Performance Tips
- Set GPU limits: Allow only 1-2 simultaneous GPU transcodes to leave headroom for Jellyfin playback
- Schedule processing: Use Tdarr schedules to only process during off-peak hours (2 AM - 8 AM)
- Use /tmp as temp folder: Transcoding writes heavily to disk. Use an SSD or tmpfs for the temp folder
- Priority order: Process most-watched content first (sort by file size or folder)
- Health checks: Enable Tdarr health checks to detect corrupted files before processing
Expected Processing Speed
| Hardware | 1080p H.265 encode speed | Time per 2h movie |
|---|---|---|
| Software x265 (8-core CPU) | 25-40 fps | 2-3 hours |
| NVIDIA RTX 3060 (NVENC) | 150-250 fps | 20-30 minutes |
| NVIDIA RTX 4070 (NVENC) | 200-350 fps | 15-25 minutes |
| Intel N100 (QSV) | 80-120 fps | 40-60 minutes |
| Intel i5-12400 (QSV) | 120-180 fps | 25-40 minutes |
| Intel Arc A380 (QSV) | 150-250 fps | 20-30 minutes |
With an RTX 4070, you can process 50-70 movies per day automatically.
Tdarr vs Manual FFmpeg: When to Use Each
| Scenario | Use Tdarr | Use Manual FFmpeg |
|---|---|---|
| Library of 500+ files | Yes | No (too tedious) |
| One-off encode of a specific file | No | Yes |
| Ongoing library maintenance | Yes | No |
| Custom HDR/DV workflow | No (too complex for plugins) | Yes |
| Testing encode settings | No | Yes (iterate quickly) |
Processing your library with Tdarr? Monitor the impact on your server. Download JellyWatch on Google Play - track CPU/GPU usage during batch encodes, verify Direct Play status for processed files, and get alerts if Tdarr impacts active streams.
On Emby? Download EmbyWatch on Google Play - the same monitoring for Emby servers during batch processing.




Comments 2
The dual audio track advice (EAC3 5.1 + AAC stereo) eliminated every single audio transcode on my server. Fire TV gets EAC3, phones get AAC, nobody triggers a transcode. Genius.
Used these exact FFmpeg settings in my Tdarr workflow. Processed 800 movies over two weeks. Storage went from 12 TB to 5.2 TB and everything still Direct Plays on every device.
Leave a comment