Skip to content

Jellyfin direct play cheatsheet

The ultimate goal for any media server is to achieve “Direct Play,” where the server simply sends the file to the client without modifying it. When this fails, the server must transcode the media on the fly, which consumes significant CPU resources, causes buffering, and often results in 5.1 surround sound being downmixed to stereo. This guide covers two common FFmpeg workflows to resolve these incompatibilities permanently.

Scenario 1: Fixing DTS audio incompatibility

If a video plays but the server logs indicate “Audio Transcoding,” the issue is likely the audio codec. Many televisions, soundbars using optical connections, and streaming sticks cannot decode DTS audio natively. This forces Jellyfin to convert the audio, which strains the hardware. The most reliable solution is to convert the audio track to AC3 (Dolby Digital)—the industry standard for surround sound compatibility—while copying the video stream exactly as it is.

Finding the files

You can use the following command to recursively scan your library and identify any files using the dts codec.

find . -type f \( -name "*.mkv" -o -name "*.mp4" -o -name "*.avi" -o -name "*.webm" \) \
-exec sh -c 'codec=$(ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$0"); if [ "$codec" = "dts" ]; then echo "$0"; fi' {} \;

The conversion command

This command remuxes the video instantly and converts the audio to AC3 at maximum quality. Note the use of -map 0, which ensures that all tracks—including commentary audio and secondary subtitles—are preserved in the new file.

ffmpeg -i "video.mkv" \
  -map 0 \
  -c:v copy \
  -c:a ac3 -b:a 640k \
  -c:s copy \
  "video.ac3.mkv"

Scenario 2: Repairing unplayable MP4s

Sometimes a file will fail to play entirely, or trigger “Container Transcoding.” This is common with files recorded from IPTV or saved as .ts or .flv streams. The problem stems from the AAC audio structure: these streams wrap AAC audio in ADTS headers, but the standard MP4 container requires ASC headers. Using the aac_adtstoasc bitstream filter patches these headers on the fly without needing to re-encode the actual audio data.

The repair command

This command copies both the video and audio streams 1:1, applying only the bitstream filter to correct the audio headers.

ffmpeg -i "video.ts" \
  -map 0 \
  -c copy \
  -bsf:a aac_adtstoasc \
  "video.mp4"