Conversion tool: Handbrake


Back to topics list
[post:544#5557]
Devil Doll

01/22/2012 01:05 PM

Reviews: 365
Posts: 1574

For years I have played anime on a standalone DVD player attached to my TV set. Consequently my conversion procedure for this purpose was creating a format that DVD players can handle: AVI containers with XviD video stream and MP3 audio stream.

Only recently I have switched to a new device, a digital satellite receiver box with an integrated media player and an USB slot (for connecting storage media such as an USB stick or an external hard disk). This device has its issues with SSA subtitles; then again it does support H.264 as video codec, AAC & AC3 as audio codec, and modern container formats such as MKV and MP4.

So for this device my new conversion format of choice (using the latest codecs but hard-coded subtitles) should be:

  • MP4 container (which can't contain SSA subtitles but I don't want these anyway)
  • H.264 video stream (with subtitles having been hard-coded)
  • audio track from the source (which most likely will be supported by the box, I'm okay with a procedure that handles 90% of all cases).
My previous video encoder VirtualDub can only create AVI containers and requires a bit of handling overhead, working together with a toolbox of other programs, filters etc. But my new format of choice might be something that others would like to use as well, given the existence of so many media boxes, game consoles and smart phones these days. So might there possibly be a tool that can create exactly what I want with a minimum of effort?

I am skeptical about those all-in-one solutions though. Thus I set up high requirements: The software must
  • be under maintenance as of 2012,
  • support the latest formats, most notably H.264 videos with 10-bit colors, and
  • deal reasonably well with SSA / ASS subtitles (I would accept some high-class animation effects in karaoke not be supported but fonts, colors, bold/italics, positioning, and 3D angles are a must).
And judging by my first experiments, it looks like I have found a tool matching all the requirements above. Its name is Handbrake. Originally designed for creating MP4 containers on Mac OS, it has got a Windows variant as well.

Now it's not like you open the video to be converted with Handbrake, and say "convert". Given the large number of output format variants for various Apple devices, and the various input formats (most notably in the subtitle section that supports hard-coding as well as importing subtitle scripts), much of the program's GUI looks intimidating at first. But walking through the many dialogs I soon got the impression that most of the defaults are reasonable, and there's little more to do than selecting audio and subtitle streams from the input and setting the checkbox "burned in" for the latter. Then a click on "Start", and off we go.

Handbrake has a "preview" option where you can select a time interval of the video that will be encoded on the fly and then displayed via the VLC video player (whose installation location has to be configured in Handbrake once). That's how you can check whether the result looks and sounds as you expect it to before actually starting the whole conversion. This preview encoding is stored as file on the disk so that you can inspect it with MediaInfo - and unfortunately the latter is necessary (see below).
Like VirtualDub, Handbrake has also a queue where you can schedule conversion tasks and then run the conversion of a whole bunch of files overnight or when you're away from the PC.

One annoying issue of the GUI appears to be that it frequently forgets the setting "burned in" for the subtitles (such as when you edit the file name extension for the encoding result from the automatically selected value ".m4v" to "mp4"), then creating a proprietary "Apple Text" stream (without any attributes, i. e. of mediocre quality, and what's worse, not supported by my media player) instead of hard-coding the subtitles; I had a number of failed encodings because of this before I noticed this side effect.
What's even worse is that the GUI sometimes even shows wrong information, such as the "burned in" checkbox being selected but not applied to the "added" subtitle stream shown below. This is really bothersome.
I also don't like the "intelligent" logic that sets the file name extension to the "iPod friendly" value of ".m4v" every time it detects an AC3 audio stream (and can't be disabled via configuration), most notably in connection with the issue stated above. The logic for automatically selecting the correct audio and subtitle stream from several choices is configurable based on the languages of these streams; I have yet to make more experiences with this to judge its quality but tend to rather select streams manually than to waste another encoding pass.

The video encoder is capable of making use of all four CPUs of my QuadCore CPU, thus processing 25 minutes of 1280x720px video stream in 15-20 minutes of real time; of course the processing priority of the encoder is configurable so that you won't paralyze your PC for this period.
The video encoder settings offer a choice between a target file size, a target bit rate, and a target quantizer within the same dialog (the default being a quantizer of 20 which may be slightly higher quality and file size than what some fansubs are currently using), combining flexibility with usability.
As for the "High 10" support, my test encodings worked okay; Handbrake being a black box, I don't know whether this is their achievement or whether they merely use the CCCP interface I have installed, but this doesn't really make a difference for me.

But in the end, the subtitle issue (causing lots of unnecessary encodings that you detect being unusable only afterwards), unnerves me so much that I don't really want to rely on this software. Which is sad because it would be a very good solution otherwise. Hm, maybe I give it a test period of a couple of weeks and see whether I can deal with it.

Edited on 01/22/2012 01:11 PM.

[post:544#5635]
Devil Doll

02/02/2012 12:31 AM

Reviews: 365
Posts: 1574

Looks like the main reason for the confusing behavior were the myriads of predefined profiles in this program. One I deleted them all, and defined my own profile, the "unwanted intelligence" appears to have gone, and using the "queue" and even the "create batch file" feature makes converting a whole bunch of files quite convenient.

[post:544#5816]
Devil Doll

07/08/2012 09:54 PM

Reviews: 365
Posts: 1574

In the meantime I have converted some 3600 files with Handbrake, using the "batch file" feature wherever possible. Almost every night I run a batch file processing one or more complete anime series from my archive, for both compressing them by about 30% compared to the AVI/XviD variant and making them definitely playable on my media player (which doesn't support some ancient formats like DivX3 and has issues with some fancy XviD features such as GMC3).

For some of my favorite series I have downloaded BluRay versions now (1280x720px is about as much as my "HD ready" TV set can display natively), and running these through Handbrake with my standard set of parameters (CRF 20 plus relatively CPU intensive settings for finding the best possible compression) results in files of about 200 MB per anime episode in HD.
I often cut off OP & ED sections in the process (I prefer to watch a story without interruption, unless one of the songs is amongst my absolute favorites), thus again shrinking the file size significantly (as the OP & ED sections contain a lot more movement than the average anime scene).

A large part of the files I processed are not anime but TV recordings by my satellite receiver that are broadcast in an insanely large format (MPEG2 in DVD quality) that Handbrake can compress to H.264 by a factor of 5-10 without visible loss of quality. Using the same tool for all video files I'm creating is quite nice, albeit I do have to convert these TV recordings through the usual 1 line AviSynth script first, and save the output to disk (lossless/HuffyYUV compressed, via VirtualDubMod) as Handbrake can't directly process AviSynth output.
Occasionally I'm using this method for anime as well, such as when I want the OP/ED section be part of the result and these include some fancy karaoke that Handbrake alone would support only without the effects (but AviSynth / TextSub handles correctly).

Edited on 07/08/2012 10:04 PM.

Reply to this topic Start a new topic
Back to topics list

Community Anime Reviews

anime mikomi org