PDA

View Full Version : Handbrake settings for ATV3 (CLI)




HackerJL
Apr 5, 2012, 03:37 PM
I have been scouring the net trying to get the answer to my situation.

I have a ton of blurays that I converted to mkv over the last 6-8 months. in 1080P. I then converted them with mac.jedi's handbrake automation system (http://forums.macrumors.com/showthread.php?t=805573) to Appletv2. I kept the MKV's since I knew I would end up throwing the 720p version out and keeping the 1080p when the v.3 or whatever comes out.

So now I see there is no preset for the appletv3, handbrake forums state that you are to use the High Profile setting up to 1080p. Others say they just increase the ATV2 settings up to 1080p.

Now, what I found is that the handbrake gui, I need to go into picture settings, change anamorphic to custom, and then increase the height to 1080, while keeping aspect ratio. Making sure large file size is checked and away we go. Is that right?

Moreso to the point. If it is right, how do I adapt that into CLI. The handbrake presets are currently set to (as per https://trac.handbrake.fr/wiki/BuiltInPresets#highprofile)
./HandBrakeCLI -i DVD -o ~/Movies/movie.mp4 -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 --detelecine --decomb --loose-anamorphic -m -x b-adapt=2:rc-lookahead=50

Is it as simple as adding (in bold):

./HandBrakeCLI -i DVD -o ~/Movies/movie.mp4 -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 --detelecine --decomb --maxHeight <1080> --maxWidth <1920> --custom-anamorphic --keep-display-aspect -m -x b-adapt=2:rc-lookahead=50

Or I could add that to the appletv2 preset? Any input is appreciated!



roidy
Apr 5, 2012, 06:15 PM
Firstly, if your sources are blu-ray then you don't need the --detelecine or --decomb settings.

Apart from that all you should really need is --strict-anamorphic or -w 1920 --loose-anamorphic, no need to set --maxHeight or --maxWidth

Just a note, if you did ever need to use --maxHeight or --maxWidth then the correct format is --maxHeight 1080 --maxWidth 1920. You don't need the < > brackets.

HackerJL
Apr 5, 2012, 06:23 PM
Firstly, if your sources are blu-ray then you don't need the --detelecine or --decomb settings.

Apart from that all you should really need is --strict-anamorphic or --loose-anamorphic, no need to set --maxHeight or --maxWidth

Just a note, if you did ever need to use --maxHeight or --maxWidth then the correct format is --maxHeight 1080 --maxWidth 1920. You don't need the < > brackets.

Thanks for the reply.

Any harm in leaving detelecine and decomb? Extra time is not my concern.

Which is better. Strict or loose?

What's the harm in forcing the max height and width?

Many thanks again

roidy
Apr 5, 2012, 06:28 PM
Thanks for the reply.

Any harm in leaving detelecine and decomb? Extra time is not my concern.
I know decomb wont harm anything, not sure about detelecine, I wouldn't use it.

Which is better. Strict or loose?
Shouldn't make any difference, but just check my original post, I edited it, if you use loose you need to set the width.

-w 1920 --loose-anamorphic

What's the harm in forcing the max height and width?
No idea:confused: Probably wont harm anything, but it shouldn't really be needed. If you do use it make sure not to include the < > :D

murdoc158
Apr 5, 2012, 09:03 PM
If you have 1080p mkv files why not just remux them to mp4 (m4v) files? It will only take a few minutes per file.

HackerJL
Apr 6, 2012, 08:08 AM
If you have 1080p mkv files why not just remux them to mp4 (m4v) files? It will only take a few minutes per file.

I understand that only works if you have a certain audio codec etc. Doesnt work for them all.

obsidian1200
Apr 6, 2012, 12:37 PM
I understand that only works if you have a certain audio codec etc. Doesnt work for them all.

I think you meant certain video codec(?), since you can convert the audio without touching the video.

HackerJL
Apr 7, 2012, 04:11 PM
I know decomb wont harm anything, not sure about detelecine, I wouldn't use it.


Shouldn't make any difference, but just check my original post, I edited it, if you use loose you need to set the width.

-w 1920 --loose-anamorphic


No idea:confused: Probably wont harm anything, but it shouldn't really be needed. If you do use it make sure not to include the < > :D

Okay, I ended up using custom-anamorphic, and set the width and height. In itunes it shows up as video dimensions of 2529x1072. Is it since I used the 'keep aspect ratio' option? What gives?

mic j
Apr 7, 2012, 04:33 PM
Okay, I ended up using custom-anamorphic, and set the width and height. In itunes it shows up as video dimensions of 2529x1072. Is it since I used the 'keep aspect ratio' option? What gives?

Didn't Roidy say to just set the width to 1920? Height will be dictated by the various movie aspect ratios and is variable.

HackerJL
Apr 8, 2012, 01:29 PM
Didn't Roidy say to just set the width to 1920? Height will be dictated by the various movie aspect ratios and is variable.

If I just set the width (with loose-anamorphic), my video gets converted to 1925X816. Thats enough to be 720, not even close to 1080. I could just stick to my appletv2 presets if I wanted that.

If I set both the width and the height (1920x1080) my video comes out 1920x1072. Why doesnt it come out 1080 or higher (like 1920 coming out at 1925)

mic j
Apr 8, 2012, 04:07 PM
If I just set the width (with loose-anamorphic), my video gets converted to 1925X816. Thats enough to be 720, not even close to 1080. I could just stick to my appletv2 presets if I wanted that.

If I set both the width and the height (1920x1080) my video comes out 1920x1072. Why doesnt it come out 1080 or higher (like 1920 coming out at 1925)

Movies have all different heights, some are the full 1080, some have a black area top and bottom as they are displayed in a more theatrical format. It depends on the movie. So even if the output is 1080 in height, the black top and bottom is automatically cut off by Handbrake as a way to minimize file size. Do you really want all those Mb just saying "be black". :) That's where the 816 is coming from, it's trimmed it down. So you define the width 1920 and let the particular movie format dictate the height.

I'm curious why you don't use High Profile Anamorphic strict for an aTV 3 as has been suggested by Handbrake officionado's on the forum?

roidy
Apr 8, 2012, 05:30 PM
If I just set the width (with loose-anamorphic), my video gets converted to 1925X816. Thats enough to be 720, not even close to 1080. I could just stick to my appletv2 presets if I wanted that.

Post the exact command line you used, because if you set the width to 1920 you should never get an encode thats bigger.

If I set both the width and the height (1920x1080) my video comes out 1920x1072. Why doesnt it come out 1080 or higher (like 1920 coming out at 1925)

You shouldn't set the height as it's dependent on the aspect ratio of the source and how much you're cropping off the top and bottom for the black bars.

For instance if your source is 1920x1080 but has black bars top and bottom that are say 100 pixels high then the output file should, after cropping be, 1920x880.

If you crop those 100 pixels top and bottom and set both a width and height value all you do is stretch the encoded video vertically.

HackerJL
Apr 9, 2012, 10:24 AM
Post the exact command line you used, because if you set the width to 1920 you should never get an encode thats bigger.



You shouldn't set the height as it's dependent on the aspect ratio of the source and how much you're cropping off the top and bottom for the black bars.

For instance if your source is 1920x1080 but has black bars top and bottom that are say 100 pixels high then the output file should, after cropping be, 1920x880.

If you crop those 100 pixels top and bottom and set both a width and height value all you do is stretch the encoded video vertically.

Ah...that answers ALL my questions. Didnt know they did such a thing for the black, now it all makes sense. Thank you!

HackerJL
Apr 9, 2012, 11:01 AM
Movies have all different heights, some are the full 1080, some have a black area top and bottom as they are displayed in a more theatrical format. It depends on the movie. So even if the output is 1080 in height, the black top and bottom is automatically cut off by Handbrake as a way to minimize file size. Do you really want all those Mb just saying "be black". :) That's where the 816 is coming from, it's trimmed it down. So you define the width 1920 and let the particular movie format dictate the height.

I'm curious why you don't use High Profile Anamorphic strict for an aTV 3 as has been suggested by Handbrake officionado's on the forum?

Ya..this makes a ton more sense now that I know Handbrake cuts the black off...

on to the strict setting. Where did you find that? I only found this:
https://forum.handbrake.fr/viewtopic.php?f=7&t=23648

No mention of strict. The highprofile preset uses loose by default.

mic j
Apr 9, 2012, 11:54 AM
Ya..this makes a ton more sense now that I know Handbrake cuts the black off...

on to the strict setting. Where did you find that? I only found this:
https://forum.handbrake.fr/viewtopic.php?f=7&t=23648

No mention of strict. The highprofile preset uses loose by default.

Dynaflash is the Handbrake guru around here...his words are wisdom;).

Post is #350 in the "1080p Handbrake settings for new Apple TV?" in this forum.

Per Dynaflash:
"And like I said over there - releasing a preset...even if it's the same as High Profile but calling it AppleTV3 would stop all these questions
Easy ....

1. Choose High Profile
2. Turn off Detelecine
3. Set to Strict Anamorphic in Picture settings
4. Hit the "+" Button in the Presets Drawer
5. Type "AppleTV 3" for a Preset Name
6. Set Use Picture Size: Source Maximum
7. Check "Use Picture Filters"
8. Click Add.

... at least until hb releases an atv3 preset. Which will pretty much be this barring a couple minor changes at most."

HackerJL
Apr 9, 2012, 12:12 PM
Dynaflash is the Handbrake guru around here...his words are wisdom;).

Post is #350 in the "1080p Handbrake settings for new Apple TV?" in this forum.

Per Dynaflash:
"And like I said over there - releasing a preset...even if it's the same as High Profile but calling it AppleTV3 would stop all these questions
Easy ....

1. Choose High Profile
2. Turn off Detelecine
3. Set to Strict Anamorphic in Picture settings
4. Hit the "+" Button in the Presets Drawer
5. Type "AppleTV 3" for a Preset Name
6. Set Use Picture Size: Source Maximum
7. Check "Use Picture Filters"
8. Click Add.

... at least until hb releases an atv3 preset. Which will pretty much be this barring a couple minor changes at most."

Okay, thanks. I am starting to agree its stupid that there isnt a new preset for atv3. Thanks for the help.

If anyone is interested, this is the code I am using now:
--large-file -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 --decomb --width 1920 --strict-anamorphic -m -x b-adapt=2:rc-lookahead=50

dynaflash
Apr 9, 2012, 01:47 PM
I am starting to agree its stupid that there isnt a new preset for atv3.

Well, its not really "stupid" ... its just that we released hb 0.9.6 before the atv 3 came out. Therefore there was no way to prepare a preset for it in time and we do not hold back releases of Handbrake for a device announcement.

It will be in the next release or probably shortly in the nightlies.

The post I made referenced above was obviously for the macgui and run in testing by me on my atv 3 which I got *after* we released 0.9.6. We presume if you are using the cli your capabilities are way above average in terms of command line options etc. so that you can suss out on your own what you need to do to get what you want.

HackerJL
Apr 9, 2012, 02:13 PM
Well, its not really "stupid" ... its just that we released hb 0.9.6 before the atv 3 came out. Therefore there was no way to prepare a preset for it in time and we do not hold back releases of Handbrake for a device announcement.

It will be in the next release or probably shortly in the nightlies.

The post I made referenced above was obviously for the macgui and run in testing by me on my atv 3 which I got *after* we released 0.9.6. We presume if you are using the cli your capabilities are way above average in terms of command line options etc. so that you can suss out on your own what you need to do to get what you want.

Sorry, 'stupid' was not meant to be mean. I thought handbrake did their preset updates separately of the program. I obviously shouldnt assume anything.

So my command looks good?

dynaflash
Apr 9, 2012, 03:07 PM
Sorry, 'stupid' was not meant to be mean.
No Problem.

I thought handbrake did their preset updates separately of the program. I obviously shouldnt assume anything.

No though we are talking about that very thing right now. That said preset updates would be trivial for the HB Gui's since they read a xml plist. Much like you can now import and export presets from the Gui's, however that would not help you with the CLI since it has to be hardcoded in. The CLI doesn't read a plist.

So my command looks good?
Not sure tbh as I *never* use the cli . Does it do what you want ? If so its good.

Westside guy
Jul 14, 2012, 05:44 PM
Just a note to add to this older thread, in case other people find it via Google -

The Handbrake nightlies now have an ATV 3 preset.

LevMac
Jul 15, 2012, 04:39 AM
Just a note to add to this older thread, in case other people find it via Google -

The Handbrake nightlies now have an ATV 3 preset.

Can you explain to me how to download handbrake with the apple tv 3 settings please? I've been looking everywhere but no one explains how to get it

waw74
Jul 15, 2012, 08:35 PM
Can you explain to me how to download handbrake with the apple tv 3 settings please? I've been looking everywhere but no one explains how to get it

the item you quoted, says "The Handbrake nightlies".
if you type "handbrake nightlies" into google, it's the first link that comes up.

Westside guy
Jul 19, 2012, 01:21 AM
Yeah, what waw74 said - exactly.

Or just click here (https://build.handbrake.fr/) and then grab the "Mac" nightly.

Usually the nightly releases are very stable, but occasionally one might be problematic. If you have trouble with one of the nightly releases, wait a couple days and grab a new nightly release.

HackerJL
Jul 19, 2012, 01:28 AM
Yeah, what waw74 said - exactly.

Or just click here (https://build.handbrake.fr/) and then grab the "Mac" nightly.

Usually the nightly releases are very stable, but occasionally one might be problematic. If you have trouble with one of the nightly releases, wait a couple days and grab a new nightly release.

Correction. The new version out within the last few hours (stable) has appletv3 in it. Both CLI and GUI. :)

Westside guy
Jul 21, 2012, 04:17 AM
Correction. The new version out within the last few hours (stable) has appletv3 in it. Both CLI and GUI. :)

Yeah my last nightly (from roughly a week ago IIRC) just announced 0.9.8 was available and updated itself to the stable version. :D

I haven't used the CLI in a couple years since the GUI works very well. Now I just click on the ATV3 preset, adjust the CQ slider a tad and let it go (okay, I did save that as a new preset).

brablc
Apr 24, 2013, 04:59 PM
Now when the preset is already there the command would be:

HandbrakeCLI -i movie.avi -o movie.m4v --preset "AppleTV 3"

The command HandbrakeCLI -z would list what are the actual parameters.