Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A simple shell script controller for Handbrake's CLI Apps
I use MacTheRipper or 0sex to rip copies of my DVDs to the hard drive. From there, I then use HandBrake to create a queue of two conversions: one to compress the DVD into a 700MB file, and another one to compress it into an iPod-compatible format.

Usually this has to be done by hand, as Handbrake (the GUI) is not scriptable. However they did provide a CLI version (HBTest) that one can execute in a shell. So I created this script (doconv) that takes the following command line attributes:
doconv /path/to/VIDEO_TS/folder output_filename [full|ipod|all]
For example:
doconv /Users/username/Desktop/rips/MY_MOVIE/VIDEO_TS my_movie all
This makes it easy to batch the conversion of two movies at once, without utilizing the GUI. Read on for more detail on what the script does.

The above command will generate two files in /Users -> username -> Desktop -- note that you'll need to edit the script to replace USERNAME with your actual short username:
  1. my_movie_ipod.mp4 (the iPod-compatible version of the DVD), with the following attributes:
    • -e x264 (output compression format)
    • -b 400 (video bitrate)
    • -R 44100 (audio)
    • -B 128 (audio bitrate)
    • -w 320 (picture width)
  2. my_movie.mp4 (the big version of the DVD, ~700mb), with the following attributes:
    • -e x264 (output compression format)
    • -S 700 (output filesize 700MB, adjust rate automatically)
    • -2 (two-pass encoding)
    • -R 44100 (audio)
    • -B 128 (audio bitrate)
All of these attributes can be looked up by executing HBTest --help. Currently the script (HBTest, that is) assumes a couple of things: always take the first chapter of the DVD to compress, always take the first audio channel, no subtitles, etc. This script screams for a GUI, but my Xcode experience is limited.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[26,873 views]  

A simple shell script controller for Handbrake's CLI | 4 comments | Create New Account
Click here to return to the 'A simple shell script controller for Handbrake's CLI' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Good GUI
Authored by: jecwobble on Nov 28, '06 11:14:42AM
HBtest would work great in conjunction with OnMyCommand.

[
Reply to This | # ]
A simple shell script controller for Handbrake's CLI
Authored by: KenS on Nov 28, '06 03:21:06PM

I may be overlooking the obvious, but where to you download the HBTest binary or source code for OS X?



[ Reply to This | # ]
A simple shell script controller for Handbrake's CLI
Authored by: clknight on Dec 02, '06 06:30:53AM

Um, doesn't HandBrake 0.71 support queuing? There's an "enable queue" box in the lower left corner that allows you to stack as many jobs as you want.

---
Chris



[ Reply to This | # ]
A simple shell script controller for Handbrake's CLI
Authored by: ossiejnr on Feb 12, '07 10:47:54AM