Is HEVC already in the Apple TV 4 profile?

apple-tv

#1

The current public tvOS 11 beta and the upcoming stable release of tvOS 11 have HEVC support. Is this already in the plex profiles for the atv4? Can I enable this manually, if this is not the case?


#2

I have recently been doing a lot of testing on both tvOS 11 and macOS 10.13 beta versions, including re-encoding my entire library from original source with H.265. The results in terms of quality and space saving are superb.

The Plex server profile change you mentioned is very easy to do and results in flawless streaming from macOS 10.13 to the Apple TV with no transcoding. To do so, just edit the file /Applications/Plex Media Server.app/Contents/Resources/Profiles/tvOS.xml to look like the following.

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

The "h264,mpeg4" line should already be in there, just under "DirectPlayProfiles". I added two new versions of this line just above it for HEVC, because I'm not sure which identifier is used (although I imagine it's the "h265" one). In any case, whichever line is useless, it doesn't hurt to leave it in there. The result is that Plex streams your H.265 files directly to the Apple TV without transcoding them to H.264. (If you don't make this change, that's what will happen, and your video won't look nearly as good... not to mention the CPU hit, lags, and other disadvantages of transcoding.)

Also note that, if you want to encode to HEVC/H.265 using Handbrake, you'll need to download the nightly build. The current official release (1.07) has a problem with Apple's HEVC implementation in that the codec identifier (or "fourcc" code) is not the one it wants. The nightly builds correct this. (This code needs to be "hvc1" for Apple.)

In case you're interested in what I've found out about streaming HEVC using iTunes and the Apple TV's "Computers" app, have a look at the post I wrote here: discussions.apple.com/message/32087478#message32087478


#3

Cool - I didn't know that the ATV will support hevc.

I just edited the profile on the server (hosted on Ubuntu 16.04 Server located at /usr/lib/plexmediaserver/Resources/Profiles/tvOS.xml) and the ATV tried to DirectPlay hevc content encoded in 8Bit but no picture was shown. I only could listen to the audio, screen stayed black. 10bit encoded hevc still transcoded.

Does it matter on which platform the server resides?


#4

@bananafranco said:

Does it matter on which platform the server resides?

No, but you need to be running the new tvOS 11 beta on your ATV4


#5

ATV is running the latest tvOS beta. Think I'll try again with more time at hand


#6

I tried the changes to both the tvOS and the iOS profiles. I am running iOS 11 on both. With the changes in the iOS profile my iPad with Plex did Direct Play my h.265 file. With the changes in the tvOS profile the same file was transcoded. Any thoughts?


#7

@talkthewog

what are you using to do your hevc encoding... handbrake? What settings are you using..? Are you guessing or do you know what apple is planning to publish as far as appletv / iOS / tvos hevc maximum profiles supported?


#8

I've tried it with some videos and I can only see black. However VLC on the Apple TV using the Plex UPnP server works just fine and is really fast, also while seeking. So maybe I just use VLC as the client. Although I like the Plex client better...


#9

@dragonmel ... The only thing you need to do to get HEVC (H.265) files with Handbrake is to select "H.265 (x265)" in the "Video Encoder" dropdown list on the "Video" tab. You can store it all in a standard MP4/M4V or MKV container as you prefer. (I use M4V.) Other settings should be just the same as always. Some of the standard presets encode to H.265, but I always set things according to my own tastes.

As I mentioned above, though, remember that you need get the more recent (nightly) builds of Handbrake for the files to play back on macOS 10.3 / tvOS 11. I don't know what the story is if you run Handbrake on another platform, but I imagine it's the same.

@root_42... Did you download the nightly build for Handbrake? If you don't, you'll get the wrong codec identifier ("fourcc" code) in your file, and it won't play on either the Mac or the Apple TV. (It seems that there are actually two different valid identifiers for variants of the H.265 codec, and the current official release of Handbrake (1.07) does not use the right one. Apple requires "hvc1", and this has now been included in the more recent builds of Handbrake. You can use "Get Info" in Finder or QuickTime Player to display the video code identifier. It should say either "hvc1" or "HEVC", depending on the application.)

@tsheley... I can't see what the problem would be if you've got the syntax right. See above. Is your ATV4 running tvOS 11 beta?


#10

Yep. Running the newest beta as of last night. I will try again. Like I said it worked great on iOS 11 after changing the iOS xml file.


#11

Must have done something wrong. It works now.


#12

What are peoples experiences with regard to Handbrake encoding times of the same material, if you are comparing h264 to h265?


#13

@talkthewog said:

@root_42... Did you download the nightly build for Handbrake? If you don't, you'll get the wrong codec identifier ("fourcc" code) in your file, and it won't play on either the Mac or the Apple TV. (It seems that there are actually two different valid identifiers for variants of the H.265 codec, and the current official release of Handbrake (1.07) does not use the right one. Apple requires "hvc1", and this has now been included in the more recent builds of Handbrake. You can use "Get Info" in Finder or QuickTime Player to display the video code identifier. It should say either "hvc1" or "HEVC", depending on the application.)

I tried remuxing with MP4Box. Now file has hvc1 fourcc. However, Plex still does not like the file. It won't play at all anymore. VLC still plays it though...

I will try to find a reference file which is supposed to work, or create my own with Handbrake...


#14

@root_42 ... I guess if MP4Box sets the right fourcc code, then that should work too. Actually, before I found out that the recent builds of Handbrake would do the trick, I actually manually edited this code using a hex editor, and it worked. The video stream itself doesn't seem to be a problem... just the code, if it's not the Apple wants.


#15

I have made the changes to my iOS.xml and tvOS.xml files and I can't get either to direct play my h265....any suggestions? do I need a beta version of the server or the app istself on my client device ?


#16

After changing the fourcc with an hex editor (from hev1 to hvc1) I was instantly able to Quicklook the video in macOS High Sierra - horray!

Made the changes on the PlexServer again - restarted server and sure enough it's working. h265 direct streams

Just one file which I encoded a long time ago on a windows machine refuses to play. Don't know what settings I used. Has Apple released the maximum profile/settings it will support on their hardware?

off to changing lots of fourcc codes


#17

Ok I got it to work after downloading the nightly release of handbrake. Is there a program that will repackage mkv h265 files to mp4 without doing uneccesary encoding


#18

@bigd2337 said:
Ok I got it to work after downloading the nightly release of handbrake. Is there a program that will repackage mkv h265 files to mp4 without doing uneccesary encoding
I believe Subler should be able to remux it.


#19

Subler is great, but it only handles the MP4/M4V container. For MKV, you can use MKVToolNix. Have a look here: fosshub.com/MKVToolNix.html

To be honest, though, if you can do with MP4 instead of MKV, I'd go with Subler. It's excellent for both remuxing and for metadata.


#20

@talkthewog said:
Subler is great, but it only handles the MP4/M4V container. For MKV, you can use MKVToolNix. Have a look here: fosshub.com/MKVToolNix.html

I use Subler with MKVs on a daily basis and it works fine for remuxing to MP4.
When I wrote 'believe' I specifically meant h.265 support, which I do believe it supports. It has no issues with everything else, including MKV.