A simple shell script controller for Handbrake's CLI
Nov 27, '06 07:30:03AM • Contributed by: blafusel
Nov 27, '06 07:30:03AM • Contributed by: blafusel
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:
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:
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:
- 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)
- 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)
•
[26,866 views]
