My home DVD ripping solution for Wife friendly cataloging…

We buy all our DVDs, but they get beaten up fast, so I want to rather have them available to play off the central storage. We have an iMac in the kitchen, a Mac Mini behind the flatscreen TV as a “media server” with a long 20ft firewire 800 cable to a Drobo 12TB storage array in the basement. (On suitable UPS)

The problem:

HandBrake can rip DVDs and save them as .mp4 files, but it is not very wife friendly. It also sucks the CPU of the machine that is doing the ripping.  Therefore I want an easy way of loading DVDs in the iMac and a way of processing those DVDs ont he Mac Mini, which is usually not busy doing much…

Solution:

Wife runs “RipIt” app. Inserts DVD. Once done, RipIt ejects the DVD and the automated systems do the rest.

Step 1: Buy and install RipIt – This is the Wife friendly interface. RipIt just opens up a single window prompting you to insert a DVD… it then rips it (no compressing or anything like that) and spits it out… Go into settings and have it save the resulting ‘files’ to a specific location.. I use desktop. Also have it automatically rip, and spit out.

Step 2: Auto move the resulting rips to the Mac Mini for processing. (Key here is making sure to move the file once its not in use anymore)

Step 3: On the Mac Mini, use HandBrakeCLI to automatically extract the video and produce much smaller .mp4 files. Once again, making sure nothing is in use first.

Detailed info:

The products of RipIt are actually Mac bundles of the exact DVD – so if you open them, DVD Player runs and acts as it would have for the original, including menus, special features etc. The issue is that the files are the size of the DVDs – several Gigs.

Automation: Use cron to automatically run the scripts each minute…

Each of the scripts run on each computer are run every 1 minute with the simple cron entry. Type  crontab -e   to edit your cron file:

* * * * * bash /Applications/Utilities/Laurenson/1minute >/dev/null 2>&1

Script for iMac in the kitchen (Script moves files to the server once they have completed)

#  Copyright (C) 2009 Jeremy Laurenson
#  This script is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This script is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

cd /Applications/Utilities/Laurenson

echo Minute script.

echo Reconnect to Drobo share on Lounge Mac Mini:
# Try and remount Drobo share on Lounge Mac Mini, if not mounted.
/sbin/mount | grep -q /Volumes/Drobo
if [ “$?” -eq “0” ]; then
echo “We are already connected…”
else
echo Connecting…
mkdir /Volumes/Drobo
/sbin/mount_afp “afp://jeremy:pass@Lounge Mac mini._afpovertcp._tcp.local/Drobo” /Volumes/Drobo
fi
echo Done

cd /Users/betsy/Desktop
Echo Move ripped files from desktop to server…
# Check to see if we are already copying… if so, ignore this
if [ -f /Applications/Utilities/Laurenson/rip.iscopying ]
then
echo Already copying. Delete /Applications/Utilities/Laurenson/rip.iscopying to force.
else
/sbin/mount | grep -q /Volumes/Drobo
if [ “$?” -eq “0” ]; then
echo Drobo is mounted
if [ “`lsof -c RipIt | grep -c .ripit`” = “0” ]
then
touch /Applications/Utilities/Laurenson/rip.iscopying
for f in `ls -d *.dvdmedia`
do
SOURCE=”/Users/betsy/Desktop/$f”
MYFILE=”$f”
DESTINATION=”/Volumes/Drobo/Movies/DVDs/New/$MYFILE”
mv -f “$SOURCE” “$DESTINATION”
done
rm -f /Applications/Utilities/Laurenson/rip.iscopying
fi
fi
fi
# End of Rip copy stuff.
echo Done
cd /Applications/Utilities/Laurenson

Script for Mac Mini media server/processor:

#  Copyright (C) 2009 Jeremy Laurenson
#  This script is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This script is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

cd /Applications/Utilities/Laurenson
echo Minute script.

Echo Process movies that need to be ripped…
if [ -f  /Applications/Utilities/Laurenson/handbrake.isripping ]
then
echo Already ripping…. Delete  /Applications/Utilities/Laurenson/handbrake.isripping to force.
else

if [ “`lsof | grep -c .dvdmedia`” = “0” ]
then
touch /Applications/Utilities/Laurenson/handbrake.isripping
cd /Volumes/Drobo/Movies/DVDs/New

#Lets remove all spaces… Spaces nuke stuff
for f in “`ls -d *.dvdmedia`”
do
new_name=`echo $f|sed “s/ /_/g”`
old_name=”$f”
if [ “$old_name” != “$new_name” ]
then
mv “$old_name” “$new_name”
fi
done

for f in `ls -d *.dvdmedia`
do
MYFILE=`echo $f | cut -f1 -d’.’`
echo “Processing $MYFILE”
/Applications/Utilities/HandBrakeCLI -d  -e x264  -q 20.0 -a 1,1 -E faac,ac3 -B 160,160 -6 dpl2,auto -R 48,Auto -D 0.0,0.0 -f mp4 -4 -X 960 –loose-anamorphic -m -x cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0 -i “/Volumes/Drobo/Movies/DVDs/New/$MYFILE.dvdmedia/” -o “/Volumes/Drobo/Movies/DVDs/New/$MYFILE.mp4”
mv -f “/Volumes/Drobo/Movies/DVDs/New/$MYFILE.dvdmedia”  “/Volumes/Drobo/Movies/DVDs/Processed/”
done
cd /Applications/Utilities/Laurenson
rm -f  /Applications/Utilities/Laurenson/handbrake.isripping
fi
# Something has a lock on the dvd images – probably being written to.
fi
# End of ripping
echo Done

Editorial:

I love the robust nature of Unix/Linux style scripts. This stuff winds up being rock solid – a major change from my last attempts at this type of automation.

Advertisements

2 thoughts on “My home DVD ripping solution for Wife friendly cataloging…

  1. Thanks for pointing out RipIt. I’ve previously had difficulty circumventing ARccOS protection on a few of my DVDs using MTR. As a DVD backup solution, I use Toast 9, which compresses/re-encodes the VIDEO_TS folder left by MTR to fit 4.7GB discs. Sadly, I’ve found that Toast 9 is unable to read VIDEO_TS folders left behind by RipIt, so an extra step of compression was added before burning. I used DVD2oneX2 for this purpose.

    This is a fairly manual process. It’s nice to see use of the Handbrake CLI pointed out. How did you determine the arguments used for mp4 generation? Is this is a delicate balance of filesize and video quality?

    How does the video quality come out betwixt your TV and your Mac Mini? Are you using a minidisplay to HDMI converter? Do you control Front Row with your Apple Remote for a more conventional home theater interaction? Where does Blu Ray fit into your theater system, if at all? You’re not a Netflix subscriber, are you? If so, do you stream from your Mac Mini to your TV? What’s the quality like?

    Pardon all my questions. 🙂 Great post. Thanks for sharing.

    1. Hey Lee,

      The command line arguments are the args used when you use “AppleTV” as a default. One of the outputs from the HandBrakeCLI app is a listing of the actual args for the builtin presets. I also added deinterlacing as a fair number of DVDs I have are indeed interlaced. Yes, this is a balancing act, but for the most part the guys at Handbrake who came up with the defaults did it right.

      Yes, the TV and Mac mini are hooked up with a MiniDisplay–>HDMI adapter and then directly into the TV. The quality is great, and the resolution I have up there is 1080p. There is no sound via this cable, so I use regular stereo at the moment. There IS a digital out from the Mac Mini that can go direct to my receiver (See my “Giving DirecTV the boot” post for a link on turning it on) but QuickTime does not support 5.1 right now, so you need to use VLC or other apps to do it right.. Currently not “Wife friendly”

      I have a Logitech 890 remote which allows me to use RF and an IR “Extender” with IR blasters directly connected to the various pieces in the HT setup, so it does all IR for me.

      I do have a PS3 to do Blu-Ray, but I am increasingly less stressed about the improvement in picture vs ease of downloading and maintaining a smaller footprint. In my setup you have to walk up closer to the screen to tell the difference most times, and the utility of .mp4s at DVD quality (sync to iPhone, playable via GigE on the network etc) by far makes Blu-Ray a loser for me.

      I do not use NetFlix right now, but several folks I have spoken to say they do and that the quality is great.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s