Import Chapters With Handbrake GUI
July 14th, 2010
| Tags: applescript, handbrake, m4v, MKV, osx, regular-expressions, Textmate
Between using Handbrake on Windows and on OSX, I have found the UI differences to be maddening. (For the most part, I like the OSX GUI better, except when it comes to extracting more than four audio tracks and when it comes to importing chapter titles.)
To (sort of) automate the process of importing chapter titles into Handbrake, I created the following workflow (for OSX):
- Find the movie on Barnes and Noble
Copy the chapter listing (that looks similar to this):
- Main Title [5:56]
- “Happiness Hotel” [11:25]
- Lady Holiday’s Office [8:13]
Paste into TextMate.
- Find
^[0-9]*\\. (.*) \\[.*\\]$
and replace with$1
(be sure regular expressions are enabled) - Copy the resulting chapter titles (which have had the number and time stripped off)
- In Handbrake, start editing the first chapter name
- Run the “Paste Chapter Titles” script and watch as all of the chapter titles are pasted in the correct location.
-- Get the chapter titles from the clipboard set oldDelims to AppleScript's text item delimiters set AppleScript's text item delimiters to {return} set chapterTitles to every text item of (the clipboard) set AppleScript's text item delimiters to oldDelims tell application "HandBrake" to activate repeat with ct in chapterTitles tell application "System Events" to tell process "Handbrake" to keystroke (ct & return) delay 0.04 * (length of ct) end repeat |
Yes, I realize that the MetaX tool would work well–if I was using a M4V wrapper. But I’m not. The WDTV Live I have doesn’t support chapters in the M4V container.
Leave a comment
| Trackback