plexembyjellyfin8 min read

Understanding codecs and containers

H.264, HEVC, AV1, MKV, MP4. What they are, why they matter, and which cause problems.

Codecs vs containers

A video file has two layers: the container (the file format) and the codecs inside it (the compression used for video and audio). Think of the container as a box, and the codecs as the contents. An MKV file might contain H.265 video with TrueHD audio - the MKV is the box, H.265 and TrueHD are what's inside.

When your media server decides whether to direct play, direct stream, or transcode, it checks both layers. If the container is wrong but the codecs are fine, it does a quick repackage (direct stream). If the codecs are wrong, it has to re-encode (transcode).

Video codecs

H.264 / AVC

The universal codec. Every modern device supports it. Less efficient than newer codecs (bigger files for the same quality), but zero compatibility issues. If a file plays everywhere without transcoding, it's probably H.264.

H.265 / HEVC

The dominant 4K codec. About 50% more efficient than H.264 - same quality at half the file size. But not universally supported: older Rokus, some smart TVs, and some web browsers force a transcode. Most Fire TV sticks, Shields, and Apple TV 4K handle it fine.

AV1

The next generation. Royalty-free, more efficient than HEVC. Supported in Chrome, Edge, and newer hardware (Intel 12th gen+, newer GPUs). Still emerging - if your device reports "Video codec not supported" on an AV1 file, this is why.

VP9

Google's codec, used heavily by YouTube. Good support in browsers but limited in dedicated media apps. You'll mostly encounter this in YouTube content, not in personal media libraries.

Audio codecs

AAC / AC3 (Dolby Digital)

Universal. Every device supports these. If you want zero audio transcoding, these are your safe choices. AC3 gives you 5.1 surround.

EAC3 (Dolby Digital Plus)

A step up from AC3. Supports more channels and better quality. Most modern streaming devices handle it. Atmos metadata can be carried over EAC3 for compatible systems.

TrueHD / Atmos

Lossless audio from Blu-ray. Highest quality, but most devices can't pass it through. Requires eARC or a direct HDMI connection to a compatible receiver. Optical and standard ARC cannot carry TrueHD. This is the most common cause of audio transcoding.

DTS / DTS-HD MA

The DTS family. Base DTS is widely supported. DTS-HD MA is lossless (like TrueHD). DTS-HD MA has a lossy DTS core embedded, so even if the HD layer can't play, the core usually can.

Tip

Audio transcoding uses almost no CPU. If your video is direct playing but audio is transcoding, that's fine. It's video transcoding you want to avoid.

Container formats

MKV (Matroska)

The most flexible container. Can hold multiple video, audio, and subtitle tracks. Very popular for media libraries. Some devices (older iOS, some smart TVs) don't support MKV directly, triggering a direct stream remux to MP4 - this is low overhead and fine.

MP4

The most compatible container. Works on virtually everything. More limited than MKV (fewer subtitle formats, fewer audio tracks). If your server is remuxing MKV to MP4, that's a direct stream - almost free.

AVI

Legacy format. If you have AVI files, they'll likely need some form of remuxing or transcoding on modern systems. Consider converting to MKV.

Subtitle formats and their impact

SRT

Plain text subtitles. The safest choice. Most devices can overlay SRT without any server involvement. Always prefer SRT.

ASS / SSA

Styled text subtitles, popular in anime. More complex than SRT. Some clients handle them, others force a transcode. On Android TV with Plex, setting "Burn Subtitles" to "Only image formats" lets ASS pass through to the client.

PGS

Image-based subtitles from Blu-ray. Cannot be overlaid by most devices - the server must burn them into the video, forcing a full video transcode. This is the hidden transcoding trigger that catches most people out.

VOBSUB

Image-based subtitles from DVD. Same problem as PGS - forces transcoding on most devices.

Important

If you're transcoding and can't figure out why, check your subtitle settings. PGS subtitles are the silent killer - everything else about the file might be perfect, but one PGS subtitle track forces the entire video to re-encode.

Did this guide help?

Be the first to vote.

Related guides