By Nels Johnson, December 2, 2008
Every couple of years, I rip a crate of DVDs into licensed, DRM’d WMVs for a client who sells a vertical-market video jukebox for dedicated Windows machines with TV set monitors. Till now, this was labor-intensive (video capture card, Windows Media Encoder, etc.) and required frequent testing/resetting of audio levels, manual chapter selection and TRT coordination based on the DVD packaging. All doable, but way too much like 1998 — which is why the job usually began with a Google seek for free or cheap software-only salvation.
 Figure 1. HandBrake’s main user interface (Mac OS version).
This year I got lucky and found HandBrake on the first Google results page. You put in a DVD, out comes a single movie file. Not unknown to most professional media wranglers but new to me as a reliable business tool, which made me learn and appreciate it. Unfortunately, the app exports only MP4, AVI, MKV and OGM files on the Mac and PC. Worse, MS Expression Encoder can’t load MP4 files. For this gig I needed WMV output (and MS DRM — the horror, the horror). Batch conversion from MP4 to WMV was also on the wish list.
Enter Flip4Mac, Telestream’s formidable solution for rendering WMVs on Mac OS. The $50 Studio version lets you export to WMV from, say, MP4 via QuickTime Pro with much more reliability than even the free VLC Player. Yes, you are going from MPEG-2 through MP4 to WMV, but the results I experienced were more than good enough for full-screen commercial playback when re-sampling with a high enough data rate (at least 1MB). The full workflow, including batch processing, is detailed below.
HandBrake
According to the site intro, “HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded DVD to MPEG-4 converter, available for Mac OS X, Linux and Windows.” Supported input sources include “VIDEO_TS folder, DVD image or RealDVD (encrypted or unencrypted, but protection methods other than CSS are not supported and must be handled externally with third-party software), and some VOB and TS files.” (The main UI is shown in Figure 1.)
Insert your source DVD, drop down the Title list and choose the one with the longest TRT, which should be obvious. The associated chapter drop-downs will auto-populate with default selections. If you have favorite settings for frame rate, bit rate, video frame size, codec, quality, etc., select them from the relevant controls. For this job I wanted quarter-screen video output and a 1MB data rate because all files would be played back pixel-doubled on TV sets (attached to Windows machines). Other target monitors will require different encoding recipes.
The rips went faster on the Mac than on the (similarly-equipped, dual core 2GHz) PC. The Mac was an Intel Mini. Fortunately I was converting from MPEG-2 to MP4. Targeting H.264 over the course of 50 DVDs would have added much more time to the production schedule without additional processing power. Even with one Mac and one PC working around the clock, this part of the job took several days to complete (including occasional start-overs and cropping experiments).
Flip4Mac
Once the feature-length MP4s were assembled and spot-tested on a single external hard drive, it was time for transcoding to WMV, but only on the Mac. Telestream has a high-end batch converter named Episode with lots of other useful features for $500, but that would have dinged the profit margin. My two best choices for free DIY batching were 1) use an AppleScript or 2) make the Mac perform multiple transcodes simultaneously and hope it didn’t crash during the extended process (up to 24 hours doing 8 to 10 at a time). The only real difference here is that one process is serial, the other parallel.
 Figure 2
. Flip4Mac-enabled QuickTime Pro: Report to export to WMV
As noted above, Flip4Mac is an add-in to QuickTime. The Studio version lets QT Pro export to WMV using the otherwise familiar QT Player UI, which includes the handy “Most Recent Settings.” This is key to both DIY scenarios (see Figure 2). I thought I had found a simple but effective AppleScript to customize for this particular task, but there was one fatal flaw. The script is listed at right, along with a workaround suggestion from Telestream.
Good thing there was a Plan B, and that it worked. Five batches of 10 took the better part of four days (including spot checks of finished batches and setup of new batches) but there were no crashes. The resulting WMVs played normally in the Windows Media Player and accepted the DRM bits just like WMVs captured on the PC.
Windows Media DRM Redux
The final phase of the overall job was the least risky because I had done it several times before without incident. It was neither free nor completely DIY, but I believe it’s worth a short review here to give the other phases extra context. While most people feel that DRM is more trouble than it’s worth, some vertical markets still require it, and indie videographers are usually expected to know a few details regarding such production issues.
Remember that the system described above acquires licenses for video files stored locally — as opposed to downloading the media and then obtaining a license. The latter scenario is not inherently more complicated but does require including and managing the download process. Movielink is a good example of a consumer-oriented service for acquiring media files to which licenses are applied at download time.
The main DRM components/milestones of this project were:
• 1. Obtain the Windows Media DRM SDK from Microsoft,
starting at http://www.microsoft.com/windows/windowsmedia/
forpros/drm/sdksandversions.aspx
• 2. Add DRM protection to the WMV files (another batch process)
• 3. Design the license procurement / renewal system
• 4. Set up the license server and create the ASP pages to handle
license requests
• 5. Program the client to contact the server for license acquisition
Designing the license procurement and renewal system first is crucial. A basic system won’t require a lot of code to set up, but as services increase in scope and you begin to add asset and license management tools, your code base will grow exponentially. You don’t need to be a professional programmer, but sophisticated Web developer skills are essential. The License Server is basically the Windows Media DRM SDK on a MS Web server. This server can be hosted by the content provider or even a third-party license broker
AppleScripting the Flip4Mac Phase
Here are the guts of the fatally-flawed batch conversion script. If you copied and successively pasted the block of lines between the first and last “tell” lines as many times as you had source movies, using actual source and target file names instead of mymovie, you could build the complete script quickly and easily. Or you could use a loop to process all the files in a specified folder. Google is rife with such examples, needless to say.

The problem is that QuickTime Pro does not support “as WMV” even with Flip4Mac installed (normally you would see “as AVI” or “as MPG” at that point in the script). According to Telestream product management, QuickTime Player does not include AppleScript support for exporting in any format other than what comes bundled with QuickTime itself. They did suggest creating an Apple Compressor setting that uses the WMV format, but such software development is beyond the scope of this column (for now).
Again, nice to have a Plan B.
|