Random Technolust - Hey, that CLI thingy still kind of rocks...

Monday, March 15, 2010
As an old school geek, I like to use the command line, whether it be Windows, Mac OS X or Linux. Not because I am some kind of curmudgeon who has something against GUI's and their drag and drop interfaces. I prefer it for the speed. Whether it be running XCOPY in Windows to move files around or using GREP to search a hard drive for files, I can do the job in the half the time at the command line.

Today, I had a project that required me to convert 120 hours of video in AVI format into something more palatable for iDVD. When I need to convert video files, whether it be for my phone or just to get them smaller, I turn to HandBrake. Sure, there are other tools out there to do the same job, but HandBrake  is the tool I use.

Let's get back to the task at hand. How do I convert hours and hours of video without using the GUI? HandBrake offers a handy dandy CLI version called, you guessed it, HandBrakeCLI. A little while later in BASH and I am converting piles of files at breakneck speed. Here is the command in all it's simple CLI goodness.
for i in *.Avi 
         do  ./HandBrakeCLI -i $i -o /OneWeekFastForward/MP4/03_08_2010/$i.mp4 -a none -r 24 -e x264
done
In case you are wondering, I am converting AVI files to MP4 files with no Audio (-a none), a frame rate of 24 fps (-r 24) and using the x264 encoder (-e x264). This format seems to make Final Cut and iDVD happy. I am converting each 24 hours of video in 1.5 hours, so this job will be done in 7.5 hours. Command Line Interfaces are geek-tastic. Get to know yours today.
The OS X Command Line Tutorial
The Windows Command Prompt
The Linux Command Line Tutorial
A BASH Tutorial
Windows Command Line Batch Files 
If you are curious about the Windows Command Prompt equivalent for HandBrakeCLI to the BASH command, here it is:
for %i in (*.avi)
    do HandBrakeCLI -i %i -o E:\MP4\03_09_2010\%i.mp4 -a none -r 24 -e x264
echo %1

1 comment :

We allow anonymous comments as long as they comply with our commenting policies. Any comments not meeting our standards will be deleted by the management.

Share This

Related Posts Plugin for WordPress, Blogger...