What is upper limit of ref. frames before transcoding?

I notice that my films with ref. frames of 11 or 12 always get transcoded.  My 7 year old cheapo video card can handle these h.264 streams with hardware acceleration without a hiccup.  I suppose it's a hardware limitation of the video chip, but just curious what the upper limit actually is.  Thanks..

I notice that my films with ref. frames of 11 or 12 always get transcoded.  My 7 year old cheapo video card can handle these h.264 streams with hardware acceleration without a hiccup.  I suppose it's a hardware limitation of the video chip, but just curious what the upper limit actually is.  Thanks..

A bit unsure, but I think we can figure it out. Which AppleTV do you have?

Yeah, I see now that the upper limit is 8 for reference frames as set in the ios-AppleTV.xml found in the PMS installation folder.  I have the ATV3. I wonder if that number can be raised.  It seems a bit on the low side given that there are many encodes where the ref. frame is set in the 10-13 range.

Yeah, I see now that the upper limit is 8 for reference frames as set in the ios-AppleTV.xml found in the PMS installation folder.  I have the ATV3. I wonder if that number can be raised.  It seems a bit on the low side given that there are many encodes where the ref. frame is set in the 10-13 range.

Change it and try. That is a value you can change yourself. Let us know if you find a higher limit that still works.

Remember that there is a limit on the Level as well. These are the ATV3 H264 limits I believe. No mention of ref reframes though:

H.264 video up to 1080p, 30 frames per second, High or Main Profile level 4.0 or lower, 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

Change it and try. That is a value you can change yourself. Let us know if you find a higher limit that still works.

Remember that there is a limit on the Level as well. These are the ATV3 H264 limits I believe. No mention of ref reframes though:

H.264 video up to 1080p, 30 frames per second, High or Main Profile level 4.0 or lower, 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

So I raised the ref frames limit in the AppleTV profile from 8 to 14. Now, all films play without a hitch and no need to re-encode!  However, only one remains, and I can't see why it needs to re-encode.  The only difference from all the others is that it contains literally a ton of Blu-Ray PGS subtitle streams.  It's the only title to have subtitles in this format, but it still wouldn't explain the need to re-encode the video stream if I have subtitles turned to off.  Also, as far as the ATV goes, all level 4.1 High encodes are also working flawlessly.  Perhaps there is a real difference between the ATV2 and ATV3 devices, and perhaps there ought to be separate profiles for these devices.

EDIT: Doh!  I left the subtitle setting to English for that one title.  I turned it off and now, no encode!  All films work now.  

So I raised the ref frames limit in the AppleTV profile from 8 to 14. Now, all films play without a hitch and no need to re-encode!  However, only one remains, and I can't see why it needs to re-encode.  The only difference from all the others is that it contains literally a ton of Blu-Ray PGS subtitle streams.  It's the only title to have subtitles in this format, but it still wouldn't explain the need to re-encode the video stream if I have subtitles turned to off.  Also, as far as the ATV goes, all level 4.1 High encodes are also working flawlessly.  Perhaps there is a real difference between the ATV2 and ATV3 devices, and perhaps there ought to be separate profiles for these devices.

EDIT: Doh!  I left the subtitle setting to English for that one title.  I turned it off and now, no encode!  All films work now.  

Well, the ATV2 doesn't even handle 1080P, so yeah. If the profile is shared then I assume that is the issue. I found a thread in a forum that says that ATV3 handles up to 15 reference frames. If that thread is correct, that is the limit.

The issue with having two profiles is that the ATV needs to present itself differently for this to be working. And maybe that is not the case? Just speculating here. I will ask the devs if I can find someone that has a second over =)

Well, the ATV2 doesn't even handle 1080P, so yeah. If the profile is shared then I assume that is the issue. I found a thread in a forum that says that ATV3 handles up to 15 reference frames. If that thread is correct, that is the limit.

The issue with having two profiles is that the ATV needs to present itself differently for this to be working. And maybe that is not the case? Just speculating here. I will ask the devs if I can find someone that has a second over =)

The ATV2 does indeed handle 1080p content but downconverts to 720p.  That's presumably why the ATV profile sets the upper video resolution before re-encoding to 1080p.  I think in terms of the complexity of the AVC stream, the ATV3 wins out, and therefore I think there ought to be separate profiles, unless as you say, they don't announce themselves.  

Atv2 does not down convert anything and plays 1080 just fine, provided that bitrate of the video is sane.

Atv2 does not down convert anything and plays 1080 just fine, provided that bitrate of the video is sane.

The ATV2 is not able to display 1080p material.  Its output to the display is locked at 720p or lower depending on the source.  It can handle a 1080p stream just fine, but will only display it a lower resolution and therefore downconverts all 1080p material.  That's the advantage of the ATV3.

The ATV2 is not able to display 1080p material.  Its output to the display is locked at 720p or lower depending on the source.  It can handle a 1080p stream just fine, but will only display it a lower resolution and therefore downconverts all 1080p material.  That's the advantage of the ATV3.

That is my understanding as well.

The ATV2 has issues with a lot of reference frames, hence why the setting (bear in mind that too many reference frames and the media file can be out of specification for that format).

Separate profiles for the ATV2 and ATV3 have been added to the roadmap earlier and are under discussion but you can tweak the profile yourself in the meantime.

The ATV2 is not able to display 1080p material.  Its output to the display is locked at 720p or lower depending on the source.  It can handle a 1080p stream just fine, but will only display it a lower resolution and therefore downconverts all 1080p material.  That's the advantage of the ATV3.

Sure, video output is 720 but that does not mean ATV converts (transcodes) 1080p to 720p on the fly in order to output it. If it could do that in real time it would be a great PMS host machine.

The ATV2 has issues with a lot of reference frames, hence why the setting (bear in mind that too many reference frames and the media file can be out of specification for that format).

Separate profiles for the ATV2 and ATV3 have been added to the roadmap earlier and are under discussion but you can tweak the profile yourself in the meantime.

There's no need for separate profiles, IMHO, since you can force transcode and limit bitrate in PlexConnect settings already. I'm using it since the beginning at 1080@40 with no problem at all, but my videos are Level 4.1, 4-6 ref frames with bitrate <= 10 000

There's no need for separate profiles, IMHO, since you can force transcode and limit bitrate in PlexConnect settings already. I'm using it since the beginning at 1080@40 with no problem at all, but my videos are Level 4.1, 4-6 ref frames with bitrate <= 10 000


It seems there are quite a few users with media files that have been incorrectly encoded with too many reference frames, we put in the limit to compensate for it causing issues on the ATV2 (they would not play unless transcoding was forced) but by doing so have introduced unneeded transcoding on the ATV3.
The above is not related to the actual bit rate.

It seems there are quite a few users with media files that have been incorrectly encoded with too many reference frames, we put in the limit to compensate for it causing issues on the ATV2 (they would not play unless transcoding was forced) but by doing so have introduced unneeded transcoding on the ATV3.
The above is not related to the actual bit rate.


I see. I guess they needed saving from themselves :)

I just hope you won't be limiting ATV2 to 720.

Sure, video output is 720 but that does not mean ATV converts (transcodes) 1080p to 720p on the fly in order to output it. If it could do that in real time it would be a great PMS host machine.

Yes, the ATV2 *does* convert the 1080p stream on the fly. It's called downconverting or down-scaling.  It doesn't need to create a new file to do so, as that would be called re-encoding the stream, and yes, there's no way it could do that on the fly.

I see. I guess they needed saving from themselves :)

I just hope you won't be limiting ATV2 to 720.

Why would they change the profile of the ATV2 to limit it to 720p streams?  The spec of the ATV2 indicates it's fully capable of decoding 1080p streams.

Where would I find this ios-AppleTV.xml? I was checking my folder structure on the server and I couldn’t find it…

It was removed from PMS years ago. PlexConnect now uses the iOS.xml profile as a base, and recent versions (from 0.6 onwards) also use profile augmentation to support Dolby Digital.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.