More options

Jan 6, 2015 at 1:20 AM
First, I'd like to say I come from a Sorenson Squeeze "background", which satisfies my needs most of the time, but it has a few shortcomings: first, there's neither an audio passthrough nor an MP3 encode option, and more importantly, there are files it simply won't handle for some reason. The second is why I'm here.

I've been (trying) to use Handbrake for a while now, and while I've used it to some effect in the past a recent update wiped my presets and I was forced to go through creating them all over again. In this process I arrived at the box where one can enter further command line options for the encoder. Most importantly, the ones I intend to modify are crf-max, keyint, and scenecut [Sidenote: these, along with most, if not all, x264 options have GUI elements in Squeeze which I found very useful. The keyint and scenecut options are particularly essential if one wants to create a video which seeks well, so I hope these can perhaps be added to the advanced tab perhaps]. I, however, did not know what the expected syntax was, and google eventually led me to this discussion:

Apparently, Handbrake itself seems to have issues with the syntax, and I can confirm the rotate setting only works if it is entered as ", rotate=2", it doesn't work in the apparently expected syntax of "rotate=2:". Furthermore, any subsequent options entered after this option, in whatever syntax, make encoding impossible. This of course cast doubt on the entire function of that "More Options" box, as I have no quantitative way of really confirming if a setting such as crf-max is really being applied (if anyone knows how, let me know). This encoder, VidCoder was linked below, and the UI seemed much more friendly, particularly when saving presets, so I grabbed it. Unfortunately, because rotating is a checkbox option in VidCoder the command line is overwritten by it, and I have no way of confirming that this issue is not present as it is in Handbrake.

So the question, in short, is this: what is the correct syntax for adding additional options, and where should one put these (do they need to go under the advanced tab)? Do they work, as intended? How can I confirm that they (whether my specific options or any others) do from the output file?

One additional question is, and this is mainly to satisfy my curiosity: why doesn't the rotate setting work as intended in Handbrake? Why does it require odd syntax?

PS: It occurs to me that this information should probably be added to the documentation.
Jan 6, 2015 at 5:49 AM
For options like crf-max, keyint, and scenecut you can put them either in the "More settings" box or the Options string in the Advanced tab. I'd recommend sticking to the basic tab and using the "More settings" box. You can tell if they are picked up by checking the log window. You'll see something like this:

[18:52:47] + encoder: H.264 (libx264)
[18:52:47] + options: ref=2:weightp=1:subme=4:mixed-refs=0:rc-lookahead=20
[18:52:47] + quality: 20.00 (RF)

As for why ", rotate=2" works for HandBrake and requires that syntax, it's actually pretty funny. An important thing to note is that the official Windows GUI wraps the command-line interface. It constructs a very long query string, putting together all the things you enter into the interface, including that options string. The comma at the start breaks out of the normal x264 query option and lets you start inputting other command line options, like rotate. It's kind of like an injection attack on the program; HandBrake does not officially support rotation.

VidCoder however does not go through the CLI, it has native support for rotation built right into it. When you select a rotate option it adds a rotation filter to the encoding job and does not interfere with any other options.

Long story short, rotation is properly supported in VidCoder and only works with a hack in HandBrake.
Jan 6, 2015 at 6:26 AM
Thank you for the informative answer! I had a hunch it had something to do with the command line but I didn't understand why rotate in the usual "colon" syntax didn't work. I guess it's not an ordinary option like the rest are.

By the way, I noticed that mediainfo can get the options used in the encoding from the output video file, but are those values gained from the encoded video track itself or are they simply akin to tags, like on an MP3?
Jan 6, 2015 at 3:03 PM
I don't know how MediaInfo gets its information; it could be from both. I do know that it's sometimes inaccurate.