AppleTV Custom Presets - 0.9.4

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.
MrMister111
Regular User
Posts: 100
Joined: Wed Nov 05, 2008 9:03 pm

Re: AppleTV Custom Presets - 0.9.4

Post by MrMister111 » Wed Sep 08, 2010 4:34 pm

Ok so public 0.9.4 has the options can you confirm dynaflash the exact advanced string to paste in to the AppleTV preset then please for quality/speed

Cheers

dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Re: AppleTV Custom Presets - 0.9.4

Post by dynaflash » Wed Sep 08, 2010 4:38 pm

Well, speed and quality are relative. Here is what I use:

Code: Select all

mixed-refs=1:b-adapt=2:b-pyramid=none:trellis=0:weightp=0:vbv-maxrate=5500:vbv-bufsize=5500
I discuss it here: http://dynaflashtech.net/2010/06/30/han ... ng-part-2/

MrMister111
Regular User
Posts: 100
Joined: Wed Nov 05, 2008 9:03 pm

Re: AppleTV Custom Presets - 0.9.4

Post by MrMister111 » Thu Sep 09, 2010 1:46 pm

dynaflash wrote:Well, speed and quality are relative. Here is what I use:

Code: Select all

mixed-refs=1:b-adapt=2:b-pyramid=none:trellis=0:weightp=0:vbv-maxrate=5500:vbv-bufsize=5500
I discuss it here: http://dynaflashtech.net/2010/06/30/han ... ng-part-2/
When I looked in the AppleTV standard preset advanced tab it already had some code, do I add your string to the end of it, or copy over it please?

cheers

dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Re: AppleTV Custom Presets - 0.9.4

Post by dynaflash » Thu Sep 09, 2010 3:19 pm

Replace the existing string with the one I posted.

dorito
Posts: 43
Joined: Fri Apr 11, 2008 4:36 pm

Re: AppleTV Custom Presets - 0.9.4

Post by dorito » Thu Sep 09, 2010 6:02 pm

im guessing the new apple tv wont need any birate restrictions like the old one and will be able to play bck much higher qaulity 720p content?

thanks

dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Re: AppleTV Custom Presets - 0.9.4

Post by dynaflash » Fri Sep 10, 2010 4:39 pm

yes, you are probably right. But as always, til I have mine in hand its just a guess.

User avatar
Rodeo
HandBrake Team
Posts: 12256
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Rodeo » Fri Sep 10, 2010 5:06 pm

dynaflash wrote:yes, you are probably right. But as always, til I have mine in hand its just a guess.
The number of A4-based devices already available makes it an easy guess. AFAICT from my iPhone 4 testing (where 720p with 30 Mbps average plays fine), the quality of the network connection will be more important than local bitrate spike limits.

But maybe vbv will indeed be required to ensure smooth streaming?

HotDogWolf

Re: AppleTV Custom Presets - 0.9.4

Post by HotDogWolf » Fri Sep 17, 2010 5:44 am

dynaflash, using your custom settings you have on your blog result in choppy play back on the Apple TV streamed or copied to the HDD. Using a nightly build of the current stable 0.9.4

When the picture moves fast it's like it's dropping frames.

Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Firelight » Sun Sep 26, 2010 7:40 pm

Have we settled on encoding settings for the new Apple TV yet? I've basically gone with high profile defaults while adding vbv-maxrate=13000:vbv-bufsize=13000 to the x264 options since the stated limit is 14 mbps. In testing with a couple of files this works OK on my iPad so the Apple TV is likely to work too.

User avatar
Rodeo
HandBrake Team
Posts: 12256
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Rodeo » Sun Sep 26, 2010 8:13 pm

Firelight wrote:I've basically gone with high profile defaults while adding vbv-maxrate=13000:vbv-bufsize=13000 to the x264 options since the stated limit is 14 mbps.
Interesting. Stated where?

Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Firelight » Sun Sep 26, 2010 9:42 pm

I've seen it stated in a number of places while researching x264 options for the A4. I think it might just be implied by the Main Profile lvl 3.1 support.

User avatar
Rodeo
HandBrake Team
Posts: 12256
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Rodeo » Sun Sep 26, 2010 10:38 pm

Firelight wrote:I've seen it stated in a number of places while researching x264 options for the A4. I think it might just be implied by the Main Profile lvl 3.1 support.
Oh, right: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels

FWIW, the iPd and iPhone 4 support High Profile, and I've played videos on my iPhone 4 where the average bitrate (and therfore peak bitrate) far exceeded 14 Mbps (around 30 Mbps, IIRC).

Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Firelight » Mon Sep 27, 2010 1:31 am

Wow ... if you went that high then it seems the margin for safety is very large. I'm just a bit worried at the thought of doing some mass encoding and ending up with something incompatible. The Apple TV is also streaming so that might put a more serious strain on the parameters if Apple isn't careful with the streaming implementation ... but we need to see the device in hand to be certain.

Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Firelight » Wed Sep 29, 2010 5:49 am

Well, here's the code snippet in java that I'm using to generate my Apple TV (2010) encodes:

In plain English, I run a script before hand that selects the proper source DTS track and converts it to AC3 using the following linked mkvdts2ac3 script. http://forums.macrumors.com/showthread.php?t=836043

The actual run of HandBrake uses the high profile preset and applies strict anamorphic if the dimensions fit within 720p. Otherwise, it uses loose-anamorphic to allow resizing to 720p. It also tries to pass through all markers and subtitles. I have vbv settings at 14000 due to the apple specs but it's almost certain we can go much higher. Practically speaking tho I'm not sure a peak bitrate higher than 14000 is going to be visible anyway, so I've left it in. I also cap the framerate at 29.97 which really shouldn't ever be a problem, but just in case. Both a stereo and AC3 surround track are generated from the proper selected audio track (again, parsed via script). I boosted the stereo track with DRC = 1.5 because I have frequent problems hearing encodes in even slightly noisy environments on the iPad. The AC3 track is there for high fidelity in home theater environments anyway.

Hope someone finds this useful. In general the A4 chip is really lenient on encodes so ending up at these settings wasn't much of a stretch. I messed around with a lot of quality options and found nothing really perceptible to me, so I stuck with the high profile defaults as a baseline.

Code: Select all

        bStrictAnamorphic = true;
        if( xRes > 1280 || yRes > 720 ) {
            bStrictAnamorphic = false;
        }

        cmdArgs = new ArrayList<String>();
        cmdArgs.add( handbrakePath );

        cmdArgs.add( "--verbose" );
        cmdArgs.add( "1" );

        cmdArgs.add( "--input" );
        cmdArgs.add( sourceFilename );

        cmdArgs.add( "--output" );
        cmdArgs.add( targetFilename );

        cmdArgs.add( "--format" );
        cmdArgs.add( "mp4" );

        cmdArgs.add( "--crop" );
        cmdArgs.add( "0:0:0:0" );

        cmdArgs.add( "--quality" );
        cmdArgs.add( "20" );

        cmdArgs.add( "--pfr" );
        cmdArgs.add( "--rate" );
        cmdArgs.add( "29.97" );

        cmdArgs.add( "--x264opts" );

        cmdArgs.add( "--encoder" );
        cmdArgs.add( "x264" );

        // default high profile settings ... LGTM!
        cmdArgs.add( "b-adapt=2:rc-lookahead=50:vbv-maxrate=14000:vbv-bufsize=14000" );
        // really slow setting ... probably too aggressive. I couldn't tell any difference in quality
//        cmdArgs.add( "cabac=1:ref=5:mixed-refs=1:b-adapt=2:bframes=5:no-fast-pskip=1:b-pyramid=normal:trellis=2:weightp=2:vbv-maxrate=12500:vbv-bufsize=12500" );

        cmdArgs.add( "--audio" );
        if( audioTrack != -1 ) {
            cmdArgs.add( String.format("%d,%d", audioTrack, audioTrack) );
        }
        else {
            cmdArgs.add( "1,1" );
        }

        cmdArgs.add( "--aencoder" );
        cmdArgs.add( "ca_aac,ac3" );

        cmdArgs.add( "--mixdown" );
        cmdArgs.add( "dpl2,auto" );

        cmdArgs.add( "--arate" );
        cmdArgs.add( "48,Auto" );

        cmdArgs.add( "--ab" );
        cmdArgs.add( "224,auto" );

        cmdArgs.add( "--drc" );
        cmdArgs.add( "1.5,0.0" );

        cmdArgs.add( "--subtitle" );
        cmdArgs.add( "1,2,3,4,5,6,7,8,9,10" );

        if( bStrictAnamorphic == true ) {
            cmdArgs.add( "--strict-anamorphic" );
        }
        else {
            cmdArgs.add( "--loose-anamorphic" );
            cmdArgs.add( "--modulus" );
            cmdArgs.add( "4" );

            cmdArgs.add( "--width" );
            cmdArgs.add( "1280" );
            cmdArgs.add( "--maxWidth" );
            cmdArgs.add( "1280" );
            cmdArgs.add( "--maxHeight" );
            cmdArgs.add( "720" );
        }

        cmdArgs.add( "--markers" );
        cmdArgs.add( "--large-file" );

User avatar
Rodeo
HandBrake Team
Posts: 12256
Joined: Tue Mar 03, 2009 8:55 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Rodeo » Wed Sep 29, 2010 3:10 pm

Firelight wrote:

Code: Select all

        cmdArgs.add( "--x264opts" );

        cmdArgs.add( "--encoder" );
        cmdArgs.add( "x264" );

        // default high profile settings ... LGTM!
        cmdArgs.add( "b-adapt=2:rc-lookahead=50:vbv-maxrate=14000:vbv-bufsize=14000" );
        // really slow setting ... probably too aggressive. I couldn't tell any difference in quality
//        cmdArgs.add( "cabac=1:ref=5:mixed-refs=1:b-adapt=2:bframes=5:no-fast-pskip=1:b-pyramid=normal:trellis=2:weightp=2:vbv-maxrate=12500:vbv-bufsize=12500" );
That can't be right. The options string is an argument to --x264opts.

HotDogWolf

Re: AppleTV Custom Presets - 0.9.4

Post by HotDogWolf » Wed Sep 29, 2010 5:18 pm

Converting DTS or AAC 5.1 to AC3 for the Apple TV is so simple with MKVTOOLS no need to install all them application.

http://www.emmgunn.com/mokgvm2dvd/mokgvmhome.html

Firelight
Posts: 24
Joined: Fri Aug 13, 2010 9:06 pm

Re: AppleTV Custom Presets - 0.9.4

Post by Firelight » Wed Sep 29, 2010 6:37 pm

Rodeo wrote:
Firelight wrote:

Code: Select all

        cmdArgs.add( "--x264opts" );

        cmdArgs.add( "--encoder" );
        cmdArgs.add( "x264" );

        // default high profile settings ... LGTM!
        cmdArgs.add( "b-adapt=2:rc-lookahead=50:vbv-maxrate=14000:vbv-bufsize=14000" );
        // really slow setting ... probably too aggressive. I couldn't tell any difference in quality
//        cmdArgs.add( "cabac=1:ref=5:mixed-refs=1:b-adapt=2:bframes=5:no-fast-pskip=1:b-pyramid=normal:trellis=2:weightp=2:vbv-maxrate=12500:vbv-bufsize=12500" );
That can't be right. The options string is an argument to --x264opts.
Good catch ... I messed that up when I was cutting and pasting things around yesterday to get ready for the Apple TV 2010 arriving. Well, anyway, you get the idea. :)

kenliles
Posts: 9
Joined: Fri Apr 20, 2007 6:50 pm

Re: AppleTV Custom Presets - 0.9.4

Post by kenliles » Wed Oct 06, 2010 7:32 pm

Did the settings for best ATV2 ever get determined;
I've had my ATV2 now for a while and the previous encodes I used don't work well at all (can't keep up with the bit-rate) (RF20) and
cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0

ken

HotDogWolf

Re: AppleTV Custom Presets - 0.9.4

Post by HotDogWolf » Wed Oct 06, 2010 11:56 pm

I been using the High Profile Preset with fantastic results. I don't think you could do much better than the HighProfile preset.

kenliles
Posts: 9
Joined: Fri Apr 20, 2007 6:50 pm

Re: AppleTV Custom Presets - 0.9.4

Post by kenliles » Thu Oct 07, 2010 2:08 pm

I'm trying High Profile again (with large file size checked);

I haven't seen any posts on this, maybe I'm just missing it somewhere; But is it known to the forum that the AppleTV preset (.9.4) produces files that the new AppleTV 2 cannot keep up with? (I have to drop to Average bitrate setting -2500 or less); [These are BD 1080p that I downrez via Picture Settings to 720, starting with the AppleTV preset];

ken

mduell
Veteran User
Posts: 6741
Joined: Sat Apr 21, 2007 8:54 pm

Re: AppleTV Custom Presets - 0.9.4

Post by mduell » Thu Oct 07, 2010 3:16 pm

kenliles wrote:I'm trying High Profile again (with large file size checked);

I haven't seen any posts on this, maybe I'm just missing it somewhere; But is it known to the forum that the AppleTV preset (.9.4) produces files that the new AppleTV 2 cannot keep up with? (I have to drop to Average bitrate setting -2500 or less); [These are BD 1080p that I downrez via Picture Settings to 720, starting with the AppleTV preset];
The stuttering issue is widely reported; wait until the whole movie syncs before playing.

nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: AppleTV Custom Presets - 0.9.4

Post by nightstrm » Thu Oct 07, 2010 3:56 pm

mduell wrote:
kenliles wrote:I'm trying High Profile again (with large file size checked);

I haven't seen any posts on this, maybe I'm just missing it somewhere; But is it known to the forum that the AppleTV preset (.9.4) produces files that the new AppleTV 2 cannot keep up with? (I have to drop to Average bitrate setting -2500 or less); [These are BD 1080p that I downrez via Picture Settings to 720, starting with the AppleTV preset];
The stuttering issue is widely reported; wait until the whole movie syncs before playing.
A lot of the stuttering reports that I've seen say that the problem starts once the movie has fully copied onto the AppleTV v2. I have confirmed this in my own testing, but the issue presents itself very infrequently. I can't think of any setting in the .9.4 AppleTV preset that would prevent the new AppleTV from streaming reliably (save the infrequent dropped frames).

kenliles
Posts: 9
Joined: Fri Apr 20, 2007 6:50 pm

Re: AppleTV Custom Presets - 0.9.4

Post by kenliles » Thu Oct 07, 2010 4:34 pm

yes- that somewhat correlates; On most movies it take some time to develop, but that time varies greatly.
The problem does NOT exist however for HD movies purchased from iTunes;
Only those genned from HB (and only HD level 720p); And it's every single one of those.
Also, it's not a stuttering (as in dropped frames); the picture actually slows to point that it runs in a sort of slow-motion, completely losing sync with the audio that stays current to real-time play (by seconds and minutes - not lip-sync issues);
Anyway - it sounds like these problems are not occurring for other folks, so I'm wondering if it's with my ATV; Everything else works about it though - and when I regen HD files using 2500 average bitrate, they work fine;

hmmm... I don't get it

ken

HotDogWolf

Re: AppleTV Custom Presets - 0.9.4

Post by HotDogWolf » Thu Oct 07, 2010 5:21 pm

I doubt very much this stuttering video is being caused by Handbrake.

It's been reported to be happening to movies from the iTunes store as well.

I feel that it's an issue with the refresh rate of the Apple TV with certain TV scalers. . I think all the stuttering problems are being caused by different pulldown ratios with different tv scalers over the HDMIs

kenliles
Posts: 9
Joined: Fri Apr 20, 2007 6:50 pm

Re: AppleTV Custom Presets - 0.9.4

Post by kenliles » Thu Oct 07, 2010 5:40 pm

I never thought the issue was with HB actually, but something in the ATV2; My ATV1 played these same files fine, so was assuming the problem was with the ATV2, but was looking for necessary HB adjustments to make it work. One of those adjustments is to encode with Average Bit-rate 2500 or less - that works, and that's what I will do until something else is fixed (unless I can find a better HB setting).

I agree with you, I think it's something to do with the ATV2 HDMI scaling because there's more raw power there than we had before (ATV1). and the effect I'm seeing is not really frame drop - it's a more serious syncing or bit-rate correlation mismatch issue. I use a Lumagen to rescale the output to the TV native, but it uses the hdmi handshaking with ATV2 to accomplish like any TV or other scaler would.

ken

Post Reply