
Introduction
Backing up a DVD or Blu-Ray library can be an arduous, time consuming task. Using a GUI tool is a simple task if you do one occasionally, but a lot of us have amassed large collections that would take days, weeks, months or even years to complete.
And, if you’ve ever tried to encode an entire season of TV episodes you know how laborious a project this can be as well: Insert a DVD, rip the disc, choose your encode settings, select and add each title to the queue, process the file, rinse and repeat for each of the discs in the season … and don't even get me started on manually doing this with Blu-ray.
The good news is that most of these tasks can be easily scripted to remove the manual intervention required. Just insert a disc and it will rip automatically. When done, pop in another. If you’ve got Mac with two or three optical drives connected, fill em' up and you’ll save yourself some trips. Set a repeating iCal alarm, and at midnight HandBrakeCLI will encode each track within the min/max duration you set in your workflow. You can even set it do multiple encodes if you'd like an iPod version, an Apple TV 720p version and/or a DTS 1080p MKV file for Plex. All you need to do now is the tagging, but why stop there … let's automate that as well! If you want to get really fancy, you can take your workflow to the next level by using folder actions or Noodlesoft's Hazel to backup your rips, add the finished files to all the iTunes Libraries on your network and sync to an Apple TV. Virtually anything is possible with automation.
Note: This tutorial assumes you have some familiarity with Mac OS X 10.6 and the ripping/encoding process. The focus of this tutorial is how to automate your workflow. It is not intended to be a beginners guide to DVD/BD encoding. If you are new to any of the concepts presented in this tutorial, I highly recommend engaging in some of the fantastic forum threads on the macrumors and handbrake forums to help get you started. Then, return to this tutorial after you have become comfortable with the process and have been successful doing it manually. See the section Additional Resources for more info.
This tutorial follows the recommended approach of ripping the complete folder structure of your optical media to your hard drive. For DVD media, this is done with FairMount. For BD media, we use MakeMKV (beta) which extracts each title of a disc into a MKV file. So instead of copying the entire disc, it will only copy the tracks that are over the minimum duration set in MakeMKV's GUI preferences. MakeMKV is still in beta and has some drawbacks. The command-line interface does not include track duration, so min/max duration filtering is not possible. Also, MakeMKV doesn't fully support BD+ titles and may not work with every disc or drive.
Until MakeMKV is out of beta, I highly recommend using AnyDVDHD for your BD backups. AnyDVDHD is developed by SlySoft.com and is considered the gold standard for BD backup. The upside to AnyDVDHD is that it fully supports Blu-Ray copying and creates a true backup of the entire disc. The downside is that it is Windows only. AnyDVDHD can be used with the free, open source VirtualBox for Mac, VMware Fusion (recommended) and Parallels. Using this method, eac3to or tsMuxeR can be used to get BD track info for use in min/max duration filtering.
Once the disc's contents have been ripped to the hard drive, the movies or TV episodes are encoded to an iTunes compatible MP4 format and/or MKV file for Plex. Next, the files are tagged with metadata iTunes, FrontRow, AppleTV or other devices can manage. The workflow is broken up into components that can be used individually or together to create one simple batch workflow.
Workflow Components
- Getting Started
- Batch Rip Workflow
- Rename Files & Folders
- Batch Encode Workflow
- Auto-Tagging with theMovieDB.org and theTVdb.org
- Using Hazel to manage your media
Getting Started
Batch Rip Actions for Automator
Batch Rip Actions for Automator are actions that automate each step of the batch rip and encode process.
Automator is an innovative personal automation assistant that makes it easy to automate repetitive tasks. Automator lets you skip the complex programming and scripting that is normally required to create automations. Individual steps called actions can be assembled into a complete task by dragging actions into an Automator workflow. You can run your completed workflows repeatedly, create Services, Folder Actions, iCal Alarms and Droplets.
These actions began as a series of scripts that made up my batch rip workflow. When I started writing this tutorial, the focus was to illustrate how to create these scripts and tie them together. However, with the introduction of Snow Leopard, it became clear to me that Automator and Services could make this a much simpler process.
So, I switched gears and began writing about how to use Automator along with my collection of scripts to create a really great batch workflow. However, after about a thousand lines of how to edit and compile these components, I realized that it would be even simpler to just make them pre-compiled Automator actions.
Actions are the building blocks for creating Automator workflows. Each action performs an individual step you might currently do manually‚ such as ripping a disc, changing filenames, encoding files with HandBrake, or tagging files with iTunes metadata.
This tutorial will focus on how to use these actions in our workflows. But before we get started, we need to install our actions and set up our batch folders.
To complete this tutorial you will need to download and install the following:
Batch Rip Actions for Automator v1.0.4
The actions included in this bundle include:
Batch Rip
This action copies video DVDs and BDs to a chosen folder. Will cancel after 30 seconds unless set to Run Automatically.
Batch Rip Dispatcher - NEW
This action controls the Batch Rip Dispatcher LaunchAgent which acts like a folder action to automatically launch Batch Rip when a disc is inserted.
Batch Encode
This action encodes DVD/BD content to m4v/mkv. This action receives no input from other actions, only input sources specified in the action panel. Input types: DVD-ROM, BD-ROM, VIDEO_TS, BDMV, m2ts, mkv.
Rename Movie Items
This action searches themoviedb.org for movies matching the query and renames items to the selected search result.
Add TV Tags
This action searches thetvdb.com database and adds iTunes metadata for the specified TV episode mp4/m4v files.
Add Movie Tags
This action searches themoviedb.org database and adds iTunes metadata for the specified mp4/m4v files.
Add Movie Poster
This action will add cover art to selected files.
Add Genre to Movie File
This action tags mp4 files with a selected iTunes genre.
Tag Inspector - NEW
This action displays the iTunes metadata for the input file.
Get Source Info from HandBrake - NEW
This action scans each source with HandBrakeCLI and saves the info to a text file.
Installing Batch Rip Actions for Automator
- Download the Batch Rip Actions for Automator installer.
- Open the dmg file and Double-click to run the installer.

- Follow the installation instructions & perform a standard installation.

- The Actions will be installed in your ~/Library/Automator folder. The related Automator workflow files will be placed in your ~/Library/Services. This folder contains all the pre-built workflows which are used in this tutorial (plus a few others that are helpful, but not essential to the workflow). Additional shared components will be installed in the /usr/local/bin folder on the System volume of your computer.
- There are also additional Service workflows provided that are not touched on in this tutorial.
Managing Your Workflow Files
A well planned folder structure will make your workflow much easier to manage. Most of these workflows rely on consistent paths to the source and destination folders, as well as the paths to the actions and applications themselves. For most users, your files should be processed on your local hard disk. External drives can be used, but in some cases they may slow down the speed of your encoding.
For this tutorial, we'll use your ~/Movies folder as the container for your workflow files and folders. Keeping your workflow under this one directory will make this process much easier. You can then have Hazel or Automator move the finished rips and encoded files to another drive or remote volume after they are done.
IMPORTANT: These workflows rely on one important piece of information that needs to be set for each disc, Video Kind. Video Kind is a variable we use in the actions to identify whether a disc contains a Movie or TV Show. The easiest way I've found to do this is to simply rip TV Shows to one folder and Movies to another. A script can then determine a disc's "kind" based on its location. The Batch Rip Dispatcher allows you to set the video kind for each disc inserted. Also included are two Services located in your Services folder that will add the “video kind” as a Spotlight comment to selected files or folders.
With the video kind set, the Batch Encode action will now know whether to encode every episode for TV Shows or only the main feature for Movies. You can also set unique min/max durations for each video kind. Video kind also helps for auto-tagging. Auto-tagging during the encoding process only works reliably for movies. TV Shows need to be done as a separate process after the files have been encoded to ensure that all the episodes have been verified, sorted and renamed properly with season and episode number.
Creating Your Batch Folders
- Navigate to your ~/Movies folder.
- Create two folders and rename them Batch Rip TV and Batch Rip Movies. These folders will be used as the destination folders for your ripped files when copied from DVDs and BDs using the Batch Rip action. These folders will also be the source folders for the Batch Encode action.
- Create another folder named Batch Encode. This folder will be the destination folder for your final encoded m4v/mkv files using the Batch Encode action.

About Growl Support
Growl v1.2
Growl is a free notification system for Mac OS X: it allows applications and scripts that support Growl to send you notifications.
The Batch Rip and Batch Encode actions both contain Growl support. The growlNotify command-line tool is needed by these actions to notify the Growl application. To activate notification by email or speech, navigate to the Growl System Preferences and click enable in the growlNotify application notification settings.

- Download Growl, open the DMG file and install the application.
- Keeping the DMG file mounted, Open Terminal.app from your Applications/Utilities folder.
- Enter the following two commands in the Terminal window. Press the Return key after each command.
- Code: Select all
cd /Volumes/Growl-1.2/Extras/growlnotify
- Code: Select all
./install.sh
- Enter your administrator password and growlNotify will then be installed in a hidden directory used for command line tools: /usr/local/bin
Using Batch Rip to Automate DVD/BD Ripping

This workflow uses several technologies to automate the ripping process. For DVDs, FairMount and VLC are used to decrypt and mount DVDs on your system. A subroutine within the Action will then copy the entire DVD to your hard drive. Also, if your have more than one DVD drive, this Action will allow multiple DVDs to copy at the same time. The Action also includes Growl notification support and an option to eject the discs when finished.
For Blu-Ray, the workflow is essentially the same, except we use MakeMKV which extracts each title of a disc into a MKV file. So instead of copying the entire disc, the script will only copy the tracks that are over the minimum duration you set in MakeMKV’s GUI preferences, not the Action. For now, there is no way to get the title duration from the makemkvcon CLI. Hopefully, MakeMKV will add title duration to the CLI output in a future release.
For TV shows the Action will extract every title over the minimum duration. Movies will extract only the main title. Since MakeMKV's only output format is MKV, this will be the input format for HandBrake if further encoding is desired.
Note: It is also possible to use MakeMKV to encode DVDs straight to MKV as well, using the useOnlyMakeMkv setting in the Batch Rip Action. Same restrictions will apply to title duration.
OPTIONAL: Though this workflow does support Blu-Ray ripping using MakeMKV, the recommended way to rip a Blu-Ray disc is using a combination of VMware Fusion, Windows XP (or better), and AnyDVDHD. For this method, we launch our Windows environment, insert a disc, right-click the AnyDVDHD icon in the task bar and select "Rip Video DVD to Hard Disk…". AnyDVDHD will then copy entire disc in its original format to one of our batch folders. It can also copy multiple discs at a time if you have more than one drive, just right-click and select "Rip Video DVD to Hard Disk…" again, select your other drive in the pop-up window and Click "Copy DVD". After all the discs have been copied. We run a batch script in Windows that uses eac3to to get valuable title info from the copied files that we can later use on the Mac side to weed out unwanted tracks. This script is provided below.

eac3info.command Prints eac3to info output to file
- Code: Select all
for /d %%i in ("Z:\Path\to\Batch Rip Movies\*") do "C:\Path\to\eac3to\eac3to.exe" "%%i" > "%%i\%%~ni_info.txt"
)
for /d %%j in ("Z:\Path\to\Batch Rip TV\*") do "C:\Path\to\eac3to\eac3to.exe" "%%j" > "%%j\%%~nj_info.txt"
)
What you need to get started
To complete this tutorial you will need to download and install the following applications:
FairMount v1.0.5
FairMount is a free tool that allows decryption of DVD content on the fly for a convenient access. FairMount does not perform the actual decryption, it simply forwards the data to VLC Media Player which is used for decryption - thus, VLC Media Player must be installed for FairMount to work. You also need to use the same Bit versions for both applications: 32 or 64 Bit. Install in /Applications.
Note: (there is no need to install DVDRemaster that comes with the package)
VLC Media Player v1.0.3
VLC media player is a free, open source multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. VLC Media Player must be installed for FairMount and HandBrake to work with DVDs. Install in /Applications.
Note: You also need to use the same Bit versions for both FairMount and VLC: 32 or 64 Bit.
MakeMKV v1.4.9
MakeMKV is the only mac native app for ripping Blu-ray discs. However, at this time it doesn't fully support BD+ encrypted discs and may not work with every disc or drive. It converts DVDs and BDs into a set of MKV files. MakeMKV has a GUI and a command-line interface which is located in the application's bundle. Install in /Applications.
Note: (MakeMKV is a free beta, for now )
Creating your Batch Rip Service
This Service displays a dialog box whenever a BD-ROM or DVD-ROM is mounted. The action will cancel and ignore the disc after 30 seconds, if no action is received from the user. The dialog box will ask if you'd like to copy the disk. Choosing Movie or TV Show will set the video kind for that disc. The action will then copy the disc to your Batch Rip TV or Batch Rip Movies folder. You can also set the action to run automatically which disables the dialogs and uses the default video kind set in the action panel.

- Launch Automator and open the "Batch Rip • Batch Rip (Service).workflow" file located in ~/Library/Automator.
- Set the options in the action panel.
- Run Automatically (disables dialog boxes and runs without user intervention).
- BD-ROM & DVD-ROM check-boxes (type selected will launch the workflow).
- Skip Duplicates prevents copying a disc if it already exists. If unchecked, it will copy the disc and append a number to the name of the new copy (useful in situations where a series of discs have the same name).
- Default video kind (when Run Automatically is set, this selection will copy all discs to either Batch Rip Movies or TV Folder).
- Set the path to the FairMount application (32 or 64-Bit, depending on version of VLC installed). Note: FairMount and VLC is required
- Set your output directories (see section on Folder Setup for more info).
- Choose additional options: Enable Growl, Eject disc when done, Use MakeMKV for DVD (instead of Fairmount), Save Session Log (saves Terminal output to ~/Library/Logs).
- Choose Save As > Save service as: Batch Rip • Batch Rip (Service), replacing the existing file. Note: Services are saved in ~/Library/Services.
Using Batch Rip Dispatcher
Batch Rip Dispatcher is a LaunchAgent that monitors your /Volumes directory for BD-ROM or DVD-ROM discs. It keeps a record of currently mounted discs and controls the activation of the Batch Rip Service. To control Batch Rip Dispatcher we use the "Batch Rip • Batch Rip Dispatcher" service located in the Services menu:
- Choose Application Menu > Services > "Batch Rip • Batch Rip Dispatcher" to run the service.
- A dialog box will appear with three options: Enable, Disable, and Reset.

- Choosing Enable will activate Batch Rip Dispatcher and start watching for discs. It will then launch the Batch Rip • Batch Rip Service whenever a BD-ROM or DVD-ROM is mounted.
- Choosing Disable will deactivate Batch Rip Dispatcher and no action will be taken when a disc is inserted.
- Choosing Reset will disable Batch Rip Dispatcher and clear the cache of known inserted discs. You will then have the option of re-enabling it.
- You can enable or disable Batch Rip Dispatcher at any time by Choosing Application Menu > Services > "Batch Rip • Batch Rip Dispatcher"
Testing your Batch Rip Workflow
- Make sure you have enabled Batch Rip Dispatcher by Choosing Application Menu > Services > "Batch Rip • Batch Rip Dispatcher"
- Insert a BD or DVD. Wait for the disc to mount and the dialog box to appear asking if you’d like to copy the disc. Choose either TV Show (if the disc contains TV shows) or Movies (if disc contains movies). Choosing Ignore will ignore the disc and cancel the action. Note: no dialog will appear if you have set the action to "Run automatically".
Note: If DVD Player.app is set to launch when a Video DVD is mounted, set "Video DVD" to "Ignore" in the CD & DVDs Preference Pane.
- The action will launch Terminal and display the basic setup info. If you have any errors they will be presented here, such as missing apps or incorrect paths. It will also display the options you set in the action.

- The action will copy each disc to the selected TV or Movie output folder.
- For DVDs, FairMount will launch automatically, then you'll see a graphic of cream cheese being spread on a bagel.
- The DVD will unmount and re-mount as a disk image.
- After a short delay, the DVD will start copying.

- FairMount will display the progress as well as any bad sectors it encounters.
Note: Some DVD's may contain copy protection measures that will result in bad sectors and a failed rip using FairMount. For these situations, it may be necessary to rip the DVD with other software such as DVD2One where you can adjust the settings manually. - For BDs, makemkvcon will extract the titles in the background, but the Terminal window will display the progress.
- If you've set up growl support, you will be notified by display, speech or email when completed.

A Few Words on Source Folder and File Naming
Many applications use the file or folder name to get content info and cover art from sites like imdb.com, themoviedb.org and thetvdb.com. It is considered good practice to rename your files and folders, BEFORE encoding your final files. Your source files will then be named correctly making them easier to manage later. In addition, your output files will also be named correctly, allowing for a script or application to associate the correct metadata for your content.
For TV Shows the naming convention is: <Show Name - S#D#> or Veronica Mars - S1D1. The "D#" represents the disc number. If your using MakeMKV (which creates separate files for each episode), add -1, -2, etc. to the end of the filename. Example: Veronica Mars - S1D1-1.mkv. More information on tagging and renaming your final TV show files will be discussed in later chapter. Just make sure you name your source files according to the naming convention listed above.
For movies the naming convention is: <Movie Name (year)>. Example: X-Men Origins - Wolverine (2009). Note that titles that contain a colon [:] are replaced with a space and a dash [ -], as filenames cannot contain this character.
To make this process easier and more reliable for movies, I've provided an Automator Service that will search themoviedb.org database for the correct title and year, and automatically rename your movie file or folder. Just select the files or folders you want to rename and run the Service. A dialog box will appear, enter the movie title to search. Select the movie name and year that matches your content and the Service will then rename your item. The Service will loop through each item incrementally.
Additionally, there is a Rename & Tag Movie Items Service in the Workflow folder that will rename and tag selected items with iTunes metadata.
Note: themoviedb.org is a free online service. Periodic outages are not uncommon. If data is not returned, the service may be down.
Using the Rename Movie Items Service
- Select a movie file or folder, choose Services, and then choose > "Batch Rip • Rename Movie Items"

- A dialog box will appear listing the active item. Enter the movie name in the search field for this item and Choose OK.

- The action will search the themoviedb.org database and return a list of possible matches. Choose the movie title and year that matches your file or folder.

- Choose OK, and the action will rename your item to the selection. The action will repeat for each selected item.

Using Batch Encode to Automate HandBrake Encoding

This Automator Action incorporates many of the tasks commonly used for processing files and includes growl support. The input sources can be files or folders located in your "Batch Rip TV" and "Batch Rip Movies" folders, or direct disc access.
If the input source resides in your Batch Rip TV folder or its Spotlight comment is set to "TV Show" the script will select each track that's between the min/max duration set in the script. If the input source resides in your Batch Rip Movies folder, or its Spotlight comment is set to "Movie", only one track is selected, provided it's between the min/max duration you set in the script for movies. The encode script will then encode and output the selected titles to your Batch Encode folder.
For DVD sources, the input types supported are MKV, VIDEO_TS folder or DVD-VIDEO Disc. The default output setting is a "Universally" compatible m4v file.
Note: DVD disc input is only supported if the same 32-Bit or 64-Bit versions of VLC and HandBrake are installed.
For Blu-Ray sources, the input types supported are MKV, M2ts, BDMV folder or Blu-Ray Disc (MakeMKV supported discs only). The script will output up to four different output formats for BD sources. The default options are:
- Uncompressed MKV (from MakeMKV)
- 1080p h.264 MKV (for Plex)
- 720p h.264 m4v (for AppleTV)
- SD iPod compatible m4v
Note: The default encode settings include a sub-routine that will set the audio output settings differently depending on the audio source. The sub-routine favors DTS pass-thru for 1080p mkv, and AC-3 pass-thru for m4v. If AC-3 is not available, it will down-convert DTS to AAC for m4v files (since DTS is not an option in m4v files). The 720p Apple TV default will not include a secondary stereo aac track if 5.1 pass-thru is available.
If a 720p m4v file is encoded, the HD flag is set to allow the HD or HD/SD logo to appear in iTunes and the AppleTV. If an HD and SD m4v is created from the same source, they will both be set with the same cnid number. This is a number that is generated from a text file that will be created in your "Batch Scripts" folder and updated every time a new source is encoded. Having the same cnid number will allow the SD and HD versions show up as one entry in iTunes. Once a m4v file is encoded, movies are then optionally embedded with iTunes XML style metadata and cover art via theMovieDB.org API.
In addition, there are "Override" settings in the script to allow you to ignore the optical drive, only encode DVD sources, set the video kind for direct disc access and use tsMuxeR instead of MakeMKV for BD sources.
Note: MakeMKV has some caveats, there is no title duration information in the CLI output, so the min/max time in the Action will not function for BD sources. You can however set the minimum track time in the GUI preferences. The makemkvcon CLI will use that preference to weed out the shorter tracks. If you are using the eac3to script to get disc info as discussed in the Batch Rip workflow, the Action will use the eac3to info file to get the title duration. The Action will then be able to encode only the tracks between the min/max duration you set in the Action. See the section on using AnyDVDHD in the Batch Rip workflow for more info.
What you need to get started
To complete this tutorial you will need to download and install the following applications:
MANDATORY
HandBrakeCLI v0.9.4
HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded DVD to MPEG-4 converter, available for MacOS X, Linux and Windows. The Command Line Interface version of HandBrake is a lot faster and more flexible than the MacGui. Using scripting you can automate HandBrakeCLI to encode your files as a background process using the same parameters you'd set in the GUI. Install in /Applications.
Note: DVD disc input is only supported if the same 32-Bit or 64-Bit versions of VLC and HandBrake are installed.
How to Install HandBrakeCLI
- Download and open the HandBrakeCLI disk image.
- Next, drag the HandBrakeCLI application from the disk image to your applications folder.

VLC Media Player v1.0.3
VLC media player is a free, open source multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. VLC Media Player must be installed for FairMount and HandBrake to work with DVDs. Install in /Applications.
Note: At this time, Fairmount is only compatible with the 32-bit version of VLC. Do not install the 64-bit version if you are using Fairmount.
FOR BLU-RAY ENCODING ONLY:
MakeMKV v1.4.9
MakeMKV is the only mac native app for ripping Blu-ray discs. However, at this time it doesn't support BD+ encrypted discs and may not work with every disc or drive. It converts DVDs and BDs into a set of MKV files. MakeMKV has a GUI and a command-line (makemkvcon) interface that's located in the application's bundle. Install in /Applications.
Note: MakeMKV is not needed if you are only encoding DVD sources (not BD). MakeMKV is a free beta, for now…
OPTIONAL:
tsMuxeR v1.10.6 (Optional, use instead of MakeMKV for unencrypted BD volumes)
SmartLabs tsMuxeR is a software utility used to create TS and M2TS files from unencrypted Blu-Ray mpls and m2ts files. It will "mux" together branching titles, extract the core audio from the HD audio source. SmartLabs tsMuxeR is freeware. Install in /Applications.
Note: tsMuxeR is not required if MakeMKV is being used to mux files: at this time tsMuxeR is not compatible with Snow Leopard.
Creating your Batch Encode Service

- Launch Automator and open the "Batch Rip • Batch Encode.workflow" file located in ~/Library/Services.
- Set the options in the action panel.
- Select "Other…" from the HandBrakeCLI pull-down menus. Navigate and Select the HandBrakeCLI application. Click Choose.
- Select your Batch Rip TV and Batch Rip Movies folders from the Source pull-down menus
- Set the minimum and maximum duration for TV and Movies sources (HandBrake will only encode tracks between these min/max durations).
- Select your Batch Encode folder from the output pull-down menu.
- Select your Default video kind from the pull-down menu (the source will encoded based on this selection if there is no Spotlight comment or the source is located somewhere other than your Batch Rip TV or Batch Rip Movies folder (like an optical drive).
- Choose additional options:
- Run in the background (if enabled, the service will run as a background process with no Terminal output).
- Verbose logging (if enabled, HandBrake will display a verbose activity log for each encode).
- Encode HD Sources (if enabled, will encode BD-ROM, BDMV folders, mkv and m2ts sources).
- Add iTunes tags (if enabled, will automatically add iTunes style metadata and cover art to Movie files, TV Shows need to be done as a separate process).
- Growl when done (if enabled, will send a notification via Growl, see the Growl section in this tutorial for more info).
- tsMuxeR override (if enabled, will use tsMuxer instead of MakeMKV for BDMV sources. At this time, tsMuxeR is not Snow Leopard compatible).
- Encode Types (DVD is on by default, if Encode HD Sources is enabled):
- HD (SD): if enabled, will output a HandBrake Universal m4v file
- HD (720p): if enabled, will output a Apple TV 720p HD m4v file
- HD (1080p): if enabled, will output a 1080p HD h.264 mkv file (useful for Plex)
- HD (SD): if enabled, will output a HandBrake Universal m4v file
- Choose custom output settings for DVD and any of the HD output formats (Not recommended for new users).
- To enable a custom setting, check the Encode type check-box, then click the appropriate tab for the encode type to the right.
- Check the Use Custom Setting check-box and enter your HandBrakeCLI arguments in the text field below. See the HandBrakeCLI wiki for more info on setting your arguments.
- To enable a custom setting, check the Encode type check-box, then click the appropriate tab for the encode type to the right.
- To check for existing files in an existing movie library, Check the Move existing files check-box.
- Select your movie library folder from the pull-down menu.
- Select your retired folder from the retired folder pull-down menu. Existing movies with the same title will be moved to this folder.
- Select your movie library folder from the pull-down menu.
- Run in the background (if enabled, the service will run as a background process with no Terminal output).
- Choose Save As > Save Service as: Batch Rip • Batch Encode, replacing the existing file. Note: Services are saved in ~/Library/Services.
- You can also set up a keyboard shortcut to execute your workflow by selecting the Application Menu > Services > Services Preferences.
Using the Batch Encode Service
- Choose Application Menu > Services > "Batch Rip • Batch Encode" to run the service.
- Terminal will launch and display some basic setup info. If you have any errors they will be presented here, such as missing apps or incorrect paths. It will also display the options you set in the action.

- Terminal will display a list of the input sources found and detail the progress of each item/process.

Note: If “Run in background” is selected in the action, Terminal will not launch, the action will “run in background”. - If you've set up growl support, you will be notified by display, speech or email when completed.

Setting Batch Encode to Run Automatically with iCal
- Open Automator.
- Choose File > New, then select the iCal Alarm template and click Choose.
- Open your "Batch Rip • Batch Encode.workflow" in Automator.
- Drag the “Batch Encode” Action into your iCal Alarm workflow.

- Choose File > Save, enter a name for your iCal alarm, and then click Save. Note: iCal Alarms are saved in ~/Library/Workflows/Applications/iCal.
- iCal opens, automatically creates an event for your workflow, and displays the event editor. The alarm type is preset to run your workflow. By default the current time and date are in the “alarm” settings.
- Set the Start Time to the time you'd like your encodes to begin (ex. 12:00AM)
- Set the End Time to the Start Time + 1 minute (ex. 12:01AM)
- Set Repeat to "Every Day" (if you want it to run every day)
- Set End to "Never"
- Change the "on date" pop-up menu of the “alarm” setting to "0 minutes before" (double-click on the minutes number to change the minutes).
- When you are finished setting your alarm, click Done.

- Your workflow will now execute every day at the time specified.
- To deactivate and remove the alarm, choose None from the “alarm” pop-up menu.
Note: If you sync your iCal calendars with other Macs, you will get an error message if the script is not installed on the other machines. To fix this, you will need to select the calendar containing your Batch Encode Alarm on the other Macs and choose File > Get Info > and check the box next to "Ignore Alarms". If you use alarms on other events in the same calendar and do not wish them to be ignored, move the Encode Alarm to a new calendar and name it (ex. Automator) and ignore alarms only on the "Automator" calendar.
How to Automate TV Show File Tagging with iTunes Style Metadata
Rename & Tag TV Items Service
This Automator workflow will rename a set of m4v files with the following naming convention: (Show Name - S#D#-#.m4v) to (Show Name - S##E##.m4v), then tag each file with the appropriate cover art and iTunes metadata from thetvdb.org database.
IMPORTANT: Your files must be named with this naming convention BEFORE running this service: <Show Name - S#D#-#.m4v> or "Veronica Mars - S1D1-1.m4v". The "S##" signifies the season number, the "D#" represents the disc number. The "-#" is the episode sequence number for the disc and doesn't have to represent the episode number, just a number to keep them in numerical order.
If your are using the Batch Encode Action to encode your TV files, the action will automatically include the title number at the end of the name (example: Veronica Mars - S1D1-1). For DVDs the files will most likely already be in order with the disc number and title number, but this isn't always the case and is rarely the case with Blu-ray. In any case, you should always verify that all the episodes are present, any extras that may have been encoded are removed, and the files are in the correct order before renaming or tagging. Visit thetvdb.com to check your show and season to verify the number of episodes and check your files. Note, some discs may present two-part episodes as one title. In this case, these files should be processed in sets (example: if the season starts with a two-parter, process episode …E01. Process your next set with your number sequence starting at …E03, skipping …E02).
Thetvdb.com database has different options for episode ordering, Date Aired and DVD Order. Be sure to check the website to verify the correct order for your files. In most cases it will be DVD. However, some blu-ray discs have been released with a different sort order than the DVD versions. So, it’s good practice to check before renaming or tagging your files.
Using the Rename & Tag TV Items Service
- Visually check to make sure all the episodes have been encoded properly, in the right order and named properly.
- Select the sequence of files you want to rename and tag.
- Select the "Batch Rip • Rename & Tag TV Items" Service.

- The Service will launch and display the Make Finder Item Names Sequential action pane.

- If necessary, change the "Start Numbers at" text field if your episodes start at an episode number other than 1 (0 for Pilots). Other fields should be left alone.
- Choose Continue.
- The files will then be renamed and tagged.

Note: thetvdb.com is a free online service. Periodic outages are not uncommon. If data is not returned, the service may be down.
Add TV Tags Service
This Automator Service will search thetvdb.org database and add iTunes style metadata to a set of m4v files named with the following naming convention: <Show Name - S##E##> (ex. Veronica Mars - S01E02). The "S##" signifies the season number and the "E##" represents the episode number.

Creating the Add TV Tags Service
- Launch Automator and open the "Batch Rip • Add TV Tags.workflow" file located in ~/Library/Services.
- Choose action options:
- Add TV Tags (if enabled, will tag selected files)
- Replace original file (if enabled, will replace the original file with the new file)
- Remove Tags (if enabled, will remove existing tags if present)
- Sort Order: DVD or Date Aired (will add episode data based on the selected sort order. Check the thetvdb.com database to determine whether your files are ordered by Date Aired or DVD)
- Choose Save As > Save Service as: Batch Rip • Add TV Tags, replacing the existing file.
Using the Add TV Tags Service
- Visually check to verify that all the episodes have been named properly (ex. Veronica Mars - S01E02).
- Select the files you want to tag.
- Select the "Batch Rip • Add TV Tags" Service.
- Each file will then be tagged with the cover art and iTunes metadata for the show, season and episode.
How to Automate Movie File Tagging with iTunes Style Metadata
There are three services provided to add iTunes metadata and cover art using the Add Movie Tags Action:
- Batch Rip • Add Movie Tags (Search).workflow
- Batch Rip • Add Movie Tags (Filename).workflow
- Batch Rip • Rename & Tag Movie Items.workflow
These workflows all use the Add Movie Tags Action and operate differently on the settings used in the Service workflows. The workflows are designed to tag movie files that have already been encoded (the Batch Encode workflow has an option to tag files as they are processed). To use, just select the files you want to tag and run a service. The workflows will then tag each file with metadata from themoviedb.org database.
Using Batch Rip • Add Movie Tags (Search)
This service will display a list of possible matches from themoviedb.org database based on your search criteria. The service will then tag the file with metadata for the title selected.
- Select the files you want to tag.
- Right-Click and Select the "Batch Rip • Add Movie Tags (Search)" Service.
- A dialog box will appear listing the active item. Enter the movie name in the search field for this item and Choose OK.

- The action will search the themoviedb.org database and return a list of possible matches. Choose the movie title and year that matches your file.

- Choose OK, and the action will tag the file with metadata for the selected title. The action will repeat for each selected movie file.
Note: themoviedb.org is a free online service. Periodic outages are not uncommon. If data is not returned, the service may be down.
Using Batch Rip • Add Movie Tags (Filename)
This service will tag each file based on its filename with metadata from themoviedb.org database.
IMPORTANT: Your input files must be named properly with the following naming convention: Movie Name (year).m4v ( example: X-Men Origins - Wolverine (2009).m4v ). Titles that contain a colon [:] are replaced with a space and a dash [ -], as filenames cannot contain this character (see the section on file and folder renaming for more information). There is also a Rename & Tag Movie Items Service included in the Services menu if you also need to rename and tag your finished files.
- Visually check to verify that all the files have been named properly (ex. X-Men Origins - Wolverine (2009).m4v).
- Select the files you want to tag.
- Right-Click and Select the "Batch Rip • Add Movie Tags (Filename)" Service.

- Each file will then be tagged with the cover art and iTunes metadata for the movie.

Using Batch Rip • Rename & Tag Movie Items
This service works like Add Movie Tags (Search) but will rename the file after tagging. See the section on Using the Add Movie Tags (Search) Service for more information.
Changing options for Add Movie Tags Services
Each Service is designed to perform a certain function, however there are options available in the Add Movie Tags Action panel that you may want to tailor to fit your needs.

- Launch Automator and open the workflow file located in ~/Library/Services.
- Choose action options:
- Disable dialog and search using filename (if checked will auto-tag using the filename for the search criteria).
- Add tags (if enabled, will tag selected files)
- Replace existing file (if enabled, will replace the original file with the new file)
- Remove existing tags (if enabled, will remove existing tags if present)
- Rename file with title & year (if enabled, will rename the tagged file)
- Choose Save As, and replace the existing file. Note: Services are saved in ~/Library/Services.
Managing your Media with Hazel
Moving files around can be a chore, especially if you have an elaborate Mac media setup. Rather than going into each step in detail, I'll just touch on a few concepts that might peak some interest in how automation can help manage files on a multi-Mac setup.
The Batch Rip and Batch Encode workflow provide a few elements that will allow you to easily automate and organize your media. The key components are "Finder Label Index" (File/Folder Color) and "Spotlight Comments" (Finder Comments).
- The Batch Rip action will set the output files/folders Spotlight comment to the video kind set in the action.
- The Batch Encode action will take the source file's Spotlight comment and use it as the video kind, as well as derive it from the source file's location if the Batch Rip action was not used.
- After a source has been encoded, the Batch Encode action will change the Label color of the source file/folder to green and set the Spotlight comment of the resulting output file to the source's video kind.
We can use these elements to automate the file management process with a series of Folder Actions or with Noodlesoft's Hazel application.
Hazel http://www.noodlesoft.com is a preference pane that allows you to set up Rules based on a file's Spotlight data and specify actions to take when an item matches the Rules. This is similar to the way Smart Playlists function in iTunes and Smart Albums in iPhoto.

For example: If a file or folder located in our "Batch Rip TV" or "Batch Rip Movies" has a green Label color we can assume it has already been encoded since the Batch Encode Script will change its color to green after it has been encoded. We can set a rule in Hazel that will move any file/folder that's green to a "Backup" drive. One nice thing about Hazel is that it will move the source file to the target location, not just copy it. It has some intelligence and safeguards built in to know if a file has been moved successfully and then deletes the source file, freeing up more space on our Batch Rip volume.
We can also have Hazel monitor our Batch Encode folder for files that have the extension ".m4v", have a Spotlight comment set to Movie, and have a "Musical Genre" that is not Blank. The "Musical Genre" is the generic spotlight comment for "Genre" in iTunes. If a file has a genre, we can assume it has already been tagged with metadata so it should be considered a finished file. If all these criteria match, we can have Hazel then automatically move the file to our Movie library folder, then add the file to our local iTunes library, then change its color label to purple. You can even set up Hazel on a remote Mac to monitor the Movie folder via file sharing and add and movie file that's color label is purple and add it to its iTunes libraries as well, then change its color. You can repeat this with every Mac on your network to easily sync every added file. You can also duplicate this workflow for TV Shows as well keeping the files in separate folders and automatically creating subfolders based on the show name and season.

In addition to m4v files, we can have a similar Rule for our Batch Encode folder that looks for ".mkv" files with a Spotlight Comment of Movies or TV Shows and move them to a Plex depository on a local or network drive.
Hazel also allows for scripts to run when an item matches our rules. For example, with the "Move existing file to retired folder" option in the Batch Encode action enabled, you can have Hazel run an AppleScript that will remove the existing movie or TV show from iTunes when its file is added to the retired folder set in the action, helping to prevent duplicates in your library.
Hazel is a do-it-as-it-happens approach. The disc rips, the file encodes, the file is tagged, the source is backed up, the 1080p mkv is sent to a Plex folder, the m4v file is moved to my library, the file is then added to all my iTunes libraries and is sync'd to my Apple TV's. Simple and done.
The point is with a few triggers, you can easily automate the process of moving, organizing and syncing your media. I prefer Hazel for it's versatility and ease of use, but a lot of what Hazel provides can also be done with Folder Actions … but with a lot more work.
Conclusion
I hope you enjoyed this tutorial. If you've made it to the end, kudos to you. This process has been a great learning experience for me and hope it is for you as well. The elements of this workflow really demonstrate the power Mac OS X has with Unix, AppleScript, Automator and a brilliant developer community. Though this tutorial is a bit more involved than I had anticipated, I can attest that once you've got it going, you will spend less time managing your content and more time enjoying it. If you’d like to dig a little deeper, there are additional resources listed below. If you’re a power user and you’d like to customize and adapt the scripts used in these actions, the scripts are in the action bundles. Happy Encoding!
Additional Resources:
How To: Rip, Encode and Combine Using Fairmount & DTOX
Native Blu-ray ripping for OS X is finally here!
Blu-Ray to Apple TV
Advanced Bluray/HDDVD Workflow & Features Discussion
Subler (like Muxo, maybe better?)
Older automation thread
How-To: Automate DVD Backup w/ FairMount & HandBrake


