Regular Rate & Rhythm Blog
Handbrake, AppleTV, and batch conversion
I've been trying hard to get back into shape; part of my plan includes running. My exercise room features a treadmill, a wall-mounted TV, and an AppleTV. The iPod Touch comes with me and, via Rowmote, controls the AppleTV. I find it much easier to run while catching up on TV.
If I want to watch episodes for shows I have on my Mac, I need to convert them to the AppleTV movie format (MPEG-4) first so that iTunes will happily sync them to the aTV. Handbrake is a great, open source, free tool to perform that conversion, but its queueing system - for batch conversion of multiple files - is very cumbersome. Fortunately, the command line interface (CLI) version of Handbrake can do the job with just a touch of magic.
To convert a folder of movie files to the AppleTV format:
1. Download the HandbrakeCLI tool. I installed it to ~/bin but anywhere on your path will do.
2. Load Terminal and cd to the folder with your movie files.
3. Run the following one-line command:
for f in *; do HandBrakeCLI -i "$f" -o "~/Desktop/$f.mp4" --preset="AppleTV"; done
I've gotten a bit fancier, using screen so I can put the conversion in the background and putting the command into a shell script, but the line above is the key. Hope that helps someone else!
Rowmote for AppleTV: Fixed '@' bug
Rowmote Helper ATV 3.1 is now available from the Rowmote Apple TV Installation page. It fixes the recent bug in which typing the '@' key into certain third party applications such as Boxee or Firefox instead inserted a '2'.
Update instructions may be found on that page; an autoupdating system remains in development.
Rowmote for iPad 3.1: The Gesture Pad
Rowmote and Rowmote Pro 3.1 on the iPad introduce an exciting new feature, the Gesture Pad. Found in the center of the remote control screen, the Gesture Pad lets you control the computer using, as the name implies, gestures. This is a new level of no-look control over your Mac or Apple TV.
Flick your finger down to move down in a menu; hold it to scroll. Flick right to move forward a track, or hold it to the right to fast forward. A single tap is Play/Pause (or Select), while a two-finger tap is Menu (or Back).
In Rowmote Pro, the Gesture Pad can also be toggled to a standard trackpad by touching the mouse cursor icon in the corner; for the first time in Rowmote, your one-touch media controls, multitouch trackpad, and keyboard can all be easily managed on the same screen.
I hope you enjoy the new feature as much as I do :)
Note: Rowmote Pro 3.1 was approved today and displays as '3.0.8' in some of the iTunes and App Store screens; Rowmote 3.1 should follow shortly, as it's in review with Apple. You'll need to update to Rowmote Helper 3.1 – for which you'll be prompted automatically – to use the new features.
SQLite3, Full Text Search with FTS3, and iOS 4.0
Our iOS apps Med Mnemonics, Med Abbreviations, and ICD9 Consult handle huge amounts of data – 1500+ memory tricks and aides, 13,000+ medical abbreviations, and 17,000+ medical diagnosis codes respectively – and provide instantaneous search. The key to doing so is the FTS3 extension to SQLite3 which enables fast, indexed search.
While updating both apps to support the new features of iOS 4.0 by compiling against the iOS 4.0 SDK, I discovered that compiling a custom build of SQLite3 (in my case, to enable FTS3) led to massive breakage when running on iOS 3.2 or earlier. I could continue to just use the iOS 3.2 SDK, but that would mean no fast task switching, among other problems. No good!
The solution is to use the systemwide sqlite3 library and load FTS3 as an extension. To do so:
- Download the sqlite-fts3-extension project I created, which includes the necessary files from the sqlite3 project.
- Include the project in your own. Add it as a dependency for your own target (so it will be built automatically) and drag the sqlite-3.6.23.1-fts3-ext.a product to your Link Binary with Libraries phase.
- In the class file before you load the database, add:
#import "RRFTS3ExtensionLoader.h"
at the top and add:
[RRFTS3ExtensionLoader loadFTS3];
somewhere before the database is opened.

View Comments