How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Tue Oct 20, 2009 4:19 am

Batch Rip Actions for Automator
How-to Automate DVD & Blu-Ray (Backup, Encoding & Tagging) for Mac OS X 10.9 Mavericks


Image


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, add iTunes metadata; 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 automated to remove the manual intervention required. Just insert a disc and it will rip automagically. 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 encode schedule, 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 iPad version, Android version, though you owe it to yourself to get an iPhone :), and an Apple TV 1080p version. All you need to do now is the tagging, but why should you do it? It's a computer after all … why not 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 stream em' to an Apple TV. Virtually anything is possible with automation.

This tutorial is broken up into components that can be used individually or together to create one, simple, automated batch workflow.


Workflow Components
  • Getting Started
  • Using Batch Rip to Automate DVD & Blu-Ray Backup
  • Renaming Source Files & Folders
  • Using Batch Encode to Automate HandBrake Encoding
  • Auto-tagging Movie Files with iTunes Metadata
  • Auto-tagging TV Show Files with iTunes Metadata
  • Using Hazel to manage your media

Note: This tutorial assumes you have some familiarity with Mac OS X 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.



About Batch Rip Actions for Automator

Batch Rip Actions for Automator is an application that provides Actions and Workflows to automate the rip and encode process.

Image

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 offering pre-compiled Automator actions and Service workflows would make this a much simpler process.

An Automator workflow consists of a sequence of discrete tasks called actions. An Automator action is a kind of functional building block. 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. Some actions like Batch Encode, go a step further and perform many operations in one process. For example, with each Blu-ray source it finds … it will create an mkv file, select the main video, audio, and subtitle tracks. Then, send them to HandBrake which will encode it to mp4, then download all the iTunes tags for your title and tag the file. Imagine doing this manually!

Batch Rip Actions for Automator 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. MakeMKV is still in beta and doesn't fully support BD+ titles and may not work with every disc or drive. If MakeMKV doesn't work for you manually, it's not gonna work with Batch Rip Actions for Automator.

Note: MakeMKV and HandBrake do not support every type of copy-protection and may not work with every disc or drive. The rule is, if it doesn't work for you manually, it's not gonna work with Batch Rip Actions for Automator.

If you encounter a disc that MakeMKV or HandBrake can't copy, I highly recommend trying AnyDVDHD. AnyDVDHD is developed by SlySoft.com and is considered the gold standard for disc 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.


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 tagged with metadata iTunes, AppleTV or other devices can manage.


The actions provided in this bundle include:

Batch Rip
This action copies video DVD and BD discs to a chosen folder correctly named for automatic tagging.

Batch Encode
This action encodes DVD/BD content to m4v/mkv and tags them with iTunes metadata. This action receives input from the Finder, other actions, or batch folders specified in the action panel. Input types: DVD-ROM, BD-ROM, VIDEO_TS, BDMV, m2ts, mkv, mp4, m4v, avi, mpg, and mov. Other options include: Growl notification, multiple encodes, and custom HandBrake settings.

Add TV Tags
This action searches thetvdb.com database and adds iTunes metadata for the specified TV episode mp4/m4v files. Other options include: renaming, removing tags and optimizing.

Add Movie Tags
This action searches themoviedb.org and tagchimp.com databases and adds iTunes metadata for the specified mp4/m4v files. Other options include: renaming files and folders, removing tags, optimizing, and managing chapter information.

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
This action displays the iTunes metadata for the input file.

Get Source Info from HandBrake
This action scans each source with HandBrakeCLI and saves the info to a text file.

Rename TV Items
This action searches thetvdb.com for shows matching the query and renames items to the selected search result and user specified series, season and episode or disc number.


This tutorial will focus on how to use these actions and their related Automator workflows. But before we get started, we need to install our applications and set up our batch folders.



Getting Started

To complete this tutorial you will need to download and install the following:
Batch Rip Actions for Automator v1.1.1


Installing Batch Rip Actions for Automator
  1. Download the Batch Rip Actions for Automator installer.
  2. Open the dmg file and Drag the app to your Applications folder.

    Image
  3. Navigate to your Applications folder.
  4. Double-click the icon to Launch the app.
  5. Follow the installation instructions to install the related workflow files and create your Batch Rip folders.

    Image


What you need to get started
Batch Rip Actions for Automator requires the following applications be installed in your Applications Folder. For convenience, I've provided links to these applications via the Download menu in the menu bar.

MANDATORY
FairMount v1.1
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 libdvdcss which is used for decryption - thus, libdvdcss must be installed for FairMount to work.
Note: Fairmount is included in the application bundle.

HandBrakeCLI v0.9.9
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 libdvdcss is installed.

libdvdcss v1.2.12
libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption. libdvdcss must be installed for Fairmount & HandBrake to work with encrypted DVDs. Run the installer and libdvdcss will be installed in your /usr/lib directory.

FOR BLU-RAY/HD ENCODING, YOU'LL NEED THE FOLLOWING:
MakeMKV v1.6.12
MakeMKV is the only mac native app for ripping Blu-ray discs. However, at this time it 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.



About Growl Support

Growl v1.3
Growl is a notification system for Mac OS X: it allows applications and scripts that support Growl to send you notifications.

Batch Rip and Batch Encode both contain Growl support. The GrowlNotify command-line tool is needed by these actions to notify the Growl application. GrowlNotify is available from the growl website's general downloads page: Growl's download page.

Image
  1. Download and install Growl from the Mac App Store.
  2. Download GrowlNotify
  3. Double-click the GrowlNotify.pkg to install GrowlNotify.
  4. Enter your administrator password and growlNotify will then be installed in a hidden directory used for command line tools: /usr/local/bin
  5. To activate notification by email or speech, navigate to the Growl Preferences and click enable in the GrowlNotify application notification settings.


Managing Your Batch Rip Files and Folders

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 action 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 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, and sorted in order.



Creating Your Batch Folders
If you chose to have the installer create your Batch Folders during the workflow installation process, they will be located in your ~/Movies directory. If not, follow the steps below to create your Batch Folders:
  1. Navigate to your ~/Movies folder.
  2. 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.
  3. Create another folder named Batch Encode. This folder will be the destination folder for your final encoded m4v/mkv files when using the Batch Encode action.

    Image


Using the Workflow Editor
Batch Rip Actions for Automator includes a series of Automator "Service" workflow files pre-built to work with the actions.

Image

The Actions contained in a workflow can have fields, pop-up menus, checkboxes, and other user-interface elements for configuring the action. Batch Rip Actions for Automator features a Workflow Editor to help you quickly edit and save your workflow options.

To edit a workflow:
  1. Choose a workflow from the source list on the left side of the Workflow Editor.
  2. The workflow will open in the layout view on the right side of the window.
  3. Configure the action as desired.
  4. To save your changes, Open the File menu and Choose Save.


Using Batch Rip Service Workflows
A Service is a special type of Automator workflow that can be used from another application or the Finder via contextual menus throughout the OS. Some services require input such as movie files. These types of services can be context sensitive, and only appear in the correct application or if the correct type of input is selected.

In this tutorial, there are two ways we run Services:
  1. Open the application menu (to the right of the Apple menu), choose Services, and then choose the service you want to use.
  2. Open a contextual menu by Control-clicking on an item (or a group of items), choose Services, and then choose the service you want to use.


Using Batch Rip to Automate DVD/BD Ripping

Image

Batch Rip uses several technologies to automate the ripping process. For DVDs, FairMount and libdvdcss (installed separately) are used to decrypt the 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, option to search for show/movie titles for the copy, and an option to eject the discs when finished.

For Blu-Ray, the process is essentially the same, except we use MakeMKV which extracts each title that's between the min/max duration you set in the action. The action also includes an option to do a full BD backup. BD discs are processed sequentially.



Using the Batch Rip Services
There are two Automator Services that can be used with the Batch Rip action.

Batch Rip • Batch Rip.workflow
This service receives no input and will act on all mounted video discs. If a BD-ROM or DVD-ROM is mounted, this Service displays a prompt that will cancel after 30 seconds, if no action is received from the user. The prompt will ask if you'd like to copy the disc. Choosing Movie or TV Show will set the video kind for that disc; and repeat for each disc mounted. The action will then copy each disc to your Batch Rip TV or Batch Rip Movies folder. There is also an option to search and select the correct "title" for your source disc which will help for auto-tagging later. You can also set the action to run automatically which disables the dialogs and uses the default video kind set in the action panel.

To use it: Open the application menu (to the right of the Apple menu), choose Services > "Batch Rip • Batch Rip".

Batch Rip • Batch Rip (Finder).workflow
This Service will act only on items passed as input via the Finder, another Action, or a script.

To use it via the Finder: Select the discs you'd like to copy and run the service. Only the selected items will be processed.

To use it via another script: Pipe the input folders as a list with each source on its own line. Here's an example:

Code: Select all

echo -e "/Volumes/IRON_MAN_D1\n/Volumes/DVD_VIDEO" | automator -i - "/Users/username/Library/Services/Batch Rip • Batch Rip (Finder).workflow"


Customizing your Batch Rip Workflow

Image
  1. In the Workflow Editor, Select the "Batch Rip • Batch Rip" workflow.
  2. Set the options in the action panel.
  3. Run Automatically (disables dialog boxes and runs without user intervention). Not recommended for new users.
  4. BD-ROM & DVD-ROM check-boxes (the workflow will act only on the disc types selected).
  5. Default video kind (when Run Automatically is set, this selection will copy all discs to either Batch Rip Movies or TV Folder).
  6. 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).
  7. Search for show/movie titles will add an additional prompt to search themoviedb/thetvdb for the correct title and release year. Your copy will be named with the selected search result. This is useful for auto-tagging with the Batch Encode action.
  8. The path to the Fairmount application include in the app bundle is already set. Note: libdvdcss is required in order for Fairmount to run.
  9. Set the time in seconds for the action to skip processing a disc if Fairmount fails to remount it as a disk image (default is 120 secs).
  10. Set the path to the MakeMKV application.
  11. Set your output directories (see section on Folder Setup for more info).
  12. Set the minimum and maximum duration for TV and Movies sources (MakeMKV will only extract tracks between these min/max durations).
  13. Choose additional options: Enable Growl, Eject disc when done, Use MakeMKV for DVD (instead of Fairmount), Full BD Backup.
  14. To save your changes, Open the File menu and Choose Save.


Using Batch Rip Dispatcher
Batch Rip Dispatcher is a LaunchAgent that monitors your /Volumes directory for BD-ROM or DVD-ROM discs. It will automatically activate the "Batch Rip • Batch Rip (Finder).workflow" when a disc is detected. To control Batch Rip Dispatcher, Click the status display in the Workflow Editor toolbar to turn it On or Off.
  1. When activated (Green), Batch Rip Dispatcher will start watching for discs. It will then launch "Batch Rip • Batch Rip.workflow" whenever a BD-ROM or DVD-ROM is mounted.
    -
    Image
    -
  2. When disabled (Clear), Batch Rip Dispatcher will deactivate and no action will be taken when a disc is inserted.
    -
    Image
    -
  3. You can enable or disable Batch Rip Dispatcher at any time by clicking the status display in the Workflow Editor toolbar.


Testing your Batch Rip Workflow
  1. Make sure Batch Rip Dispatcher's status indicator is Green, indicating that it's enabled.
  2. Insert a BD or DVD. Wait for the disc to mount.
  3. If you have more than one optical drive, a prompt will appear asking if you'd like to Continue. Click Continue when all discs are mounted.
  4. Next, a 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".
  5. If "Search for Show/Movie Titles" is enabled, you'll get additional prompts to name each disc.

    IMPORTANT: 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.
    -
    Image
    -
  6. 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.

    Image
  7. The action will copy each disc to the selected TV or Movie output folder.
  8. For DVDs, FairMount will launch automatically, then you'll see a graphic of cream cheese being spread on a bagel.
  9. The DVD will unmount and re-mount as a disk image.
  10. After a short delay, the DVD will start copying.
    -
    Image
    -
  11. 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.
  12. For BDs, makemkvcon will extract the titles in the background, but the Terminal window will display the progress.
  13. If you've set up growl support, you will be notified by display, speech or email when completed.
    -
    Image
-



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 tagchimp.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 Show sources 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), it will 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.

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, I've provided Automator Services that will search themoviedb.org or thetvdb.com for the correct Movie or Show Title, and automatically rename your file or folder. Just select the files or folders you want to rename and run the Service. A dialog box will appear, enter the title to search. Select the name and year that matches your content and the Service will then rename your item. The Service will loop through each item incrementally. This process has also been added as an option to Batch Rip.action which will prompt a search before copying the discs.

Additionally, there are Rename & Tag Services provided for both TV and Movies; that will rename and tag selected items with iTunes metadata.

Note: themoviedb.org and thetvdb.com are free online services. Periodic outages are not uncommon. If data is not returned, the service may be down.



Using the "Rename Movie Items" and "Rename TV Items" services
  1. Select a movie file or folder, choose Services, and then choose > "Batch Rip • Rename Movie Items" - or - "Batch Rip • Rename TV Items"
    -
    Image
    -
  2. A dialog box will appear listing the active item. Enter the title in the search field for this item and Choose OK.
    -
    Image
    -
  3. The action will search the database and return a list of possible matches. Choose the title and year that matches your file or folder.
    -
    Image
    -
  4. Choose OK, and the action will rename your item to the selection. The action will repeat for each selected item.
    -
    Image
-



Using Batch Encode to Automate HandBrake Encoding

Image

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 optical discs mounted on your system.

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.

The input types supported: Blu-Ray Disc, BDMV, DVD-VIDEO Disc, VIDEO_TS, avi, mp4, m4v, mkv, m2ts, mov and mpg.

The output types supported: m4v (mp4) and mkv.

Encode Targets: The action will output up to four encoded files for each source. Each encode target will be processed using its selected preset.

Presets: Different encode settings can be selected for each encode target. All preset encode settings are based on HandBrake's presets for compatibility with Apple devices.

Custom Presets: You can create up to four custom presets using standard HandBrakeCLI arguments. A custom preset can be selected for each encode target.

Audio Selection: Batch Encode will set the default audio track using the option selected in the workflow. "Default Audio" sets the default audio track to the source's "default" audio track. If set to "Native Language", Batch Encode will select an audio track (if available) that matches the native language preference set in the workflow. If an audio track is not available in your native language, it will try to find one that matches the alternate language preference set in the workflow. If neither are available, it will fallback to the title's default audio track.

Additional Audio Tracks: Batch Encode will include additional audio tracks if selected in the workflow. Options include: all Native Language tracks, all Alternate Language tracks, all Native & Alternate language tracks, and All Tracks (regardless of language). There is also an option to mixdown these additional tracks to 2-channel DPL2 for a smaller file size. If disabled, any selected multi-channel tracks will be passed-through as AC3.

Subtitle Selection: There are two basic options for subtitles, Burn-In and Pass-Thru. Burned in subtitles are written on top of the image permanently. Pass-thru subtitles will appear as separate selectable tracks in your output file. With the correct playback software, you’ll be able to enable / disable these subtitles as required. The Burn-In "Auto Detect" option will burn in forced-only subtitles (if available) in your native language; or all subtitles, if the default audio track language is not in the native language set in the action. Burn-In "Native Language" will burn in subtitles in your native language (if available) regardless of the default audio track language. The Pass-Thru option will pass-thru "text-based" subtitle tracks that match the language preference set in the action. Due to mp4 file limititations and HandBrake capabilities, picture-based subtitles cannot be passed-through. They can however be burned-in, but only 1 track can be burned-in to the video. See the HandBrake wiki for more info.

Multi-Channel Audio: The Batch Encode action includes a sub-routine that will set the audio output settings differently depending on the audio source and encoding preset selected. If an HB preset has multi-channel capability, the sub-routine will favor multi-channel audio (DTS or AC-3) over 2-channel tracks. If the audio codec is DTS, HandBrake will convert DTS to AC-3 since DTS pass-thru is not an option for most devices. All multi-channel tracks will also include a secondary stereo aac track for compatability. Presets that do not natively support multi-channel include: iPod, iPad, iPhone and Android devices.

iTunes Tagging: Once a m4v file is encoded, movies are then optionally embedded with iTunes XML style metadata, cover art and chapter names via theMovieDB.org and tagchimp.com API's. If a 720p or higher 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. Having the same cnid number will allow the SD and HD versions to show up as one entry in iTunes.

Other Options: There are "Override" settings in the script to allow you to ignore the optical drive and set the video kind for optical sources.



Batch Encode Services
There are two Automator Services provided to use with Batch Encode.

Batch Rip • Batch Encode.workflow
This service receives no input and will act on all files or folders located in your "Batch Rip TV" and "Batch Rip Movies" folders, or optical discs mounted on your system (if Ignore Optical is not selected).

To use it: Open the application menu (to the right of the Apple menu), choose Services > "Batch Rip • Batch Encode".

Batch Rip • Batch Encode (Finder).workflow
This Service will act only on items passed as input via the Finder, another Action, or a script.

To use it via the Finder: Select the files, folders or discs you'd like to encode and run the service. Only the selected items will be processed.

To use it via another script: Pipe the input files or folders as a list with each source on its own line. Here's an example:

Code: Select all

echo -e "/Users/username/Movies/Batch Rip Movies/Toy Story (1995)\n/Users/username/Movies/Batch Rip TV/The Office (US) - S1D1" | automator -i - "/Users/username/Library/Services/Batch Rip • Batch Encode (Finder).workflow"


Customizing your Batch Encode Workflow

Image
  1. In the Workflow Editor, Select the "Batch Rip • Batch Encode" workflow.
  2. Set the options in the action panel.
  3. Select "Other…" from the HandBrakeCLI pull-down menus. Navigate and Select the HandBrakeCLI application. Click Choose.
  4. Select "Other…" from the MakeMKV pull-down menus. Navigate and Select the MakeMKV application. Click Choose.
  5. Select your Batch Rip TV and Batch Rip Movies folders from the Source pull-down menus
  6. Set the minimum and maximum duration for TV and Movies sources (HandBrake will only encode tracks between these min/max durations).
  7. Select your Batch Encode folder from the output pull-down menu.
  8. Select your Default video kind from the pull-down menu (the source will be 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).
  9. Enter your Native Language as a 3-character ISO-639-2 code. This setting will be used to select the audio and subtitle tracks based on your language preference.
  10. Enter your Alternate Language as a 3-character ISO-639-2 code. This setting will be used to select the audio and subtitle tracks based on your secondary language preference. (optional)
  11. Choose Default Audio Preference:
    • Default Audio: sets the default audio track to the source's "default" audio track. Useful for films where the main audio differs from your native language. Like if the main audio is Japanese and you want English subtitles.
    • Native Language: selects an audio track (if available) that matches the native language preference set in the workflow. If an audio track is not available in your native language, it will try to find one that matches the alternate language preference set in the workflow. If neither are available, it will fallback to the title's default audio track.
  12. Choose Additional Audio Tracks:
    Batch Encode will include additional audio tracks if selected.
    • Native Language: Selects all audio tracks in your native language.
    • Alternate Language: Selects all audio tracks in your alternate language.
    • Native & Alternate: Selects all audio tracks in your native and alternate language.
    • All Tracks: Selects all audio tracks audio available regardless of language.
    • Mixdown: Will mixdown additional tracks to 2-channel DPL2 for a smaller file size. If disabled, any selected multi-channel tracks will be passed-through as AC3.
  13. Choose Burn-in Subtitle Track Option:
    The Burn-in option will burn-in subtitle tracks that match the language preference set in the action. Burned in subtitles are written on top of the image permanently.
    • None: Will not burn any subtitle track.
    • Auto Detect: Burns in forced-only subtitles (if available) in your native language for short foreign language segments. Additionally, if the default audio track language is different from your native language, will burn in subtitles in your native language (if available).
    • Forced Only (Native): Burns in forced-only subtitles (if available) in your native language.
    • Native Language: Burns in subtitles in your native language (if available) regardless of the default audio track language.
    Note: Only 1 subtitle track can be burned-in to the video. Additonal text-based subtitles can be passed-through. See the HandBrake wiki for more info.
  14. Choose Pass-thru Subtitle Tracks:
    The Pass-Thru option will pass-thru "text-based" subtitle tracks that match the language preference set in the action.
    • Native Language: Selects all audio tracks in your native language.
    • Alternate Language: Selects all audio tracks in your alternate language.
    • Native & Alternate: Selects all audio tracks in your native and alternate language.
    • All Tracks: Selects all audio tracks audio available regardless of language.
    Note: Due to mp4 file limititations and HandBrake capabilities, picture-based subtitles cannot be passed-through. They can however be burned-in, but only 1 track can be burned-in to the video. See the HandBrake wiki for more info.
  15. 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, will display a verbose activity log for each encode).
    • Add iTunes tags (if enabled, will automatically add iTunes style metadata, cover art and chapter titles 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).
    • Encode Targets:
      • Encode 1: This item is on by default, will output a file using the selected preset. Use for your main encoded file.
      • Encode 2: If enabled, will output a second file using the selected preset. Use for your secondary encode.
      • Encode 3: If enabled, will output a third file using the selected preset.
      • Encode 4: If enabled, will output a fourth file using the selected preset.
    • Presets:
      • Choose a device or custom preset for each Encode Target enabled. For device presets, Handbrake will use it's built-in settings to encode a compatible m4v file based on the capabilities of the chosen device.
      • Note: Encode 1 includes a unique preset called MakeMKV that will create an MKV file from optical and folder sources using MakeMKV. The resulting MKV file will be used as the source for Encode Targets 2-4. Useful if you'd like an uncompressed MKV file that includes all audio and subtitle tracks.
    • Custom Presets:
      • Enter custom encode settings for each Encode Target (Not recommended for new users).
      • To enable a custom preset: Select a custom preset for your encode target.
      • To enter a custom preset: Select a custom preset tab and enter your HandBrakeCLI arguments in the text field.
      • Batch Encode allows the use of two variables to auto-select the audio and subtitle settings:
        • To allow Batch Encode to auto select the audio settings use: \$audioSearch
        • To allow Batch Encode to auto select the subtitle settings use: \$subtitleSearch
        • Example:

          Code: Select all

          -e x264 -q 21.0 \$audioSearch -f mp4 -X 480 \$subtitleSearch -m -x b-adapt=2:rc-lookahead=50
      • See the HandBrakeCLI wiki for more info on setting your arguments.
    • 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.
  16. Choose Save from the File menu, to save your changes.
  17. You can also set up a keyboard shortcut to execute your workflow by selecting the Application Menu > Services > Services Preferences.


Testing your Batch Encode Workflow
  1. Choose Application Menu > Services > "Batch Rip • Batch Encode" to run the service.
  2. 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.
    -
    Image
    -
  3. Terminal will display a list of the input sources found and detail the progress of each item/process.
    -
    Image
    -
    Note: If “Run in background” is selected in the action, Terminal will not launch, the action will “run in background”.
    -
  4. If you've set up growl support, you will be notified by display, speech or email when completed.
    -
    Image
-



Setting Batch Encode to Run Automatically
  1. In the Workflow Editor toolbar, click the timer icon to open event panel.
    -
    Image
    .
  2. Set the time you'd like your encodes to begin (ex. 12:00AM)
  3. Click "Click to activate", to create the schedule.
    • When activated (Green), the Batch Encode service will execute daily at the time specified.
  1. You can enable or disable this service at any time by clicking the status display in the event panel..
  2. To deactivate, click the timer icon to open event panel and Click "Click to deactivate"
    • When disabled (Clear), the schedule will be removed.
  3. To change the time, deactivate and repeat the steps above to create a new Batch Encode schedule.


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.



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.
  1. Select the files you want to tag.
  2. Right-Click and Select the "Batch Rip • Add Movie Tags (Search)" Service.
  3. A dialog box will appear listing the active item. Enter the movie name in the search field for this item and Choose OK.
    -
    Image
    -
  4. 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.
    -
    Image
    -
  5. 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.
  1. Visually check to verify that all the files have been named properly (ex. X-Men Origins - Wolverine (2009).m4v).
  2. Select the files you want to tag.
  3. Right-Click and Select the "Batch Rip • Add Movie Tags (Filename)" Service.
    -
    Image
    -
  4. Each file will then be tagged with the cover art and iTunes metadata for the movie.
    -
    Image
-



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.
Image
  1. In the Workflow Editor, Select a "Batch Rip • Add Movie Tags" workflow.
  2. 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)
    • Backup original file (if enabled, will make a backup copy of the input file before tagging)
    • Remove existing tags (if enabled, will remove existing tags if present)
    • Optimize file after tagging (interleaves audio and video, and restores QuickTime's "fast-start" ability, takes longer to tag)
    • Rename file with title & year (if enabled, will rename the tagged file)
  3. Choose Save from the File menu, to save your changes.


How to Automate TV Show File Tagging with iTunes Style Metadata

There are three services provided to add iTunes metadata and cover art using the Add TV Tags Action:
  • Batch Rip • Add TV Tags (Search).workflow
  • Batch Rip • Add TV Tags (Filename).workflow
  • Batch Rip • Rename & Tag TV Items.workflow
These workflows all use the Add TV Tags Action and operate differently on the settings used in the Service workflows. To use, just select the files you want to tag and run a service. The workflows will then tag each file with metadata from thetvdb.com database.



Using Batch Rip • Add TV Tags (Search)
This service will display a list of possible matches from thetvdb.com database based on your search criteria, then tag the files with the cover art and iTunes metadata for the show, season and episode.
  1. Select the files you want to tag.
  2. Right-Click and Select the "Batch Rip • Add TV Tags (Search)" Service.
  3. Enter the show title in the search field for this item and Choose OK.
  4. The action will search the thetvdb.com database and return a list of possible matches. Choose the series title and date first-aired that matches your file and Click OK.
  5. Enter the Season and Episode Number for the file.
  6. Choose OK, and the action will tag the file with metadata for the selected episode. The action will repeat for each selected episode file.


Using Batch Rip • Add TV Tags (Filename)
This service will tag each file based on its filename with metadata from thetvdb.com database.

IMPORTANT: Your input files must be named properly with the following naming convention: <Show Name - S##E##> (ex. Veronica Mars - S01E02.m4v). The "S##" signifies the season number and the "E##" represents the episode number. There is also a Rename & Tag TV Items Service included in the Services menu if you also need to rename and tag your finished files.
  1. Visually check to verify that all the files have been named properly (ex. Veronica Mars - S01E02.m4v).
  2. Select the files you want to tag.
  3. Right-Click and Select the "Batch Rip • Add TV Tags (Filename)" Service.
  4. Each file will then be tagged with the cover art and iTunes metadata for the show, season and episode.


Rename & Tag TV Items Service
This service works like Add TV Tags (Search) but will rename the file before tagging. See the section on Using the Add TV Tags (Search) Service for more information. The files will be renamed with the following naming convention: <Show Name - S##E##> (ex. Veronica Mars - S01E02.m4v). If multiple files are selected, the service will rename each file with the same show title and season number. The episode number will be assigned sequentially, starting with the episode number you specify when prompted.

IMPORTANT: If you are batch renaming files, they must be pruned and in episodic order BEFORE running this service: I recommend appending each file name with a number. This number does not 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). The files will most likely already be in order with the disc number and title number, but this isn't always the 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 running this service. Visit thetvdb.com to check your show and season to verify the number of episodes and check your files.

Note, that 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).

IMPORTANT: 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 and select the appropriate "Sort Order" option in your workflow.



Using the Rename & Tag TV Items Service
  1. Visually check to make sure all the episodes have been encoded properly and in the right order.
  2. Select the sequence of files you want to rename and tag.
    -
    Image
    -
  3. Select the "Batch Rip • Rename & Tag TV Items" Service.
    -
    Image
    -
  4. A dialog box will appear listing the first item. Enter the Show Title in the search field and Choose OK.
    -
    Image
    -
  5. The action will search the thetvdb.com database and return a list of possible matches. Choose the Show Title that matches your files.
    -
    Image
    -
  6. Enter the Season number and episode start number in the text field and Choose OK.
    -
    Image

    Note: Some seasons may start at an episode number other than 1 (0 for Pilots). If you're unsure, visit thetvdb.com to verify the episodes for your show and season.
    -
  7. The files will then be renamed in sequential order and tagged based on their new file name.
    -
    Image
    -
    Note: thetvdb.com is a free online service. Periodic outages are not uncommon. If data is not returned, the service may be down.


Customizing your Add TV Tags Services
Each Service is designed to perform a certain function, however there are options available in the Add TV Tags Action panel that you may want to tailor to fit your needs.
-
Image
  1. In the Workflow Editor, Select a "Batch Rip • Add TV Tags" workflow.
  2. Choose action options:
    • Disable dialog and search using filename (if checked will auto-tag using the filename for the search criteria).
      IMPORTANT: Choosing this option requires the files be 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.
    • Add TV Tags (if enabled, will tag selected files)
    • Backup original file (if enabled, will make a backup copy of the input file before tagging)
    • Remove Existing Tags (if enabled, will remove existing tags if present)
    • Optimize file after tagging (interleaves audio and video, and restores QuickTime's "fast-start" ability, takes longer to tag)
    • Rename file (if enabled, will rename the tagged file to: Show Name - S##E##)
    • 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)
  3. Choose Save from the File menu, to save your changes.


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).

Spotlight Comments used in Batch Rip Actions for Automator:
  1. The Batch Rip action will set the output files/folders Spotlight comment to the video kind set in the action.
  2. 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.
  3. After a source has been encoded, the Batch Encode action will set the Spotlight comment of the resulting output file to the source's video kind.
Finder Labels used in Batch Rip Actions for Automator:
  • Batch Rip
    1. Changes the Finder Color Labels of the disc folders to Yellow if copied successfully.
    2. Red if the Action encounters an error. Useful for Hazel or other scripting apps.
  • Batch Encode
    1. Source folders change to Green while processing; Red if the Action encounters an error; Gray if it's done.
    2. Output files (m4v or mkv) change to Green if they're done, and Red if the action sees an error with the file.
    3. Output files (m4v) change to Orange if:
      • Tmdb couldn't find any metadata for the movie (also changes the source folder to orange)
      • Cover art failed integrity test (also changes the source folder to orange)
      • Tagchimp couldn't find chapter names
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.

Image

For example: If a file or folder located in our "Batch Rip TV" or "Batch Rip Movies" has a gray Label color we can assume it has already been encoded since the Batch Encode Script will change its color to gray after it has been encoded. We can set a rule in Hazel that will move any file/folder that's gray 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 "Finder Label" that is green. If a file has a green label, 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.

Image

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. Happy Encoding!

Additional Resources:
Batch Rip Help: In the app under the Help menu or via Mac's Help Center.
How To: Rip, Encode and Combine Using Fairmount & DTOX
Native Blu-ray ripping for OS X
Blu-Ray to Apple TV
Advanced Bluray/HDDVD Workflow & Features
Subler

Older automation thread
How-To: Automate DVD Backup w/ FairMount & HandBrake
Last edited by mac.jedi on Tue Dec 03, 2013 7:04 pm, edited 24 times in total.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Release Notes

Post by mac.jedi » Tue Oct 20, 2009 4:20 am

ANNOUNCEMENT: BATCH RIP ACTIONS UPDATED

Update 2011-07-31

Release Notes
Batch Rip Actions for Automator 1.0.7

Everything
  • Compatible with Mac OS X Lion 10.7
  • Provides general fixes that enhance the stability, compatibility and functionality of Batch Rip Actions for Automator
Batch Rip.action - UPDATED
  • Improved compatibility with MakeMKV v1.6.12 and Mkvtoolnix v4.9.1.
Batch Encode.action - UPDATED
  • Improved compatibility with MakeMKV v1.6.12 and Mkvtoolnix v4.9.1.
_______________________________________________________________________________________________


Update 2010-12-20

Release Notes
Batch Rip Actions for Automator 1.0.6

Everything
  • Provides general fixes that enhance the stability, compatibility and functionality of Batch Rip Actions for Automator.
Batch Rip.action - UPDATED
  • Improved compatibility with MakeMKV.
  • Removed the built-in delay for multiple optical drives. This functionality has been moved to Batch Rip Dispatcher.
  • Added a timeout setting which allows the Action to skip a disc if Fairmount has trouble reading its content.
  • Updated the Sanity Check feature to provide additional feedback if setup isn't configured properly … with any luck you won't even see it.
  • EXPERIMENTAL: Added support for MakeMKV's full BD backup feature which copies the entire Blu-ray disc structure. May not work with certain discs or drives.
  • Changes the Finder Color Labels of the disc folders to Yellow if copied successfully; Red if the Action encounters an error. Useful for Hazel or other scripting apps.
  • Added "Search for Title" feature which allows for searching themoviedb.org or thetvdb.com for the correct titles of your source discs. Copies will be named with the titles selected. Useful for automatically adding iTunes tags later.

Batch Encode.action - UPDATED
  • Added secondary encode option for DVD/SD sources. Two encode types are now available for both HD and SD sources.
  • Added support for HandBrake's Device Presets. Encode settings can now be selected for compatibility with Apple devices.
  • Added support for direct "input" to encode the given source(s). You can use the Service "Batch Rip • Batch Encode (Finder)" to pass sources to this action. You can also select items in the Finder and run the Service on the selected items. See the Batch Encode (Finder) Service below for more info.
  • Updated the Sanity Check feature to provide additional feedback if setup isn't configured properly … with any luck you won't even see it.
  • Added additional feedback on title duration. Provides a list of titles/durations if scan failed to find a title within the min/max duration set in the Action.
  • Added a notification if the Action failed to scan the source for title info.
  • Changed the way cnID numbers are allocated. cnID's are now generated by a random number calculation, rather than sequentially.
  • Added option to keep MakeMKV temp files. These files contain all the original audio and subtitle tracks. Warning: You could run outta disk space pretty fast.
  • Added additional support for Finder Color Labels. Source folders change to Green while processing; Red if the Action encounters an error; Gray if it's done. Output files (m4v or mkv) change to Green if they're done, and Red if the action sees an error with the file. Useful for Hazel or other scripting apps.
  • Updated the Verbose mode to provide additional information during processing.
  • Added Content Ratings, Long Description and Chapter Title support to the Add iTunes Tags feature.
  • Changed the way MakeMKV accesses optical drives while processing.
  • Added a "File Integrity Test" to verify that MKV and MP4 output files are valid. Provides notification if files fail verification.
  • Added a test to check available disk space on destination volume. Provides notification if drive has less capacity than the source. The action will skip sources that exceed capacity.
Batch Rip Dispatcher - UPDATED
  • Changed the way Batch Rip Dispatcher sends source input to the Batch Rip Action.
  • Added a dialog visible when multiple optical drives are present. Prompts the user to launch while waiting for additional discs to mount. This feature can be disabled by using the auto-run option in the Batch Rip Service.
  • Improved the Reset and Enable functions. Reset now clears all existing discs from its record. Clicking Enable now immediately scans for mounted discs and sends them as input to Batch Rip.
Add Movie Tags - UPDATED
  • Added feature to preserve/set the cnid tag of the movie files.
  • Added support for adding Chapter Titles from tagchimp.
  • Original files are now moved to the Trash, rather than kept in its original location as a duplicate. Note: The "Replace existing file" option remains unchanged.
Add TV Tags - UPDATED
  • Added feature to preserve/set the cnid tag of the movie files.
  • Original files are now moved to the Trash, rather than kept in its original location as a duplicate. Note: The "Replace existing file" option remains unchanged.
Rename TV Source Folders - NEW ACTION
  • This action searches thetvdb.com for shows matching the query and renames items to the selected search result and user specified season and disc number.
NEW SERVICES

Batch Rip • Add Chapter Names (Custom)
  • This service has two functions: 1) Will export an editable chapter text file with timecodes and title placeholders from the selected file. 2) When run again, will import and add chapter titles from a text file named "thefilename.chapters.txt" located in the same directory as the movie file.
Batch Rip • Add Chapter Names (Filename)
  • This service will search tagChimp for chapter titles matching the movie file's filename and add them to the file.
Batch Rip • Add Chapter Names (Search)
  • This service will search tagChimp for titles matching a search query and return matching titles. If chapters are found for the selected title, they will be added to the movie file.
Batch Rip • Add cnID to Selected (Same).workflow
  • This service add the same cnID number to selected movie files. Useful for SD/HD encodes.
Batch Rip • Add cnID to Selected (Unique).workflow
  • This service add a unique cnID number to each selected movie files.
Batch Rip • Add HD Flag.workflow
  • This service enables the HD flag in iTunes for HD encoded movie files.
Batch Rip • Rename TV Source Folders.workflow
  • This service searches thetvdb.com for shows matching the query and renames the selected items to the search results and user specified season and disc numbers.
Batch Rip • Rename & Add Custom Title Tag.workflow
  • This service allows you to enter a custom title for your movie file. The service will rename the file and add the title as iTunes metadata to the file.
Batch Rip • Batch Encode (Finder).workflow
  • This service will encode the selected source files with the Batch Encode action. Accepts input from Hazel or other scripts. You can also select items in the Finder and run the Service on the selected items.
  • To run the workflow from Terminal or from a script you'll need to use the following commands to input files to the "automator" command line tool. Here's an example of how to process a single source:

    Code: Select all

    automator -i "/Users/username/Movies/The Office (US) - S1D1" "/Users/username/Library/Services/Batch Rip • Batch Encode (Finder).workflow"
  • To input multiple files, you'll need to pipe the input files as a list with each source on its own line. Here's an example:

    Code: Select all

    echo -e "/Users/username/Movies/The Office (US) - S1D1\n/Users/username/Movies/The Office (US) - S1D2" | automator -i - "/Users/username/Library/Services/Batch Rip • Batch Encode (Finder).workflow"
    The important thing to note is that the sources are quoted in one string. The echo command is given the option "-e" and between each source path is the command "\n", which is a newline character. The automator tool's input command "-i" is given the " - " as input, which means it will use the standard input piped into it as input to the workflow.
_______________________________________________________________________________________________


Update 2010-11-23

Release Notes
Batch Rip Actions for Automator 1.0.5

Everything
  • Mkvtoolnix is no longer included in the package. You'll need to install Mkvtoolnix.app to your Applications folder. You can download version 4.4.0 from: http://jonthn.free.fr/MKVtoolnix/
Batch Rip.action - UPDATED
  • • Provides general fixes that enhance the stability, compatibility and functionality of Batch Rip … in other words, I forgot to write them all down.
    • Updated Action UI to include a selectable path to MakeMKV
    • Fixed compatibility issues with later releases of MakeMKV
    • Added DiscIdent functionality to auto-name DVD titles
Batch Encode.action - UPDATED
  • Provides general fixes that enhance the stability, compatibility and functionality of Batch Encode … in other words, I forgot to write them all down.
  • Fixed compatibility issues with later releases of MakeMKV
  • Fixed issues with Custom Encode Args
  • Updated default encode settings for latest Apple devices
  • Added support for setting a Native Language preference. Used for audio and subtitle tracks.
  • Added subtitle support. Default encode settings will now burn in forced subtitles in your native language; or all subtitles if the main audio language is not your native language.
  • Added a 'Use Default Audio' option. If selected, will use the sources main audio language. Useful if the majority of your discs are in your native language. If the main audio language is not your native language, the action will automatically burn-in subtitles in your native language if available.
  • Added support for BDSup2Sub. Automatically finds forced PGS subs, converts them to VOBSUB and remuxes the files for input to HandBrakeCLI. You'll need to install BDSup2Sub.jar to your Applications folder. You can download the latest version from: http://forum.doom9.org/showthread.php?t ... up2sub+mac
  • Updated Action UI to include a selectable path to MakeMKV, Mkvtoolnix and BDSup2Sub.jar
  • Added support for additional input file types including avi, mp4, m4v, mov, mpg.
_______________________________________________________________________________________________


Update 2009-12-02

Release Notes
Batch Rip Actions for Automator 1.0.4

Everything
  • Provides general fixes that enhance the stability, compatibility and functionality of Batch Rip Actions for Automator. In other words, I fixed a lot of stuff, but forgot write them all down.
  • Updated installer package, should provide greater compatibility for those with unique system configurations.
  • Batch Rip • Batch Rip (Folder Action).workflow has been replaced by the new Batch Rip Dispatcher LaunchAgent.
  • Tutorial has been updated to reflect the changes of v1.0.4.
Batch Rip Dispatcher.action - NEW ACTION
  • This action controls the Batch Rip Dispatcher LaunchAgent which acts like a folder action to automatically launch Batch Rip when a disc is inserted.
  • IMPORTANT: The Batch Rip Folder Action is no longer supported. You need to Enable Batch Rip Dispatcher by running the Service after it is installed.
Tag Inspector.action - NEW ACTION
  • This action displays all the iTunes metadata present in the input file.
Get Source Info from HandBrake.action - NEW ACTION
  • This action scans each source with HandBrakeCLI and saves the info to a text file.
Batch Rip.action - UPDATED
  • Updated to version 1.0.4
  • Added support for Batch Rip Dispatcher
  • Changed the way variables are passed to the shell
  • Added an option to skip discs that already exist in the output folder or append the name of new copy.
  • Added an option to save Terminal output to ~/Library/Logs.
Batch Encode.action - UPDATED
  • Updated to version 1.0.4
  • Improved compatibility with HandBrake v0.9.4.
  • Fixed min/max title selection for Movies, where movies were returning more than one title.
  • Changed the way variables are passed to the shell, improves stability when running multiple instances
  • Added ISO8859-1 character substitution in meta-tag info.
  • The HandBrakeCLI title scan is now saved as a text file to the source directory.
  • Added an option to display a verbose activity log for HandBrake.
  • Terminal output from last session is now saved in ~/Library/Logs.
Add Movie Tags.action - UPDATED
  • Added support for Search & Tag. If enabled, will display a search field and return a list of matches instead of using filename.
  • Added ISO8859-1 character substitution in meta-tag info.
  • General improvements in returning titles, handling metadata and processing cover art.
  • Added option to remove all tags from the input file when the "Add tags" option is off.
Add TV Tags.action - UPDATED
  • Added ISO8859-1 character substitution in meta-tag info.
  • General improvements in returning episode info, handling metadata and processing cover art.
  • Added option to remove all tags from the input file when the "Add tags" option is off.
Rename Movie Items.action - UPDATED
  • Added underscore replacement when using file/folder name as search criteria.
  • Added ISO8859-1 character substitution.
  • General improvements in returning matching titles.
Add Movie Poster.action - UPDATED
  • Added underscore replacement when using file name as search criteria.
  • Added ISO8859-1 character substitution.
  • General improvements in returning matching titles.

_______________________________________________________________________________________________

Update 2009-11-10

Release Notes
1.0.3

In Apple speak, v1.0.3 provides general fixes that enhance the stability, compatibility and functionality of Batch Rip Actions for Automator
  • Added workflows to install package. Now installs Services to ~/Library/Services, and Folder Actions to ~/Library/Workflows/Applications/Folder Actions
  • Shared components are now installed in /usr/local/bin
  • Fixes an issue that might cause tagging actions to stall when adding cover art
  • Includes general reliability and speed improvements for Add TV Tags, Add Movie Tags, Add Movie Poster, Batch Encode and Batch Rip

_______________________________________________________________________________________________

Update 2009-10-27
1.0.2

Everything
  • Requires Mac OS X 10.6 or later
  • Updated installer package, should correct permissions issues some users were experiencing
Add Genre to Movie File.action - NEW ACTION
  • This action tags mp4 files with a selected iTunes genre
Add Movie Poster.action - NEW ACTION
  • This action will add cover art to selected files. There are three options:
  1. Disable dialogs and use clipboard: Will download an image from a URL in the clipboard. The downloaded image will be added as cover art to the mp4/m4v file.
  2. Search themoviedb.org: Will search themoviedb.org and display movie posters matching a search term in Safari. Right-click and choose Copy Link to select a image. In the dialog box Choose OK. The selected image will then be downloaded and added as cover art to the mp4/m4v file.
  3. Choose from file: Will display a choose file window. The selected image will then be added as cover art to the mp4/m4v file.
Batch Rip.action - UPDATED
  • Updated to version 1.0.1
  • Note: FairMount has a new 64-Bit version and has been updated to 1.0.5.
  • Added pop-up menu to set the path to FairMount … since FairMount now has a 64-bit version and has changed its folder structure.
  • Changed how the Action logs mounted discs
    • Folder Action log is cleared when Batch Rip start processing
    • When an active Batch Rip disc item remounts after finishing a process, no dialogs will appear
  • Changed the way Batch Rip handles discs with the same name
    • If Batch Rip is set to run automatically, Batch Rip will skip discs if an item with the same name appears in the output directory
    • If Batch Rip is NOT set to run automatically, Batch Rip will copy the disc and append the filename of the new copy with the current process ID number (PID)
  • FairMount will now quit after DVDs have been copied
  • Fixed the error some users were experiencing with MakeMKV returning "No titles longer than" for DVD-ROM sources
  • Sets the Spotlight comment for all output items to the selected video kind
Batch Encode.action - UPDATED
  • Updated to version 1.0.1
  • Changed the egrep syntax for line 786, to fix the "echo: line 786" error message
  • Updated the subroutine for tsMuxeR, but doesn't matter since tsMuxeR is still not compatible with Snow Leopard
Add Movie Tags.action - UPDATED
  • Added new tags:
    • HD-Flag: for file resolutions over 1280x720
    • Title: will add the filename as the title
    • Video Type (stik): Movie (9-Short Movie)
  • Added add chapters from file (mp4chaps)
    • Chapter file must be named: filename.chapters.txt (filename must be exactly the same as the movie file)
  • Added cover art resizing. Will now resize images to a maximum of 600x600 pixels as recommended by iTunes. Also allows Finder to update icon more effectively and reduces file size a bit.
Add TV Tags.action - UPDATED
  • Added HD-Flag: for file resolutions over 1280x720
  • Added add chapters from file (mp4chaps)
    • Chapter file must be named: filename.chapters.txt (filename must be exactly the same as the movie file)
  • Added cover art resizing. Will now resize images to a maximum of 600x600 pixels as recommended by iTunes. Also allows Finder to update icon more effectively and reduces file size a bit
Last edited by mac.jedi on Sun Jul 31, 2011 6:18 pm, edited 13 times in total.

splodgecat
Posts: 9
Joined: Fri Sep 25, 2009 6:58 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by splodgecat » Tue Oct 20, 2009 3:04 pm

Absolutely the most insanely impressive tutorial I have ever seen in my history in the Mac community. The effort macjedi has put in is clear to see from beginning to end - professional screenshots, thoughtful notes, tips, detailed instructions... so may I be the first to say a huge thank you on behalf of everyone who will use this tutorial. Really great work.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Tue Oct 20, 2009 5:24 pm

splodgecat wrote:Absolutely the most insanely impressive tutorial I have ever seen in my history in the Mac community. The effort macjedi has put in is clear to see from beginning to end - professional screenshots, thoughtful notes, tips, detailed instructions... so may I be the first to say a huge thank you on behalf of everyone who will use this tutorial. Really great work.
Thanks splodgecat!

But, I'm just standing on the shoulders of geniuses. This kinda stuff wouldn't even be possible without the great work done by the HandBrake team & the community at large, in particular nightstrm, Cavalicious, JohnAStebbins, & Cave Man … these guys are awesome!

fcmarriott
Posts: 15
Joined: Thu May 17, 2007 1:13 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by fcmarriott » Tue Oct 20, 2009 11:15 pm

Mac.Jedi -

Truly great how-to. I have read through the entire thing a couple of times now and plan on implementing this weekend when I get a new mac and rebuild my ripping process. Couple of quick questions, for the last ~2 years, I have been using MacTheRipper (various versions, but currently 3.0 M14), and manually output to DTOX to pull out the Movie Only (I generally rip for AppleTV and/or Iphone/Ipod viewing, I don't backup to another DVD) and to ensure there aren't any zero cells or other funny business going on. I've only used Fairmount once, is it as good as MTR (religious question maybe?) and does Fairmount remove the need for the DTOX step, meaning, does it take care of zero cells or other encryption steps that can screw with the encoding process?

I suppose secondary question, is it possible to automate the MTR and/or the DTOX steps within you workflow? Is there a need to do that?

Thanks again for the workflow, between yours and Nightstrm's detailed posts, I'm moving to Bluray ripping/encoding and looking to automate as much as possible.

/bpm

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Wed Oct 21, 2009 5:34 pm

fcmarriott wrote:Truly great how-to. I have read through the entire thing a couple of times now and plan on implementing this weekend when I get a new mac and rebuild my ripping process.
Thanks fcmarriott! If your budget allows, get the fastest Mac you can afford. Blu-ray takes a lot of horse-power. In 2008, I bought an 8-core Mac Pro and love it. If you have the means I highly recommend picking one up. More cores will get you much faster HB encodes. I get almost realtime encoding of BD sources, about 2-3 hours per movie. I'm interested in seeing how the quad-core iMac does with HB.
fcmarriott wrote:Couple of quick questions, for the last ~2 years, I have been using MacTheRipper (various versions, but currently 3.0 M14), and manually output to DTOX to pull out the Movie Only (I generally rip for AppleTV and/or Iphone/Ipod viewing, I don't backup to another DVD) and to ensure there aren't any zero cells or other funny business going on. I've only used Fairmount once, is it as good as MTR (religious question maybe?) and does Fairmount remove the need for the DTOX step, meaning, does it take care of zero cells or other encryption steps that can [Censored] with the encoding process?
To my knowledge, FairMount doesn't handle zero-cells or ARcoSS protected discs. Unfortunately, for these you will need to do it manually with MTR, DTOX or even RipIt.app which seems to be a great MTR alternative.

The truth is I come across so few discs that FairMount can't handle. If I do, I try HandBrake direct from disc first, MTR or RipIt second and if that fails too, I'll try DTOX. I've even used AnyDVDHD on Windows/VMware Fusion on a problem disc.
I suppose secondary question, is it possible to automate the MTR and/or the DTOX steps within you workflow? Is there a need to do that?
I don't think either of those are scriptable. Zero-cells should be dealt with manually, but again this is something I don't run into very often. So for batch ripping, my process is to let er' rip and if I come across a disc that FairMount doesn't like, I deal with it later.

I hope this helps and good luck!

Calomile
Posts: 2
Joined: Thu Oct 22, 2009 12:50 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by Calomile » Thu Oct 22, 2009 12:56 pm

Wonderful tutorial, but I'm wondering if you could help solve a slight problem I seem to be having.

I've followed all the initial preliminary steps (downloading and installing all the programs, setting up folders and the like...) but once I've installed your actions and dragged the Workflows into my Movies folder, and try to run Batch Rip.workflow, I get a message saying that the appropriate actions cannot be located. When I go into my /User/Library/ folder I am confronted by this...

Image

I'm unsure as to whether this is a problem specific to my computer/installation or is a problem other uses might be having also. Any suggestions on how to fix this would be greatly appreciated.

Cheers.

Calomile
Posts: 2
Joined: Thu Oct 22, 2009 12:50 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by Calomile » Thu Oct 22, 2009 3:15 pm

Hello again!

Seems I've solved my original problem, and I'd like to offer up a solution to anyone who might also have the same problem... It would appear that the current revision of the installer installs the action files into ~/User/Library/Automator/ but doesn't set privileges for Administrator, and sets "Everyone" to no access, which was what was causing all the problems.

To solve this, right click the Automator folder and select Get Info (Cmd+I), then click the padlock button in the bottom right of the window, enter your administrator account's password, then under Sharing & Permissions, remove the _unknown value, add your user account/group (Administrators, for example) and set to Read & Write access. Do the same for everyone. The workflow files should now open in Automator!

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Thu Oct 22, 2009 3:21 pm

Hi Calomile,

Yesterday someone wrote me regarding a similar issue… where they didn't have read/write access to their ~/Library/Automator folder. I'm not sure if this was the case before the install or the installer somehow changed the permissions. I haven't encountered this on any of my test systems yet, but I'll check the installer settings again just in case.

The fix is to do a get info (Cmd+i) on the folder and scroll down to the Sharing and Permissions section. Click the lock icon and enter an Administrator username & password to unlock the panel. Choose the tool popup menu below the user list and Select > Make "your username (me)" the owner. You can also do this in panel itself, you just want your active login name to be the Owner with read/write privileges. Select the tool popup menu again and Choose > Apply to enclosed items…

I hope this helps.

Thanks, mac.jedi

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Fri Oct 23, 2009 12:06 am

Calomile wrote:It would appear that the current revision of the installer installs the action files into ~/User/Library/Automator/ but doesn't set privileges for Administrator, and sets "Everyone" to no access, which was what was causing all the problems.
Thanks Calomile for letting me know. I updated the installer, let me know if anyone finds it's still setting the wrong permissions.

westbeverly
Posts: 2
Joined: Sat Dec 13, 2008 5:18 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by westbeverly » Fri Oct 23, 2009 5:43 pm

Mac.Jedi-

Thanks very much for this incredibly thorough how-to.

I am admittedly not at all versed in Automator, etc., and am trying to implement this tutorial piece-by-piece. I am having some difficulty with the Batch Rip folder action.

Upon creating the batch rip folder action, I am able to rip a DVD, no problem. However, if I then insert a new DVD, nothing happens. If I right-click on Macintosh HD and go into Folder Actions Set-Up, I see that "Volumes" is indeed checked and the folder action listed there is the Batch Rip action I have saved (and it is checked as well) -- so, from my very limited understanding, it seems like it should be operational.

I have repeated this behavior several times -- when I cannot get a second DVD to cause the folder action to start, I delete the folder action and then re-create and save it. At this point, it will again rip the first dvd fine for me, but nothing will happen when I insert a second dvd.

Do you have any idea why that folder action will not "launch" when I insert a new DVD?

Thanks again for the tutorial and any help you (or anyone else) may be able to provide.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Fri Oct 23, 2009 9:43 pm

westbeverly wrote:Do you have any idea why that folder action will not "launch" when I insert a new DVD?
Hi westbeverly,
Sorry you are having trouble. I've got a few suggestions, but a solution might require more investigation:
  1. Restart your system to clear the cache and any temp files.
  2. You need to manually quit FairMount before inserting another DVD, otherwise FairMount might grab the DVD first … I had to disable the part of the Action which quits FairMount after copying as it would quit while another disc was still copying. I'll add it back soon.
  3. What are the names of the discs your trying to copy? I remember early on I was having this issue with discs that had spaces in the volume name. I fixed it, but perhaps it broke again.
  4. Post the full Terminal output from your successful copy. It may be helpful for further testing.
If you can't get it working, in the meantime you can use the "Batch Rip • Batch Rip (Service).workflow" located in the Workflows folder. Just open it, set your options and do a Save As. You can then Select a mounted disc and run the Service by Right-Click or via the Services menu.

Thanks for posting your problem. I'm sure this will help others tremendously.

Thanks again, mac.jedi

squamosity
Posts: 1
Joined: Fri Oct 23, 2009 10:52 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by squamosity » Sat Oct 24, 2009 12:04 am

What a spectacular solution, Thanks mac.jedi! This was perfectly timed. I was looking for a sane solution to batch convert AVCHD files from my camera using Handbrake and was getting frustrated with existing solutions. I'd even started to roll my own script and diving into the Handbrake Wiki for the Command Line Interface.

That was yesterday.

Today, I tried searching again for an existing solution that was simple and cheap to see if I'd missed something. To my surprise, up popped this astonishingly detailed post! My spare machine is tearing its way through a folder of videos as we speak. Yes, as you humbly point out, this is all using pre-existing software solutions and yes it's possible for one to do this for oneself. But it did take an impressive amount of effort to create all the Automator actions and workflows and then an even more impressive amount of consideration to document your solution so thoroughly.

Thanks for your efforts they are much appreciated!

Now to the feedback:
  1. I'm not sure if this is an issue isolated to my setup, but the installer failed to properly install the actions. Automator gave me errors about missing actions. I checked permissions which were ok but I noticed that the the actions had been copied to in my Home folder (~/). I opened them and was prompted by Automator if I wished to install them. After this, the workflows opened without a hitch.
  2. Your guide states that MakeMKV isn't necessary if one is not dealing with BluRay. However, the script hangs if MakeMKV is not installed. I ensured that I wasn't transcoding to 1080, just to SD. Again, not sure if I'm an isolated case, but check it out and consider adding some logic to skip the detection if 1080 output is not selected.
  3. It would nice to see a progress indicator while encoding. The script currently displays a calculated ETA for each process. I'd like to also see a time elapsed for each process as well as an approximated ETA and Time Elapsed for the entire set. I know, these types of calculations are variable and unreliable, but it would still be nice to know. Even if it's off by 2 hours, at least I know to expect 12 hours instead of 4.
  4. On a related note, growl integration is fantastic and the email alert is a good idea. However, it would be nice to have a log somewhere of the entire process that includes a record of settings, errors, time, file sizes and maybe even system settings and load. It could come in handy for troubleshooting and to compare results of past sessions.
  5. Finally, you've gone to so much trouble to put this together and I sure would like to have read a preface or endnote in the documentation about the author and a link back to the forum or other location where more current discussions are occurring.
Minor hiccups and nice-to-haves in an otherwise excellent solution.

Thanks again!

Starhawk
Regular User
Posts: 90
Joined: Sun Feb 24, 2008 8:27 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by Starhawk » Sat Oct 24, 2009 4:44 am

Fantastic guide! Thanks.

I've only tried the Add Movie Tag Service so far, and I notice that it's not deleting the original file or changing the name of the new tagged file from movie-temp.m4v (for example). Tried it twice just now on single movies each time.

Starhawk
Regular User
Posts: 90
Joined: Sun Feb 24, 2008 8:27 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by Starhawk » Sat Oct 24, 2009 4:58 am

Also, how does one deal with a colon in the title of a TV Show? I see in the guide it stated to use a space and a hyphen [ -] but this does not work in the example of Star Trek: The Next Generation.

When I go to thetvdb.com and test search for it, the only thing that works is "Star Trek: The Next Generation". The following do not successfully find the show:

Star Trek The Next Generation
Star Trek -The Next Generation
Star Trek - The Next Generation

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Sat Oct 24, 2009 6:26 am

Starhawk wrote:I notice that it's not deleting the original file or changing the name of the new tagged file from movie-temp.m4v (for example).
Hi Starhawk,

Re-read the section: A Few Words on Source Folder and File Naming. Most of the conventions are described there.

If you're trying to rename and tag a movie file, make sure you're following the instructions and using the Batch Rip • Rename & Tag Movie Items.workflow Service.

If you're only trying to Add Movie Tags, make sure you're using the Batch Rip • Add Movie Tags.workflow Service. Remember that if you're not using the rename & tag service, you files must already be named: Movie Title (YEAR).m4v
Starhawk wrote:Also, how does one deal with a colon in the title of a TV Show? I see in the guide it stated to use a space and a hyphen [ -] but this does not work in the example of Star Trek: The Next Generation.
The naming convention for TV Shows is similar to movies as described in the "A Few Words on Source Folder and File Naming" section: 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.

So for "Star Trek: The Next Generation", your files should be named "Star Trek - The Next Generation - S01E21.m4v". The action will parse the file name, add the colin for the search term and return the correct xml data for the show.

I hope this answers your questions. Let me know if you need more help.

Thanks, mac.jedi

Deleted User 803

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by Deleted User 803 » Sat Oct 24, 2009 11:43 am

This guide and set of tools is a huge help. I've been ripping/encoding/tagging for years and this was easy to setup, and is easy to use.

I'm having no issues with the ripping and encoding stages, I like the tools and the methods. I have other apps if I run into trouble discs, but I'm having issues with the Tagging.

I have not been able to find a single tagging solution that tags the way I want to tag my library. I regularly use Vidalin, iDentify, MetaX... I end up with two, sometimes three passes of tagging apps to get everything in there. I'm wondering if there is a way to dig into your tagging script and pick what goes where, so that I can determine what tags get placed in specific fields that I want them. I'm also big on artwork, most of the times I edit my own artwork and fix colors, remove credits... then I add them by hand directly in iTunes.

I guess I just need to dig into the atomic parsley my self...I'm just saying, tagging is tough, people have their own preferences. If you could point me in the right direction, in keeping with the format, I'd be very happy!

-jrog

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Sat Oct 24, 2009 2:26 pm

jrog wrote:I'm wondering if there is a way to dig into your tagging script and pick what goes where, so that I can determine what tags get placed in specific fields that I want them.
Hi jrog!

Thanks for posting! Here's a link to a post on another forum that discusses the tags the Actions set: http://forums.macrumors.com/showpost.ph ... stcount=30

If you're pretty comfortable with shell scripting, you take a look at the script below which is the guts for the Add Movie Tags Action. There's another sub-routine for adding HD and cnID tags, but we'll just focus on this one for now.

If you're not comfortable with shell scripting, now is great time to start learning since you've got some interest and a goal in mind. That's how I got started doing this whole thing. There are a lot of great resources on the web for Mac as well as Unix/linux shell scripting. Apple has a great tutorial on shell scripting that's a resource I use all the time: http://developer.apple.com/mac/library/ ... ction.html

Code: Select all

#!/usr/bin/env sh

# main.command
# Add Movie Tags

#  Created by Robert Yamada on 10/2/09.

#  Copyright (c) 2009 Robert Yamada
#	This program 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 3 of the License, or
#	(at your option) any later version.

#	This program 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.

#	You should have received a copy of the GNU General Public License
#	along with this program.  If not, see <http://www.gnu.org/licenses/>.

scriptPID=$$
xpathPath="/usr/bin/xpath"
xmllintPath="/usr/bin/xmllint"
atomicParsley64Path="$HOME/Library/Automator/Add Movie Tags.action/Contents/Resources/AtomicParsley64"

addiTunesTagsMovie()
{	
# variables	
discName="$movieName"
sourceTmpFolder="/tmp/$scriptPID"
tmdbApiKey="yourkeygoeshere"
discNameNoYear=`echo "$discName" | sed -e 's|\ (.*||g' -e 's|\ \-\ |:\ |g'`
# set TMDb searchTerm
searchTerm=`echo "$discNameNoYear" | sed -e 's|\ |+|g' -e "s|\'|%27|g"`
searchTermNoColin=`echo $searchTerm | sed 's|:||g'`
movieYear=`echo "$discName" | awk -F\( '{print $2}' | awk -F\) '{print $1}'`

echo -e "  Searching TMDb for ${searchTerm}... \c"
if [ ! -e "${sourceTmpFolder}/${searchTermNoColin}_tmp.xml" ]; then
	mkdir $sourceTmpFolder
	# get TMDb ID for all matches
	movieSearchXml="${sourceTmpFolder}/${searchTermNoColin}_tmp.xml"
	curl -s "http://api.themoviedb.org/2.1/Movie.search/en/xml/$tmdbApiKey/$searchTerm" > "$movieSearchXml"
	tmdbSearch=`"$xpathPath" "$movieSearchXml" //id 2>/dev/null | sed -e 's|\/id>|\||g'| tr '|' '\n' | awk -F\> '{print $2}' | awk -F\< '{print $1}'`

	# find the listing that matches the releses the release date, movie title and type
	for tmdbID in $tmdbSearch
	do		
		# download each id to tmp.xml
		movieData="${sourceTmpFolder}/${tmdbID}_tbdb_tmp.xml"
		if [ ! -e "$movieData" ]; then
			tmdbXML=`curl -s "http://api.themoviedb.org/2.1/Movie.getInfo/en/xml/$tmdbApiKey/$tmdbID" > "$movieData"`
		fi
		
#		cat "$movieData"
		# get movie title and release date
		discNameNoYearWildcard=`echo "$discNameNoYear" | sed -e 's|:|.*|g' -e 's|\&|.*|g'`
		releaseDate=`"$xpathPath" "$movieData" //released 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}' | grep "$movieYear"`
#		echo "$releaseDate"
		movieTitle=`"$xpathPath" "$movieData" //name 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}' | sed "s|&apos;|\'|g" | egrep -i "$discNameNoYearWildcard"`

		if [ "$movieTitle" = "" ]; then
			movieTitle=`"$xpathPath" "$movieData" //alternative_name 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}' | sed "s|&apos;|\'|g" | egrep -i "$discNameNoYearWildcard"`
		fi
		# verify data match, delete if not a match
		if [[ ! $releaseDate = "" && ! $movieTitle = "" ]] ; then
			echo "Title found"
			mv $movieData $movieSearchXml
		else
			if [ -e $movieData ]; then
				rm $movieData
			fi
		fi
		
	done
	if [ ! -e "$movieSearchXml" ]; then
		echo " " > "$movieSearchXml"
	fi
fi

# set metadata variables and write tags to file
if sed '1q;d' "$movieSearchXml" | grep '>' > /dev/null ; then
	movieData="$movieSearchXml"
	movieTitle=`"$xpathPath" "$movieData" //name 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}'`
	videoType=`"$xpathPath" "$movieData" "//type" 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}'`
	movieDirector=`"$xpathPath" "$movieData" "//person[@job='Director']/@name" 2>/dev/null | sed 's| name="||g' | tr '\"' '\n' | sed -e '/./!d' -e 's|^|<string>|g' -e 's|^|<dict><key>name</key>|g' -e 's|$|</string></dict>|g'`
	movieProducers=`"$xpathPath" "$movieData" "//person[@job='Executive Producer']/@name|//person[@job='Producer']/@name" 2>/dev/null | sed 's| name="||g' | tr '\"' '\n' | sed -e '/./!d' -e 's|^|<string>|g' -e 's|^|<dict><key>name</key>|g' -e 's|$|</string></dict>|g'`
	movieWriters=`"$xpathPath" "$movieData" "//person[@job='Screenplay']/@name" 2>/dev/null | sed 's| name="||g' | tr '\"' '\n' | sed -e '/./!d' -e 's|^|<string>|g' -e 's|^|<dict><key>name</key>|g' -e 's|$|</string></dict>|g'`
	movieActors=`"$xpathPath" "$movieData" "//person[@job='Actor']/@name" 2>/dev/null | sed 's| name="||g' | tr '\"' '\n' | sed -e '/./!d' -e 's|^|<string>|g' -e 's|^|<dict><key>name</key>|g' -e 's|$|</string></dict>|g'`
	albumArtists=`"$xpathPath" "$movieData" "//person[@job='Actor']/@name" 2>/dev/null | sed -e 's| name="||g' -e 's|"|, |g' -e '/./!d' -e 's|, $||'`
	releaseDate=`"$xpathPath" "$movieData" //released 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}'`
	movieDesc=`"$xpathPath" "$movieData" //overview 2>/dev/null | awk -F\> '{print $2}' | awk -F\< '{print $1}'`
	genreList=`"$xpathPath" "$movieData" "//category[@type='genre']/@name" 2>/dev/null | sed 's| name="||g' | tr '\"' '\n' | sed -e '/./!d' -e 's|^|<string>|g' -e 's|^|<dict><key>name</key>|g' -e 's|$|</string></dict>|g'`

	# parse category info and convert into iTunes genre
	if echo "$genreList" | grep 'Animation' > /dev/null ; then
		movieGenre="Kids & Family"
	elif echo "$genreList" | grep '\(Fantasy\|Science\|Science Fiction\)' > /dev/null ; then
		movieGenre="Sci-Fi & Fantasy"
	elif echo "$genreList" | grep 'Horror' > /dev/null ; then
		movieGenre="Horror"
	elif echo "$genreList" | grep '\(Action\|Adventure\|Disaster\)' > /dev/null ; then
		movieGenre="Action & Adventure"
	elif echo "$genreList" | grep '\(Musical\|Music\)' > /dev/null ; then
		movieGenre="Music"
	elif echo "$genreList" | grep 'Documentary' > /dev/null ; then
		movieGenre="Documentary"			
	elif echo "$genreList" | grep 'Sport' > /dev/null ; then
		movieGenre="Sports"			
	elif echo "$genreList" | grep 'Western' > /dev/null ; then
		movieGenre="Western"
	elif echo "$genreList" | grep '\(Thriller\|Suspense\)' > /dev/null ; then
		movieGenre="Thriller"
	elif echo "$genreList" | grep '\(Drama\|Historical\|Political\|Crime\|Mystery\)' > /dev/null ; then
		movieGenre="Drama"
	elif echo "$genreList" | grep '\(Comedy\|Road\)' > /dev/null ; then
		movieGenre="Comedy"
	fi 

		# check if moviePoster already exists
		moviePoster="${sourceTmpFolder}/${searchTermNoColin}.jpg"
		if [ ! -e $moviePoster ] ; then
			getMoviePoster=`"$xpathPath" "$movieData" "//image[@type='poster' and @size='original']/@url" 2>/dev/null | sed 's|url="||g' | tr '"' '\n' | sed -e 's|^ ||' -e '/./!d' | grep -m1 ""`
			curl -s "$getMoviePoster" > $moviePoster
		fi

	# create movie tags reverseDNS xml file
	movieTagsXml="${sourceTmpFolder}/${searchTermNoColin}_tags_tmp.xml"
	if [ ! -e $movieTagsXml ] ; then
		xmlFile="<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><dict><key>cast</key><array>${movieActors}</array><key>directors</key><array>${movieDirector}</array><key>screenwriters</key><array>${movieWriters}</array><key>producers</key><array>${movieProducers}</array></dict></plist>"
		echo "$xmlFile" | tr -cd '\11\12\40-\176' | "$xmllintPath" --format --output "${sourceTmpFolder}/${searchTermNoColin}_tags_tmp.xml" - 
	fi
	movieTagsData=`cat "$movieTagsXml"`

	# write tags with atomic parsley
	echo -e "\n*Writing tags with AtomicParsley\c"
	if [[ overWrite -eq 1 ]]; then
		"$atomicParsley64Path" "$theFile" --overWrite --artist "$albumArtists" --year "$releaseDate" --genre "$movieGenre" --description "$movieDesc" --artwork "$moviePoster" --rDNSatom "$movieTagsData" name=iTunMOVI domain=com.apple.iTunes
	elif [[ overWrite -eq 0 ]]; then
		"$atomicParsley64Path" "$theFile" --artist "$albumArtists" --year "$releaseDate" --genre "$movieGenre" --description "$movieDesc" --artwork "$moviePoster" --rDNSatom "$movieTagsData" name=iTunMOVI domain=com.apple.iTunes
	fi

else
	osascript -e 'tell application "Automator Runner" to activate & display alert "Error: Add Movie Tags" message "Error: Could not find a match." & Return & "Check Movie Name and Year."'
fi
}

#####################################################################################
# MAIN SCRIPT

while read theFile
do
	if [[ ! "${overWrite}" ]]; then overWrite=0; fi
	if [[ ! "${removeTags}" ]]; then removeTags=0; fi
	if [[ ! "${addTags}" ]]; then addTags=0; fi

	if [[ removeTags -eq 1 ]]; then
		"$atomicParsley64Path" "$theFile" --overWrite --metaEnema
	fi

	if [ -e "$atomicParsley64Path" ]; then
		if echo "$theFile" | egrep '.* \([0-9]{4}\)' ; then
			movieName=`basename "$theFile" .m4v`
			outputDir=`dirname "$theFile"`

			if [[ addTags -eq 1 ]]; then
				addiTunesTagsMovie
			fi

			if [ -e "$sourceTmpFolder" ]; then
				rm -f $sourceTmpFolder/*
				rm -d $sourceTmpFolder
			fi
		else
			osascript -e 'tell application "Automator Runner" to activate & display alert "Error: Add Movie Tags" message "Error: File Naming Convention. Cannot parse the filename." & Return & "Rename your file: Movie Name (year)"'
		fi
	else
		osascript -e 'tell application "Automator Runner" to activate & display alert "Error: Add Movie Tags" message "Error: Cannot Find AtomicParsley64." & Return & "Install MetaX in your Applications Folder"'
	fi

done
The first thing you should do is get an API key from themoviedb.org and thetvdb.com. My first attempt was with tag chimp, but I got way too many mis-matches. Unfortunately, their database is full of duplicates, incorrect and incomplete info. Both themoviedb.org and thetvdb.com have nicely managed wiki-style databases and great tutorials on how to use their APIs. The links are listed below.
http://api.themoviedb.org/2.1/
http://thetvdb.com/wiki/index.php?title=Programmers_API

The biggest learning curve for me was how to parse the xml data from the API's and how to create the xml plist file Apple uses for the rDNS atom that shows Directors, Producers, Screenwriters, etc. in Front Row and Apple TV. For this you should read up on XPATH (to parse the xml data) and xmllint (to write the iTunes plist). These are both CLI tools included in the /usr/bin directory of every modern Mac.

Adding tags is pretty easy with the right tools. This script uses MetaX's modified AtomicParsley64 CLI to write the tags (available inside the MetaX.app package). AtomicParsley has a wealth of information in the command-line help. Just enter the path to AtomicParsley (or drag the app) in the Terminal window and Press Enter. The help also includes a list of commands to get additional help on specific types of tags.

Anyway, there really is a lot to it when you're getting started. But once you've messed around with it enough, it's easy as pie.

I hope this helps point you in the right direction. I don't really want to derail the focus of this thread too much, but I'm happy to help.

Thanks, mac.jedi


Addl Resources:
http://code.google.com/p/mp4v2/wiki/iTunesMetadata
http://code.google.com/p/mp4v2/
http://mp4v2.googlecode.com/svn/doc/1.9 ... Guide.html
http://atomicparsley.sourceforge.net/

splodgecat
Posts: 9
Joined: Fri Sep 25, 2009 6:58 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by splodgecat » Mon Oct 26, 2009 7:39 pm

Hey macjedi

In response to some above posts:

I too have had problems getting the initial folder action to work on the *second* dvd inserted and further dvds. The dvd I was trying DID have a space in the name (SHOOTER_EUROPE). Haven't tried dvds without spaces.

The first time I got the action to work, terminal launched, and reported errors. Can't remember what they said. Unhelpful I know!

I have been unable to get terminal to launch subsequently, even when the action initiates (giving me the movie/tv choice)

I shall try what you recommended above and see if I can produce some consistent results.

*UPDATE*

Just tried 3 different DVDs with single-word names. The script seems to consistently launch. But when I click on 'Movie' NOTHING happens, even after waiting a few minutes. Terminal doesnt launch, not even once. V strange behaviour. Ive reinstalled the workflows and deleted and re-done the Folder Action process but to no avail.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Wed Oct 28, 2009 3:48 am

ANNOUNCEMENT: BATCH RIP ACTIONS UPDATED

Release Notes
Batch Rip Actions for Automator

1.0.2

Everything
  • Requires Mac OS X 10.6 or later
  • Updated installer package, should correct permissions issues some users were experiencing
Add Genre to Movie File.action - NEW ACTION
  • This action tags mp4 files with a selected iTunes genre
Add Movie Poster.action - NEW ACTION
  • This action will add cover art to selected files. There are three options:
  1. Disable dialogs and use clipboard: Will download an image from a URL in the clipboard. The downloaded image will be added as cover art to the mp4/m4v file.
  2. Search themoviedb.org: Will search themoviedb.org and display movie posters matching a search term in Safari. Right-click and choose Copy Link to select a image. In the dialog box Choose OK. The selected image will then be downloaded and added as cover art to the mp4/m4v file.
  3. Choose from file: Will display a choose file window. The selected image will then be added as cover art to the mp4/m4v file.
Batch Rip.action - UPDATED
  • Updated to version 1.0.1
  • Note: FairMount has a new 64-Bit version and has been updated to 1.0.5.
  • Added pop-up menu to set the path to FairMount … since FairMount now has a 64-bit version and has changed its folder structure.
  • Changed how the Action logs mounted discs
    • Folder Action log is cleared when Batch Rip start processing
    • When an active Batch Rip disc item remounts after finishing a process, no dialogs will appear
  • Changed the way Batch Rip handles discs with the same name
    • If Batch Rip is set to run automatically, Batch Rip will skip discs if an item with the same name appears in the output directory
    • If Batch Rip is NOT set to run automatically, Batch Rip will copy the disc and append the filename of the new copy with the current process ID number (PID)
  • FairMount will now quit after DVDs have been copied
  • Fixed the error some users were experiencing with MakeMKV returning "No titles longer than" for DVD-ROM sources
  • Sets the Spotlight comment for all output items to the selected video kind
Batch Encode.action - UPDATED
  • Updated to version 1.0.1
  • Changed the egrep syntax for line 786, to fix the "echo: line 786" error message
  • Updated the subroutine for tsMuxeR, but doesn't matter since tsMuxeR is still not compatible with Snow Leopard
Add Movie Tags.action - UPDATED
  • Added new tags:
    • HD-Flag: for file resolutions over 1280x720
    • Title: will add the filename as the title
    • Video Type (stik): Movie (9-Short Movie)
  • Added add chapters from file (mp4chaps)
    • Chapter file must be named: filename.chapters.txt (filename must be exactly the same as the movie file)
  • Added cover art resizing. Will now resize images to a maximum of 600x600 pixels as recommended by iTunes. Also allows Finder to update icon more effectively and reduces file size a bit.
Add TV Tags.action - UPDATED
  • Added HD-Flag: for file resolutions over 1280x720
  • Added add chapters from file (mp4chaps)
    • Chapter file must be named: filename.chapters.txt (filename must be exactly the same as the movie file)
  • Added cover art resizing. Will now resize images to a maximum of 600x600 pixels as recommended by iTunes. Also allows Finder to update icon more effectively and reduces file size a bit
Enjoy!

splodgecat
Posts: 9
Joined: Fri Sep 25, 2009 6:58 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by splodgecat » Wed Oct 28, 2009 12:25 pm

The update seems to have fixed a lot of errors for me. DVDs now activate the script consistently. However on first go, Terminal produced:

laptop:~ nathan$ /Users/nathan/Library/Automator/Batch\ Rip.action/Contents/Resources/batchRip.sh ; exit;

ERROR: makemkvcon command tool is not setup to execute
ERROR: attempting to use tool at /Applications/MakeMKV.app/Contents/MacOS/makemkvcon

ERROR: makemkvcon command tool could not be found
ERROR: makemkvcon can be installed in ./ /usr/local/bin/ /usr/bin/ ~/ or /Applications/

logout

[Process completed]

I installed MakeMKV, and it worked. So it seems even if you're not using MakeMKV (I'm not, and I checked that the tickbox was UNticked) you're still required to install it.

Terminal did produce some crap after the copy though:

*Scanning DVD-ROM: STARDUST_UK
Copying /Volumes/STARDUST_UK

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2009-10-28 12:17:11.821 osascript[15427:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.


PROCESSING COMPLETE
Disk /Volumes/STARDUST_UK ejected
End: Wed 28 Oct 2009 12:17:30 GMT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

logout

[Process completed]

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Wed Oct 28, 2009 1:50 pm

splodgecat wrote:The update seems to have fixed a lot of errors for me. DVDs now activate the script consistently.
Cool splodgecat, I'm glad you got it workin'. I'll check on the makeMKV requirement.

Code: Select all

2009-10-28 12:17:11.821 osascript[15427:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:
	/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
This is an Adobe scripting addition module that it incompatible with Snow Leopard. When I did a clean install of 10.6 and then installed Adobe CS 3.3, 10.6 threw up an error and asked me if I wanted to remove it. If you did an upgrade-install perhaps it doesn't notify you. The solution is to remove it manually as it won't work anyway. It looks like it's located in /Library/ScriptingAdditions. As you can see, I still have mine:
Image

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Wed Oct 28, 2009 5:10 pm

splodgecat wrote:

Code: Select all

    ERROR: makemkvcon command tool is not setup to execute
    ERROR: attempting to use tool at /Applications/MakeMKV.app/Contents/MacOS/makemkvcon

    ERROR: makemkvcon command tool could not be found
    ERROR: makemkvcon can be installed in ./ /usr/local/bin/ /usr/bin/ ~/ or /Applications/
I checked the code and there was a typo in the code that switches the BD-ROM function on and off … it seems that the force was not with me on that one.

I updated the Batch Rip.action to 1.0.1b at about 8:30 PST. I highly recommend re-downloading and using the custom install to replace the Batch Rip action.

Thanks for letting me know, mac.jedi

splodgecat
Posts: 9
Joined: Fri Sep 25, 2009 6:58 am

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by splodgecat » Thu Oct 29, 2009 11:18 am

Thanks for your help mate you've been brilliant.

Now I've moved on to perfecting the encode stage.

I've tried to customize the rip settings for standard DVD sources.

Any idea why the script is producing this error?

Code: Select all

PROCESSING: Stardust (2007) 

*Scanning Folder: 'Stardust (2007)'
  Will encode the following tracks: 1 


*Creating Stardust (2007).m4v
Using Custom/DVD-toolArgs: -f mkv -m -e x264 -q 0.600000023841858 -a 1 -E ac3 -B 160 -R Auto -6 auto -p -x ref=3:mixed-refs:bframes=3:b-pyramid:weightb:filter=-2,-1:trellis=1:analyse=all 8x8dct:me=umh:subme=9:psy-rd=1,1 -s 1 2 -F -U


  Script could not complete because Stardust (2007).m4v does NOT exist
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

PROCESSING COMPLETE: Stardust (2007)
If anyone's interested I'm attempting to use Constant Quality to produce a sort of default high quality setting that I can use for nearly all sources (apart from animation and old tv shows - which I'll have to master once I get to them :? ). I'm experimenting with putting soft subtitles into the mkv format which from what I hear the latest handbrake snapshot can do.

mac.jedi
Regular User
Posts: 108
Joined: Thu Apr 24, 2008 11:17 pm

Re: How-To: Automate DVD & Blu-Ray (Backup, Encoding & Tagging)

Post by mac.jedi » Thu Oct 29, 2009 3:26 pm

splodgecat wrote:Any idea why the script is producing this error?

Code: Select all

*Creating Stardust (2007).m4v
Using Custom/DVD-toolArgs: -f mkv -m -e x264 -q 0.600000023841858 -a 1 -E ac3 -B 160 -R Auto -6 auto -p -x ref=3:mixed-refs:bframes=3:b-pyramid:weightb:filter=-2,-1:trellis=1:analyse=all 8x8dct:me=umh:subme=9:psy-rd=1,1 -s 1 2 -F -U

Script could not complete because Stardust (2007).m4v does NOT exist
Hi splodgecat,
I haven't had time to really look into it, but it do see a couple of issues:
First, the action wasn't designed to create mkv files from DVD sources, only mp4/m4v for DVD, so it gonna try to create an mp4 file even if you specify -f mkv. HandBrake sets the format from the filename which gets set to .m4v in the action. Is there a reason you need mkv?

Second, I tried your args without the mkv format flag and it still fails so there is something else going on in your args as well. I tested a couple of my other arg sets and they start to encode fine. Have you tried your args with the CLI or hand selecting in the GUI?

Post Reply