Skip to content

Instantly share code, notes, and snippets.

@ronny
Last active April 28, 2024 14:02
Show Gist options
  • Save ronny/bca0e46c568047b655ffa2d6bc570dc1 to your computer and use it in GitHub Desktop.
Save ronny/bca0e46c568047b655ffa2d6bc570dc1 to your computer and use it in GitHub Desktop.
Direct play Plex videos in TV 4

DirectPlay Plex videos in TV 4

TV 4 and TV 4K

TV 4 supports HEVC natively up to 1080p30 (I think).

TV 4K has a hardware HEVC decoder that can support up to 2160p60.

Supported best format

HEVC H.265 with hvc1 tag. Note that hev1 does NOT work in TV 4.

Snippet from ffprobe hevc.mp4:

    Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 1438x1080 [SAR 1:1 DAR 719:540], q=2-31, 24 fps, 24 tbr, 16k tbn, 1k tbc (default)
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp (default)

Note the hvc1 there.

Convert container without re-encoding:

Assuming video and audio codecs are already correct.

ffmpeg -i video.mkv -c copy -movflags +faststart -threads 0 -tag:v hvc1 video.mp4

Batch:

for f in *.mkv ; do ffmpeg -i "$f" -c copy -movflags +faststart -threads 0 -tag:v hvc1 "$(basename -s .mkv $f).mp4" ; done

Plex Media Server

At the time of writing, the tvOS profile in Plex Media Server 1.11.0.4666 doesn't support HEVC/H.265 for DirectPlay.

Modify $PLEX_HOME/Resources/Profiles/tvOS.xml under <DirectPlayProfiles> section to have this:

<VideoProfile container="mp4" codec="hevc" audioCodec="aac,ac3,eac3" subtitleCodec="mov_text,tx3g,ttxt,text" />

where $PLEX_HOME is /volume1/@appstore/Plex Media Server in Synology NAS for example.

However, at the time of writing I couldn't get this to work without forcing DirectPlay from the client explicitly.

References

@luk4s
Copy link

luk4s commented Jun 5, 2018

Hi, for me working well this:

<VideoProfile container="mp4,m4v" codec="hevc,h265,h264,mpeg4" audioCodec="aac,he-aac,ac3,eac3,flac,dca,dts" subtitleCodec="mov_text,tx3g,ttxt,text" />

Change - ext m4v (Subbler default) and passthrough DTS

@ChrisVIE87
Copy link

ChrisVIE87 commented Nov 16, 2021

finally - direct streaming from x265 files on my ATV4 ... thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment