HandbrakeCLI hanging mid-2nd pass

Discussion of the HandBrake command line interface (CLI)
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
Posts: 1
Joined: Fri Sep 05, 2008 9:02 pm

HandbrakeCLI hanging mid-2nd pass

Post by lattin » Sat Sep 06, 2008 8:05 pm

Some background info...
My goal is to move my DVDs (Movies and TV/Anime) over to my multimedia computer. Playback will be either on my LCD monitor or my HD projector. Because of this I'm less concerned with encoding time and file size and am focusing mostly on video/audio quality. I should mention that I'm very new to this!

I'm using HandbrakeCLI v0.9.2 from the Windows XP w/ SP3 command console via batch file for multiple episode dvds and full movies. I successfully encoded all five episodes of an anime DVD yesterday and am happy with the quality. I used a slightly different command setup for the anime rip than I have listed below. Specifically, I set the bframes=16 as the documentation said it was more optimal for animated content.

I should also mention, I'm using both DVD43 and DVD Decrypter depending upon my input type. (Some of my movies are already in .iso form on my HDD, most will be ripped directly from DVDs, and in the case of the log below I ripped the movie to my HDD in file format with DVD Decrypter.)

Last night I attempted my first movie and have run into the same problem three times now. Specifically, HandbrakeCLI hangs midway through the 2nd pass. After force quitting I'm left with incomplete encodes ranging from 380mb-420mb, give or take. Because the hangs occured at roughly 20-30% completion and the files were only 400mb I assume I'm not in jeopardy of hitting the 32bit file cap. One of these such files actually played in VLC. The audio, video, and subtitles (foreign film) all were working in this partial file.

Here is the contents of my batch file for the failed encode. I pieced it together after pouring over the HandbrakeCLI documentation and various forum posts.

Code: Select all

HandBrakeCLI -i D:\Lady_Vengeance\VIDEO_TS -t 4 -o C:\Lady.Vengeance.mp4 -I -e x264 -E acc -b 2300 -2 -p -B 192 -a 1 -s 1 -T --crop 0:0:0:0 x ref=3:mixed-refs:bframes=13:bime:weightb:b-rdo:direct=auto:me=umh:me-range=64:subme=7:analyse=all:8x8dct:filter=0,0:trellis=1:no-dct-decimate:no-fast-pskip:cabac -V
I've varied the bitrate between 1500 and 2300 in an attempt to find the "sweet spot" for the quality I'm after. (I'm aware that 2300 may be overkill.) At all bitrates I've attempted, the encode hung partially way through the second pass. (I'd be thankful for any advice about tweaking my setup for optimal quality with file sizes <= 3gb, but the main focus of this post is obviously just getting a successful movie encode.)

If any further info is required, please let me know and I'll do my best to provide it.
OK, onto the log...

Code: Select all

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.


Press any key to continue . . .

D:\DVD>HandBrakeCLI -i D:\Lady_Vengeance\VIDEO_TS -t 4 -o C:\Lady.Vengeance.mp4
-I -e x264 -E acc -b 2300 -2 -p -B 192 -a 1 -s 1 -T --crop 0:0:0:0 x ref=3:mixed
se=all:8x8dct:filter=0,0:trellis=1:no-dct-decimate:no-fast-pskip:cabac -V
HandBrake 0.9.2 (2008021900) - http://handbrake.m0k.org/
2 CPUs detected
Opening D:\Lady_Vengeance\VIDEO_TS...
Scanning title 4...
+ title 4:
  + vts 4, ttn 1, cells 0->15 (2549555 blocks)
  + duration: 01:55:01
  + size: 720x480, aspect: 1.78, 29.970 fps
  + autocrop: 54/58/0/0
  + chapters:
    + 1: cells 0->0, 231577 blocks, duration 00:10:11
    + 2: cells 1->1, 123102 blocks, duration 00:05:36
    + 3: cells 2->2, 111110 blocks, duration 00:04:54
    + 4: cells 3->3, 117948 blocks, duration 00:06:10
    + 5: cells 4->4, 165283 blocks, duration 00:07:25
    + 6: cells 5->5, 229146 blocks, duration 00:10:27
    + 7: cells 6->6, 133928 blocks, duration 00:05:51
    + 8: cells 7->7, 218374 blocks, duration 00:09:23
    + 9: cells 8->8, 170442 blocks, duration 00:07:27
    + 10: cells 9->9, 259857 blocks, duration 00:12:33
    + 11: cells 10->10, 107605 blocks, duration 00:04:43
    + 12: cells 11->11, 164761 blocks, duration 00:07:49
    + 13: cells 12->12, 132670 blocks, duration 00:06:43
    + 14: cells 13->13, 157936 blocks, duration 00:06:55
    + 15: cells 14->14, 133694 blocks, duration 00:05:29
    + 16: cells 15->15, 92122 blocks, duration 00:03:24
  + audio tracks:
    + 1, Korean (AC3) (5.1 ch), 48000Hz, 384000bps
    + 2, Korean (AC3) (2.0 ch), 48000Hz, 192000bps
    + 3, Korean (DTS) (5.1 ch), 48000Hz, 768000bps
    + 4, Korean (AC3) (2.0 ch), 48000Hz, 192000bps
    + 5, English (AC3) (2.0 ch), 48000Hz, 192000bps
    + 6, Korean (AC3) (2.0 ch), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (iso639-2: eng)
    + 2, Espanol (iso639-2: spa)
    + 3, English (iso639-2: eng)
    + 4, English (iso639-2: eng)
Modified x264 options for pass 1 to append turbo options: ref=1:subme=1:me=dia:a
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 Cache64
Encoding: task 1 of 2, 100.00 %x264 [info]: slice I:1019  Avg QP:16.36  size: 41
425  PSNR Mean Y:48.61 U:51.25 V:52.44 Avg:49.38 Global:48.58
x264 [info]: slice P:169037 Avg QP:19.31  size:  9510  PSNR Mean Y:45.41 U:48.61
 V:49.87 Avg:46.27 Global:45.37
x264 [info]: mb I  I16..4: 43.2%  0.0% 56.8%
x264 [info]: mb P  I16..4:  7.9%  0.0%  0.0%  P16..4: 53.5%  0.0%  0.0%  0.0%  0
.0%    skip:38.6%
x264 [info]: final ratefactor: 21.16
x264 [info]: SSIM Mean Y:0.9831967
x264 [info]: PSNR Mean Y:45.426 U:48.625 V:49.881 Avg:46.288 Global:45.380 kb/s:
Encoding: task 1 of 2, 100.00 %x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 Cache64
Encoding: task 1 of 2, 100.00 %No accelerated IMDCT transform found
Encoding: task 2 of 2, 24.70 % (39.79 fps, avg 39.53 fps, ETA 01h05m41s)
As you can see, the encode stopped at 24.7%. I checked the output file and it was no longer growing in size. I left it sit for an additional 3+ hours just in case it was simply a display error.

Of note, as you can see for this attempt I used DVD Decrypter to rip the DVD to one of my HDDs as I decided to watch the movie while I waited :-). Previous attempts were using DVD43. I should also mention, in my first attempt I attempted to mixdown the audio to stereo. Thinking that may have been the problem I ceased the mixdown for the last couple attempts.

As I said above, I've successfully ripped 5 anime shows with a VERY similar command setup. Because of this I'm fairly confused as to what the problem might be. Help would be much appreciated!


Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: HandbrakeCLI hanging mid-2nd pass

Post by jbrjake » Wed Sep 10, 2008 2:11 pm

You surely didn't get those settings from anyone connected to the project.

"acc" is not a valid encoder name.
192 is not a valid faac bitrate.
Cropping zero is just a bad idea.
"x" without a preceding hyphen is not a valid option name in *any* command line app that uses gnu getopt.
Your x264 options are *total overkill* for your *ridiculously high* bitrate.

Since you've chosen not to provide a *verbose* activity log like you agreed to when you registered, it is impossible to tell why your encode failed.

Posts: 31
Joined: Thu Aug 14, 2008 7:02 pm

Re: HandbrakeCLI hanging mid-2nd pass

Post by SnorreSelmer » Fri Sep 12, 2008 6:03 pm

The devs included some really useful ready-made profiles that you should have a look at. Why reinvent the wheel!

Profiles worth looking at from my understanding of your needs: AppleTV, Constant Quality Rate, Deux Six Quatre

Look here for an idea about what they are: http://trac.handbrake.fr/wiki/BuiltInPresets

Post Reply