Automate Media Conversion for Plex Compatibility
Not every media file in your collection works perfectly with every Plex client. Files with uncommon codecs, incompatible containers, or image-based subtitles can trigger server transcoding on certain devices. Automated media conversion preprocesses your library — converting files to universally compatible formats before playback, eliminating real-time transcoding entirely. This guide covers the tools and strategies for automated conversion.
Why Automate Conversion
Real-time transcoding during playback has costs:
- Server CPU or GPU usage for every incompatible stream.
- Slight quality degradation compared to the original file.
- Potential buffering if the server cannot transcode fast enough.
- Power consumption from hardware running under load.
Pre-converting files shifts this processing to off-peak hours. The converted file direct plays on every client — zero server load during playback, consistent quality, and no buffering.
Tdarr
Tdarr is the most popular automated media conversion tool for Plex libraries. It scans your library, identifies files that do not meet your target specifications, and converts them automatically.
How Tdarr Works
- Tdarr scans the directories you specify and catalogs every media file.
- Files are evaluated against your configured plugins — rules that define the target format.
- Files that do not meet the target specifications are queued for conversion.
- Tdarr workers (which can run on the same machine or distributed across multiple machines) process the queue using FFmpeg or HandBrake.
- Converted files replace the originals (or are placed alongside them, depending on configuration).
Installation
Tdarr runs as a Docker container or native application. The Docker approach is recommended for Plex servers:
- Deploy the Tdarr server container for the web interface and job management.
- Deploy one or more Tdarr node containers for processing. Nodes can use CPU, Intel Quick Sync, or NVIDIA NVENC for hardware-accelerated conversion.
- Map your Plex media directories to the Tdarr containers so they can access the files.
Common Conversion Plugins
- Convert to HEVC: Re-encode H.264 files to HEVC (H.265) for 40-50% file size reduction at similar quality. Best for large libraries where storage savings matter.
- Remux to MKV: Change the container format to MKV without re-encoding video. Fast operation that fixes container compatibility issues.
- Convert audio to AAC: Add an AAC audio track alongside the original track. Ensures every client has a compatible audio option.
- Extract and convert subtitles: Convert PGS subtitles to SRT to prevent subtitle-triggered transcodes.
FFmpeg Automation
For users who prefer scripting over Tdarr's interface, FFmpeg with a wrapper script provides full control over conversion:
Basic Conversion Script
A script that walks a directory, identifies files needing conversion, and processes them:
- Scan for files matching specific criteria (wrong codec, wrong container, missing audio track).
- Build an FFmpeg command for each file based on what needs to change.
- Run the conversion.
- Verify the output file is valid (check duration matches, file is playable).
- Replace the original or store alongside it.
Useful FFmpeg Operations
- Remux (no re-encode):
ffmpeg -i input.avi -c copy output.mkv— changes container without touching video or audio. Nearly instant. - Add compatible audio track:
ffmpeg -i input.mkv -c:v copy -c:a:0 copy -c:a:1 aac -b:a:1 256k -map 0:v -map 0:a -map 0:a output.mkv— keeps original audio and adds an AAC copy. - Convert to HEVC:
ffmpeg -i input.mkv -c:v libx265 -crf 22 -preset medium -c:a copy output.mkv— re-encodes video to HEVC at high quality.
Conversion Strategies
Container Standardization
Convert all files to MKV containers. MKV is the most flexible container — it supports every video codec, every audio codec, multiple subtitle tracks, and chapter markers. MKV direct plays on every modern Plex client.
This is typically a remux operation (no re-encoding) so it is fast and lossless. Only the container wrapper changes.
Audio Track Management
The most impactful conversion for reducing real-time transcoding: ensure every file has a compatible audio track.
- Files with only TrueHD or DTS-HD MA audio need an AAC or EAC3 secondary track for clients that cannot passthrough lossless audio.
- Files with only DTS audio need an AAC track for Apple TV (which cannot decode DTS).
- Add the compatible track without removing the original — users with capable hardware still get the high-quality track.
Subtitle Conversion
Image-based subtitles (PGS, VOBSUB) force a full video transcode when selected on most clients. Converting these to SRT eliminates the transcode trigger:
- Bazarr: Automatically downloads SRT subtitles for your library from online sources. Integrates with Sonarr and Radarr.
- SubtitleEdit: Converts PGS to SRT using OCR (optical character recognition). Quality depends on the OCR accuracy — review the output for errors.
- Subsync: Automatically synchronizes subtitle timing if the SRT is slightly out of sync with your specific video file.
Codec Conversion (H.264 to HEVC)
Converting H.264 to HEVC reduces file sizes by 40-50% at comparable quality. This is worthwhile for large libraries but has trade-offs:
- Processing time: HEVC encoding is slow even with hardware acceleration. A 2-hour movie takes 30-120 minutes depending on hardware and quality settings.
- Quality: Re-encoding from one lossy codec to another always loses some quality. Use a conservative CRF value (18-22 for HEVC) to minimize visible degradation.
- Compatibility: HEVC is supported by most modern clients but not all. Very old devices may not have HEVC hardware decode.
Hardware Acceleration for Conversion
Intel Quick Sync
Quick Sync provides fast HEVC encoding at reasonable quality. Conversion speed is 2-5x faster than software encoding. Quality is slightly below software at equivalent settings but acceptable for most content.
NVIDIA NVENC
NVENC provides the fastest hardware encoding with the best quality among hardware encoders. Use NVENC for batch conversion when quality matters. FFmpeg flag: -c:v hevc_nvenc -preset p7 -cq 22
CPU (Software)
Software encoding with libx265 produces the best quality but is the slowest option. Use for content where quality is paramount and processing time is not a concern. Run conversions overnight or during off-peak hours.
Scheduling and Monitoring
Off-Peak Processing
Schedule conversions during hours when no one is streaming. Conversion consumes the same resources that Plex uses for transcoding — running both simultaneously degrades playback quality.
Tdarr includes built-in scheduling — set working hours for each node. FFmpeg scripts can be scheduled via cron (Linux) or Task Scheduler (Windows).
Progress Monitoring
Tdarr provides a web dashboard showing conversion progress, queue length, estimated completion time, and storage savings. For FFmpeg scripts, log each conversion with input file, output file, duration, and size change for tracking.
Troubleshooting
Converted File Has Audio Sync Issues
- Some container conversions introduce slight audio drift. Verify the output by playing a scene with visible speech and checking lip sync.
- Use FFmpeg's -async or -itsoffset flags to correct small timing offsets.
Converted File Is Larger Than Original
- The target codec or settings produce larger files for certain content types. Short clips, animation, and very low-bitrate sources may encode larger in HEVC than H.264.
- Adjust CRF or bitrate targets. A higher CRF value (larger number) produces smaller files at lower quality.
Plex Does Not Detect Converted Files
- If the converted file replaces the original with the same name, Plex should detect the change during the next scan.
- Trigger a manual scan after batch conversions complete.
- If the file was converted to a different container (e.g., AVI to MKV), verify the new extension is in Plex's supported format list.