ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Discuss encoding for devices and presets.
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

I was doing a little reading on the ATV 4Ks H.264 playback and encoding, and I'm a little confused with the options, as I'm having frame drops during playback from Handbrake encoded movies (not pointing the finger at Handbrake :). Movies play fine on my Mac (which is the iTunes for the ATV), other ATVs (non 4K new versions), via a NAS to my LG OLED TV, PS4 Pro etc. Just on the ATV 4k, frames drop. I can see this following these instructions http://www.redmondpie.com/check-apple-t ... heres-how/

On the apple website they give the ATV 4K specs as - H.264 Baseline Profile level 3.0 or lower with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats (https://www.apple.com/apple-tv-4k/specs/)

On the apple authorizing website it says - Profile and Level for H.264 MUST be less than or equal to High Profile, Level 4.2. (https://developer.apple.com/library/arc ... 96-CH2-SW1)

In Handbreaks latest nightly build Apple 1080p 30 preset it has the High Profile Level as 4.0.

So as you can see I cant seem to figure out which is the correct Profile to encode to if having my iTunes connected to the ATV 4K, to make my tests valid before replacing the ATV it self.

Can someone point me in the correct direction. Thx

I have encoded many times the same movie getting less and less frame drops on the ATV 4K, yet things right now are looking like a faulty ATV Box.

HandBrake version - Nightly 201806021850548-b8c1375-master

Encoding on a PC with i5 chipset, and using sublet on Mac
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by rollin_eng »

Could you please post your logs, instructions can be found here:

https://handbrake.fr/docs/en/latest/hel ... y-log.html
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

https://www.dropbox.com/sh/xok0twfordl1 ... WQsaa?dl=0

Here are some of them. The frame drops are not constant.

I would like to know which is the correct profile to use as there is conflicting information online as mentioned above.

Thanks for the help in advance.

Nate
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Baseline could be a typo. The important line on the specs is "H.264/HEVC SDR video up to 2160p, 60 fps, Main/Main 10 profile", which indicates support for 2160p60 Main profile. In fact, Apple devices going back many years have supported High profile despite Apple not indicating so.

Usually when we see frame drops over a network, it's a Wi-Fi problem. If you're wired, then this is interesting in light of the other devices working just fine.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Thanks, I'm running a wired network to the ATV. Test on the cable show its fine and I'm getting full 200mb from Optimum on the ATV via a speed test. So I think its pointing to the ATV itself. Though I did do an encode using Profile 3 and it seems to be fine. Its so strange as a regular new ATV (non-4K) work just fine on the same wired network.

Weird!

Nate
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Weird indeed. Try the usual first, make sure the ATV 4K is up to date and restart it.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

I've tried restarts, pulling the power and restart, yesterday I did a reinstall. All the same result. Its like the processor hangs up.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

I have just done a few encodes using Level 3.0 and they are running fine at CQ of 22 and 20 on the ATV. Checked all the trouble areas with MPC-HC on my PC and the bitrate is floating around 12k instead of 24-30k+, and the main parts of the movies are around the same 4-5k. Maybe this is why they say use Level 3 to limit the bitrate spikes. I read somewhere that the new ATV4K doesn't use Hardware for decoding H.264, I could be wrong there though.

Funny that a clay animated movie Early Man is causing all the upset I have, but the beginning of the movie has a lot of film grain, then goes digital clean. Its been a great test.

Anyway, I have an appointment at an apple store Sunday. So will let you know what happens.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Level 3.0 does not support high definition video: https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels

What you're getting is some combination of a higher level with some restrictions x264 places on Level 3.0. You can achieve the same bit rate reduction by lowering your quality or likely by denoising your source. 24-30 Mbit/s indicates your source has a lot of complexity likely due to grain or noise. Try NLMeans Light with tune Film (or High Motion for action).

Apple usually lists separate specifications for HD and SD video. Unfortunately, they were less than clear in this case.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Thats good information to know, thanks I'll try that for sure. BTW What is the lowest for 1080p encoding? Looks like 3.2 or just do 4.

Nate
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

All HandBrake’s 1080p30 presets are 4.0.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Over night I re-encoded a few trouble movies that I was originally doing on the 1080p30 preset with a CQ of 20, yet this time adding: :vbv-maxrate=12500:vbv-bufsize=12500. On VLC these files are now giving me a max bitrate of 15-17k in the trouble areas instead of 24-30k+. Both movies run super smooth, no issues at all. It also left the regular parts of the movies that were running between 5-7k alone at 5-7k, which was a bonus. I'm guessing its acting like an audio compressor yet for video?

I also tried NLMeans Light, tuned for Film. This still had issues in a few places yet considerably less.

Nate
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

You’re basically achieving a constant bit rate with those constraints. Better to employ NLMeans and/or raise RF.

The thing is, ATV 4K *should* support 1080p30 at Level 4.0 buffer rates. It certainly can handle far more. My ATV 3 does as well. Something really fishy about your device...
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Hopefully Apple will replace the device tomorrow fingers crossed :) My older ATVs play these all just fine.

The thing about the NLMeans or raising the RF, is that I could see the difference. I have a 65inch LG OLED TV and running the ATV in RGB giving me the best picture possible from the ATV. NLMeans made the picture softer overall throughout the movies, and raising the RF I could see the compression a lot more. It was even more apparent when playing the movies right off a NAS via the TV itself. Maybe I'm just being too picky, thats just me :) Yet, I'm trying to find out a solution if Apple doesn't play ball switching out the ATV.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

So... New AppleTV installed and same issues are happening? Any ideas?

Nate
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by rollin_eng »

I’m pretty sure I’ve played Blu Ray rips on my aTV3 and 4 so I would look at your connections on your lan.

What exactly is your setup between iTunes/Router/aTV?
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

rollin_eng wrote: Fri Jun 15, 2018 4:50 pm I’m pretty sure I’ve played Blu Ray rips on my aTV3 and 4 so I would look at your connections on your lan.

What exactly is your setup between iTunes/Router/aTV?
All my rips play just find on 2 regular new ATVs I have on the same hardline next work, no wifi. Its just the ATV4k thats not playing these too well.

I have a raid array connected USB to a MacMini running iTunes. I have a router in my office that has a connection to my front room via ethernet. Then in the front room I have a 2nd router that feeds all the ATVs, one in my front room ATV4k, and 2 ATVs in bedrooms.

Even the higher end apple tech at the apple store had no idea. I handed them all the error reports from an Xcode connection to the ATV4k, and they had no answer.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Really odd. I guess you could constrain the VBV settings as a hard fix in the meantime.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Finally got a day off to play with this again.It looks like whenever the video goes over a bitrate of 22500k, the ATV starts to freeze up. I found a few encodes that have high bitrates over 20k, and when they get around 22500k, it starts to hiccup.

I have a few new encodes cooking limiting it to 16k, and will see where the spikes end up. Limiting it at 12500, spikes go up to 16k and these play just fine. All with a profile of 4.0

I also have one going limiting at 16k, at a profile of 4.2 just to see.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Should using Profile 4.0 over 4.2 make any difference at 1080p 24fps?
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Yes. It limits the number if macroblocks and bit rate. Level 4.2 allows up to 50 Mbit/s or so, Level 4.0 is around 20 Mbit/s max. x264 is efficient enough it’s not usually necessary to have higher bit rate peaks at sane quality levels, so all official 1080p presets under 60 fps are Level 4.0 for compatibility.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Gotcha. So I understand whats happening in handbrake, if Level 4.0 is a max of around 20 mbit/s, why does the preset set the cap at 25 as when I do an encode its peaking around 20-30k in some sections? or am I confusing the difference between vbv and the limit set with level 4.0?

Thanks for answering these questions by the way.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by mduell »

Level 4.0 Profile High allows for 25Mbps; HB chooses to implement this averaged over a 1s period, so in sub-second slices you may see bitrates exceeding 25Mbps.
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by BradleyS »

Yes, it's possible say to have a higher bit rate for 0.25 seconds followed by an extremely low bit rate for 0.75 seconds, totaling under the limit for the full second period. This is normally not an issue as every modern and plenty of older devices that support at Level 4.0 and higher have at least a 1 second buffer.
nathug
Bright Spark User
Posts: 204
Joined: Fri Apr 11, 2008 10:21 pm

Re: ATV 4K H.264 Baseline Profile Preset - Which one is correct?

Post by nathug »

Some more updates, maybe someone knows a little that can help.

I have tried new HDMI cables even the recommended Belkin one at $30 a pop, Wi-Fi and Ethernet connections, and even got a new ATV4K and still having the same issues. I have even gone as far to get a new APC H15 Power Conditioner.

One thing I have found is that if I run these movies direct off of my NAS server thru the VLC app on the ATV, the movies play just fine! So maybe this isn't to do with the ATV4K? This is now pointing towards something happening between the ATV4k and iTunes on my MacMini. So NAS to ATV 4K = Good, MacMini to ATV 4K = Bad, either to ATV4 = Good! Also iTunes Home Sharing to iPhone X = Good.

Thoughts? Ideas?

I may need to do a clean install of my MacMini, which will me very sad.
Post Reply