PS3 Don't You Break my HandBrake

PS3 Don't You Break my HandBrake

This blog was originally published on October 12th, 2007. It was published on TypePad and can be found here.

HandBrake is my favorite DVD ripper. The guys over at handbrake.m0k.org have done a terrific job. DVD ripping can be such a thorny hard to approach issue. This semester, I am taking two classes Found. of Image and Sound and New Media Production at Emerson College.

We began the Found. of Image and Sound class, by watching several scenes from Alfred Hitchcock's Rope. Here's the thing, the film was ripped by HandBrake. Furthermore, it was ripped by a 40ish video artist Professor who had never ripped a DVD before. She extolled the greatness of HandBrake, and guess what? Everyone in the class agreed. Is HandBrake the new Firefox? Is it the new dead simple, free Open Source application that users love to use? I would love to hear the download numbers, but I can only think of a hand full of Mac users who don't use it.

With that tidbit aside, now to get to the PS3 HandBrake compile HOWTO:

Download the most recent HandBrake source code. wget -c download.m0k.org/handbrake/HandBrake-0.9.1... Install jam, nasm and if you don't already have it installed libdvdcss2 sudo yum install jam nasm libdvdcss2

I was able to install these packages, because I had installed new yum repositories. The excellent directions I found for doing this were on the tbreak forum. Also I discussed this in an earlier posting describing my Yellow Dog installation and setup.

The repositories are as follows:

a. ydl-extras.repo [ydl-extras] name=YDL Extras baseurl=file:///media/CDROM/ gpgcheck=0 enabled=0 b. Fedora-Extras.repo [fedora-extras] name=Fedora Extras baseurl=download.fedora.redhat.com/pub/fedora/linux.. gpgcheck=0 enabled=0

c. livna.repo [livna-stable] name=Livna.org Fedora Compatible Packages (stable) baseurl=rpm.livna.org/fedora/5/ppc gpgcheck=0 enabled=0

d. freshrpms.repo [freshrpms] name=FreshRPMs baseurl=ayo.freshrpms.net/fedora/linux/5/ppc/freshr.. mirrorlist=ayo.freshrpms.net/fedora/linux/5/mirrors-fr.. enabled=1

#gpgcheck=1

Change directories to the directory you downloaded the HandBrake-0.9.1.tar.gz file. cd ~/Desktop Extract the files with: tar xvfz HandBrake-0.9.1.tar.gz Change directories into the HandBrake directory. cd Handbrake Run the make like tool "jam". I am afraid I don't know much about the jam command. I had never heard of it before, and this was the first time I have used it. The jam-2.5-4.fc5 rpm package that yum installed didn't come with a man page and just a couple of cryptic reference files. With that said, the jam command is: sudo jam jam generates a configure script and downloads lots of required packages such as: a52dec faac ffmpeg lame libdca libdvdcss libdvdread libmkv libogg libsamplerate libvorbis mpeg2dec mpeg4ip share x264 xvidcore

And then proceeds to compile them all one by one.

I encountered one particular snarly (difficult to diagnose) problem. The compile would churn, and then fail on a file called ipodutil.h. ipodutil.h could not be compiled. I traced it back to a bad faac compilation. It appears that the HandBrake faac was taking offense to my already installed faac libraries (requisite for VLC). The error stated that the already present faac(the VLC one) libraries had been compiled with mpeg4ip support, and the HandBrake faac libraries would have none of that. I taught HandBrake's faac a lesson, by immediately capitulating and uninstalling VLC FAAC and ffmpeg. HA. (I would much rather have my precious(HandBrake) than VLC(even though it is the greatest DVD player in the world) any day). <-That was two parentheticals in side another parenthetical. Once I had capitulated, the faac libraries were able to compile just fine. And I had my HandBrakeCLI command line HandBrake app. I copied HandBrakeCLI to /usr/bin/handbrake with: cp HandBrakeCLI /usr/bin/handbrake I was now ready to start my ripping engines. I mounted a DVD in the external XBox 360 HD-DVD drive: mount /dev/dvd /mnt/dvd I then immediately fired up my super fast, super sweet PS3 + 360 HD DVD Ripping Box with a HandBrake command of:

 handbrake -v -L -i /mnt/dvd/VIDEO_TS -o ~/movie.mp4

On subsequent rips I tried using h.264 encoding instead of ffmpeg encoding with:

 handbrake -v -e x264 -L -i /mnt/dvd/VIDEO_TS -o ~/movie.mp4

I have also tried 2 pass encoding with:

handbrake -v -e x264 -L -i /mnt/dvd/VIDEO_TS -o ~/movie.mp4

Voila, you now have h.264 dvd ripping and encoding in near real time. Author's Edit: Ugly green vertical bars have begun cropping up in my rips. I have filed a help request with the HandBrake forums. Ill keep the blog updated with developments.

It looks like this: (Click to see image) Greenlines

Author's Edit 10/13/07:

Following the helpful advice of cvk_b on the HandBrake Support forums. I tried encoding in a new movie in xvid. Guess what it worked great!. No Green Lines. I have tried ripping the same movie once again with ffmpeg, to see what happens. Perhaps the green lines were a result of the first two movies I tried, and more recent movies will not have this ugly effect.

With that said, I don't know how I feel about xvid. I am somewhat married to either MPEG4 or H.264 for one very simple reason. I am a big Apple User, and I am trying to maintain future codec compatibility with as many devices as possible. The PS3, XBox360 and AppleTV all support MPEG4 and H.264 and none support XVID. You can hack your AppleTV, and install a QuickTime plugin such as Perian, but then you are forced to scp your xvids to the AppleTV, and that is somewhat of a kludge. My hacked XBox, and my Linux based PS3 will both play XVIDs. So maybe XVID isn't so bad. But what happens, when I want to get an Xvid on my iPhone, Ill have to re-encode? Perhaps that's not so bad.