Encoding for A4 devices (iPad, iPhone 4, tv 2)

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.
Post Reply
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by mduell »

There's been a lot of questions lately about encoding for Apple's latest crop of A4 based devices. The settings below are the best practice for encoding for the iPad, iPhone 4, and tv 2 from any source (DVD, Bluray, HDTV, etc).

First step is to download the nightly, which fixes a number of known bugs and adds the iPad preset which should be your starting point.

Video tab: Most people are happy with Rate Factors (RF) of 19 to 22 for DVD sources and 21 to 25 for HD sources. Going lower is largely a waste of bits. Find what pleases you.

Picture size: If you're encoding only for iPhone 4, drop the width to 960. If you're encoding for iPad and iPhone, leave the width alone. If you want one encode for tv (and any other devices or not), raise the width to 1280.

Filters: If your source is interlaced, add decomb default. If your source is telecined, add detelecine default. If you don't understand the words you're reading, set them both to default; they're generally safe but will slow down your encode a bit.

Audio: If you have 5.1 sound connected to your tv, add AC3 passthrough (or AC3 encoding if it's a DTS source) as the second audio track.

That's all you need to do for a high quality, high efficiency encode that will work on all your A4 devices.
canyonblue737
Posts: 4
Joined: Wed Oct 06, 2010 3:29 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by canyonblue737 »

The procedure you suggest is nearly the same as those suggesting starting with the High Profile preset. What is the advantage of starting with the iPad vs. High Profile preset if you want to run your files on the full range of A4 device, iPhone, iPad, and ATV2? Thank you.
Deleted User 11865

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by Deleted User 11865 »

High Profile preset is a tad slower (and offers slightly better compression efficiency). It also includes an AC3 track and has Decomb and Detelecine enabled by default.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by mduell »

canyonblue737 wrote:The procedure you suggest is nearly the same as those suggesting starting with the High Profile preset. What is the advantage of starting with the iPad vs. High Profile preset if you want to run your files on the full range of A4 device, iPhone, iPad, and ATV2? Thank you.
The iPad preset needs no changes to guarantee A4 device compatibility (HP preset needs resolution, peak framerate set for HD sources). The only difference between the iPad preset with the optional changes described above and the High Profile preset is the advanced x264 string (b-adapt=2:rc-lookahead=50) which is not terribly significant.
epounds
Posts: 3
Joined: Sun Oct 10, 2010 1:08 am

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by epounds »

mduell wrote: Picture size: If you're encoding only for iPhone 4, drop the width to 960. If you're encoding for iPad and iPhone, leave the width alone. If you want one encode for tv (and any other devices or not), raise the width to 1280.
Thank you for this information. When you say "raise the width to 1280", do you mean to change the Anamorphic drop down to Custom and then change the Display Width to 1280? Without doing that, 720 is seems to be the max width if the source is a SD DVD. I just want to make sure I have the optimal Picture settings for the new Apple TV.

Thanks again!
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by TedJ »

I presume that mduell is referring to scaling HD material for playback on the various A4 devices... for SD encodes you don't need to adjust frame size at all.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by mduell »

epounds wrote:Thank you for this information. When you say "raise the width to 1280", do you mean to change the Anamorphic drop down to Custom and then change the Display Width to 1280? Without doing that, 720 is seems to be the max width if the source is a SD DVD. I just want to make sure I have the optimal Picture settings for the new Apple TV.
I mean the max in your preset, which only matters with HD sources... upscaling DVDs before encoding would be retarded.
jellegard
Posts: 32
Joined: Tue Apr 27, 2010 10:26 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by jellegard »

mduell-

i know a lot of these questions being asked seem simple and frustrating to you - your answers sometimes make that obvious. you are a much more advanced user than most. using Handbrake and the audio and video codecs is probably as easy and intuitive to you as waking up in the morning. there are several, let's say intermediate to advanced intermediate, users that want to know more. they want to understand why this is done or why that is done. and let's be honest, the wiki and the user guide are really very, very elemental and don't explain things well at all.

i would say that sometimes the questions users ask are not very clear to say the least. the bottom line is, i think a lot of people are just thirsty for some knowledge as to how to make the very best encode they can with their particular devices so they don't have to go back and do it again because let's face it, it's a lot of work and a serious time commitment especially if you are talking several hundred encodes. it would really suck to go through them and realize you had a couple of settings that could have been different that would have yielded far better results.

i am a person thirsty for this knowledge. i have used Handbrake for about a year now and before i would just encode a movie or two for my kids when we were going on a trip, or if i would go out of town i would RIP and encode a couple of movies for the plane ride, etc..... i have taken the time the last several months to get ALL my movies and music in order. i have PLEX to thank for this. i have ripped over 500 DVD and BluRays and several thousand CDs at this point. i have ripped everything in as lossless a format as i can. FLAC for music and MKV for movies. i am now at the point where i want to encode all my movies so if my kids want a movie from the collection they can just plug in their iPad or iPhone and sync or watch it via their AppleTV and it just works without me having to go deal with it.

now that i have pretty much all of my movies RIP'd i want to encode them all. ALL of the devices i will be encoding for are A4 devices - iPad, iPhone 4G and latest generation of AppleTV. your first post in this thread was very, very good. i think it cleared a lot of things up. at least it did for me. the only question i have is about the audio. i hope i ask in such a way that it is clear. let us use Star Trek as our example:

STAR TREK (2009)

VIDEO: i will choose:
(a) iPad preset from the latest nightly build and change the picture settings from 1024 x 432 to 1280 x 528 so that i have the best picture settings for all devices

OR

(b) High Profile preset from the latest nightly build and change the picture settings from 1920 x 800 to, again 1280 x 528

this is simple and straightforward and makes perfect sense. now let us go to the audio which i think is a little more confusing. at least it is for me as there seems to be so much more to consider/choose from.

AUDIO:
(a) using the iPad preset Handbrake's drop down menus default to the following settings on the Star Trek movie
0: English (TRUEHD) (5.1 ch), AAC (CoreAudio), Dolby Pro Logic II, Auto, 160

(b) using the High Porfile preset on the same movie - Star Trek (2008) - the drop down menus default to the following:
0: THE SAME AS ABOVE
1: English (TrueHD) (5.1 ch), AC3, 6 channel discrete, Auto, 640

depending on which preset i have chosen are the setting Handbrake picked for me the ones i should go with? which one would you recommend, mduell, if you only wanted to encode ONCE and have the highest quality encode for all of Apple's current A4 devices? i understand this will depend on if you want just stereo audio output or if you want multichannel audio output for use with the AppleTV connected to a receiver.

gauging from your original post in this thread it appears that we can encode our movies with both a multichannel and a stereo audio track. other than file size i don't know why anyone taking the time to do this properly would not want both such audio tracks to prevent having to re-encode.

getting back to the Audio on Star Trek, i want to give you a list of options for each item:

TRACK: English (TRUEHD) (5.1 ch), English (AC3) (5.1 ch), 2 English (AC3) (2.0 ch)
CODEC: AAC (Core Audio), AAC (faac), MP3 (lame), AC3 passthru, AC3
MIXDOWN: Mono, Stereo, Dolby Surround, Dolby Pro Logic II, 6-channel discrete
SAMPLE RATE: 22, 24, 32, 44.1 48
BITRATE: there are too many to list.....

now going on the premise that i want a multichannel and a stereo channel what should i put these settings at?
what if the movie has DTS-HD? would i use the same settings for the answer to the above?

i realize this is a long post with a lot of questions but i hate when a post only answers one question and then another question gets asked and so on and so on. then you have to print out a bunch of posts spread out all over hell in creation instead of having just one nice post with answers to a lot of questions. that's why i thought mduell's original post was so good. it answered a lot in one easy post and has been printed out as a reference. i appreciate any and all help and knowledge in my endeavor to create the best possible encodes - the first time out.

thx.
canyonblue737
Posts: 4
Joined: Wed Oct 06, 2010 3:29 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by canyonblue737 »

mduell: how about this? i want to take advantage of the High Profile's "slightly better compression efficiency" so what if I set it up as a cross between the iPad preset and the standard High Profile preset?

High Profile + Large File Size checked + NTSC 29.97 + Peak Framerate Checked + RF 19 + AAC Pass Through added + Filters (as needed) + Anamorphic Strict (this all is for SD DVD's, obviously the RF would need to change and I would have to look into the picture settings for when I get into Bluray Rips)

Wouldn't this create the "iPad preset" but with the High Profile advantages? Obviously the goal would still be to have this all be cross compatible across the range of A4 devices...

Thanks...
b18turboef
Posts: 2
Joined: Sat Nov 07, 2009 2:13 am

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by b18turboef »

I'd also LOVE to know the answer to what jellegard asked. I'm doing something similar, converting 100+ standard def concerts, many of which have DTS or Dolby Digital. My goal is to have THE BEST quality audio possible. I could care less how big the file size is. The video aspect isn't too hard to handle, but the audio is quite confusing, and after HOURS of searching I cant seem to get the answer I'm looking for. Thanks for your help!
teddyhh
Posts: 3
Joined: Mon Nov 30, 2009 10:44 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by teddyhh »

jellegard wrote:mduell-

STAR TREK (2009)

VIDEO: i will choose:
(a) iPad preset from the latest nightly build and change the picture settings from 1024 x 432 to 1280 x 528 so that i have the best picture settings for all devices

OR

(b) High Profile preset from the latest nightly build and change the picture settings from 1920 x 800 to, again 1280 x 528

this is simple and straightforward and makes perfect sense. now let us go to the audio which i think is a little more confusing. at least it is for me as there seems to be so much more to consider/choose from.
what exactly does that mean? Do you change anamorphic to custom and PAR WIDTH and HEIGHT or what are you changing? :)
aygie
Posts: 1
Joined: Mon Oct 11, 2010 6:25 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by aygie »

Hi guys, does the iPad support two audio tracks in 1 m4v file?
jellegard
Posts: 32
Joined: Tue Apr 27, 2010 10:26 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by jellegard »

just go into picture settings and adjust the width. the hight will be adjusted automatically....

as for my long post. if one of the devs will answer i'll be more than happy to make a donation. just let me know how much so i can begin undertaking the task of encoding these videos - PLEASE.

thx.
scotttaylor
Posts: 2
Joined: Mon Oct 11, 2010 11:35 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by scotttaylor »

I noticed the iPad handbrake preset (latest nightly build 3596) uses a fixed framerate - "29.97 (NTSC Video)" along with "Peak Framerate (FPS) setting checked. The AppleTV preset uses "Same as source" for framerate. What difference does this make? I have been having stuttering problems with both of my Apple TV's (gen1 and gen2) using AppleTV preset encodes of DVD's (no HD). It appears the fixed framerate helps with this issue but others have suggested stuttering problems might be an issue with the TV's refresh rate or fancy processing features. See this thread http://forums.macrumors.com/showthread.php?t=1025834. Can someone shed some light on this? I'd love to find a set of HB settings that work for my ATV2/iPad/iPhone4...
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by JohnAStebbins »

"Same as source" enables completely variable frame rates. The duration of every output frame matches the duration of each input frame (which can be variable). "Peak framerate" enables variable framerate, but with a cap at the specified frame rate. Any frame with a duration that is shorter than 1/framerate will be dropped/merged with other frames.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by mduell »

jellegard wrote:i am now at the point where i want to encode all my movies so if my kids want a movie from the collection they can just plug in their iPad or iPhone and sync or watch it via their AppleTV and it just works without me having to go deal with it.
Great, this thread is for you.
jellegard wrote:STAR TREK (2009)

VIDEO: i will choose:
(a) iPad preset from the latest nightly build and change the picture settings from 1024 x 432 to 1280 x 528 so that i have the best picture settings for all devices

OR

(b) High Profile preset from the latest nightly build and change the picture settings from 1920 x 800 to, again 1280 x 528

this is simple and straightforward and makes perfect sense. now let us go to the audio which i think is a little more confusing. at least it is for me as there seems to be so much more to consider/choose from.
Correct, I favor option (a) because it's less likely to ever have issues.
jellegard wrote:AUDIO:
(a) using the iPad preset Handbrake's drop down menus default to the following settings on the Star Trek movie
0: English (TRUEHD) (5.1 ch), AAC (CoreAudio), Dolby Pro Logic II, Auto, 160

(b) using the High Porfile preset on the same movie - Star Trek (2008) - the drop down menus default to the following:
0: THE SAME AS ABOVE
1: English (TrueHD) (5.1 ch), AC3, 6 channel discrete, Auto, 640

depending on which preset i have chosen are the setting Handbrake picked for me the ones i should go with? which one would you recommend, mduell, if you only wanted to encode ONCE and have the highest quality encode for all of Apple's current A4 devices? i understand this will depend on if you want just stereo audio output or if you want multichannel audio output for use with the AppleTV connected to a receiver.
If you have 5.1 sound, or expect to ever have 5.1 sound, add the AC3 track. If not, take the filesize savings.
jellegard wrote:getting back to the Audio on Star Trek, i want to give you a list of options for each item:

TRACK: English (TRUEHD) (5.1 ch), English (AC3) (5.1 ch), 2 English (AC3) (2.0 ch)
CODEC: AAC (Core Audio), AAC (faac), MP3 (lame), AC3 passthru, AC3
MIXDOWN: Mono, Stereo, Dolby Surround, Dolby Pro Logic II, 6-channel discrete
SAMPLE RATE: 22, 24, 32, 44.1 48
BITRATE: there are too many to list.....

now going on the premise that i want a multichannel and a stereo channel what should i put these settings at?
For the stereo track you're fine with either preset. For the iPad preset you'll need to add the AC3 5.1 track, AC3 passthrough, 6-channel discrete, auto (or 48k), auto (or 640).
jellegard wrote:what if the movie has DTS-HD? would i use the same settings for the answer to the above?
For the stereo track you're fine with either preset. For the iPad preset you'll need to add the AC3 5.1 track, AC3, 6-channel discrete, auto (or 48k), auto (or 640).
canyonblue737 wrote:mduell: how about this? i want to take advantage of the High Profile's "slightly better compression efficiency" so what if I set it up as a cross between the iPad preset and the standard High Profile preset?

High Profile + Large File Size checked + NTSC 29.97 + Peak Framerate Checked + RF 19 + AAC Pass Through added + Filters (as needed) + Anamorphic Strict (this all is for SD DVD's, obviously the RF would need to change and I would have to look into the picture settings for when I get into Bluray Rips)

Wouldn't this create the "iPad preset" but with the High Profile advantages? Obviously the goal would still be to have this all be cross compatible across the range of A4 devices...
Yes that will work. The HP advantages are really quite minor. If you're looking for better compression efficiency, use settings equivalent to x264cli's slow (b-adapt=2:rc-lookahead=50:ref=5:subme=8) or slower (b-adapt=2:rc-lookahead=60:ref=5:subme=9:direct=auto:me=umh:partitions=all:trellis=2 [ref=5 instead of ref=8 as in x264cli slower to maintain A4 compatibility at 1280x720]) presets.
b18turboef wrote:I'd also LOVE to know the answer to what jellegard asked. I'm doing something similar, converting 100+ standard def concerts, many of which have DTS or Dolby Digital. My goal is to have THE BEST quality audio possible. I could care less how big the file size is. The video aspect isn't too hard to handle, but the audio is quite confusing, and after HOURS of searching I cant seem to get the answer I'm looking for. Thanks for your help!
Take the DD (AC3) track passthrough since it's encoded from a better source. If there isn't a DD track, convert the DTS to AC3 as I suggested in my original post.
teddyhh wrote:
jellegard wrote:mduell-

STAR TREK (2009)

VIDEO: i will choose:
(a) iPad preset from the latest nightly build and change the picture settings from 1024 x 432 to 1280 x 528 so that i have the best picture settings for all devices

OR

(b) High Profile preset from the latest nightly build and change the picture settings from 1920 x 800 to, again 1280 x 528

this is simple and straightforward and makes perfect sense. now let us go to the audio which i think is a little more confusing. at least it is for me as there seems to be so much more to consider/choose from.
what exactly does that mean? Do you change anamorphic to custom and PAR WIDTH and HEIGHT or what are you changing? :)
No. Do not want. Use anamorphic loose, change only the width, leave keep aspect ratio checked.
aygie wrote:Hi guys, does the iPad support two audio tracks in 1 m4v file?
The iPad will allow multiple audio tracks (AFAIK the first one must be playable).
jellegard wrote:as for my long post. if one of the devs will answer i'll be more than happy to make a donation. just let me know how much so i can begin undertaking the task of encoding these videos - PLEASE.
No. Do not want.
jellegard
Posts: 32
Joined: Tue Apr 27, 2010 10:26 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by jellegard »

mduell-

i REALLY, REALLY appreciate you responding to my long post. hopefully it answers a lot of questions for a lot of people. basically what you're saying is use the AC3 track's from my RIPs, correct? and just disregard the Lossless tracks, correct? i am only getting the HD audio tracks for use in PLEX to be played through a Mark Levinson 502 media console. my wife and kids wouldn't know lossless if it bit them you know where. all they want is to be able to watch/play movies with ease. thank you so much again. let the encoding begin.....
scotttaylor
Posts: 2
Joined: Mon Oct 11, 2010 11:35 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by scotttaylor »

JohnAStebbins wrote:"Same as source" enables completely variable frame rates. The duration of every output frame matches the duration of each input frame (which can be variable). "Peak framerate" enables variable framerate, but with a cap at the specified frame rate. Any frame with a duration that is shorter than 1/framerate will be dropped/merged with other frames.
Why would I use "29.97" instead of "Same as Source" for DVD A4 device encoding? Which is better for ATV2 H/W?
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by TedJ »

Peak frame rate means "same as source, but never exceed the set frame rate" - this is needed for A4 devices when encoding some HD material, as the maximum supported frame rate is 29.97 fps. For SD material and the majority of Blu-ray rips this won't make any difference, it's only to catch some edge cases.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by mduell »

jellegard wrote:basically what you're saying is use the AC3 track's from my RIPs, correct? and just disregard the Lossless tracks, correct? i am only getting the HD audio tracks for use in PLEX to be played through a Mark Levinson 502 media console. my wife and kids wouldn't know lossless if it bit them you know where. all they want is to be able to watch/play movies with ease. thank you so much again. let the encoding begin.....
HandBrake doesn't support the lossless tracks except to the extent it can extract the AC3/DTS core from them.
scotttaylor wrote:Why would I use "29.97" instead of "Same as Source" for DVD A4 device encoding? Which is better for ATV2 H/W?
Because your source may be 60fps, which A4 devices don't support. 29.97 PFR is best for tv 2, as I said in my original post.
HotDogWolf

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by HotDogWolf »

720p @60fps plays back just fine on the Apple TV 2
Deleted User 11865

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by Deleted User 11865 »

HotDogWolf wrote:720p @60fps plays back just fine on the Apple TV 2
Cool.
mduell wrote:Because your source may be 60fps, which A4 devices don't support. 29.97 PFR is best for tv 2, as I said in my original post.
Just like the resolution, this is most likely an arbitrary limit imposed by iTunes.

(I should add that 30 fps syncs fine to my iPhone 4, but HB doesn't do 30 fps CFR anyway)
jellegard
Posts: 32
Joined: Tue Apr 27, 2010 10:26 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by jellegard »

can i buy the devs an Apple TV 2 so they can have one to test on? please advise....
HotDogWolf

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by HotDogWolf »

By the looks of things iTunes doesn't restrict anything, send any video over any bitrate any resolution any fps, If it plays thats another thing. i managed to even play level 5.1 only in SD $.2 plays back fine in 720p.
nick2421
Posts: 1
Joined: Wed Oct 13, 2010 1:37 pm

Re: Encoding for A4 devices (iPad, iPhone 4, tv 2)

Post by nick2421 »

Is there a hardware encoder that works with handbrake that I can purchase for Windows 7 to make the encoding process quicker?
I have a P4 3.0ghz system with 4gb of ram, but to convert a DVD using the high profile is taking about 5 hours.
I have over 100 dvds that I would like to convert for the new apple tv, but at 5 hours each it doesnt make sense.

I figure if I can purchase some hardware encoder, the process should be hopefully alot quicker.
Any sugguestions would be appreciated.

Thank You
Nick
Post Reply