Tuesday, April 07, 2009

Workflow for getting DVD captions

Disclaimer: this is a process aimed at putting educational videos on Flash Media Server, with the addition of closed captions for the Longtail video player.

Prerequisites:
DVDfab (which is our DVD -> .mp4 ripper as well)
CCExtractor


Rip DVD to .mp4 first. For ease, we'll By default, DVDFab selects a subtitle ("subpicture") and we want to uncheck that. Click Next.


Click Conversion Settings to make this an MP4.

We want Device: Generic which should default to an h264+aac .MP4, perfect for FMS. Change the filename and the title to something a little more human-friendly. Note the Fixed Bitrate/Fixed File Size boxes: if the Fixed File Size would be much more than 600MB, select it and tweak it down to 650MB. Subpicture should read "No subpicture". Click OK and click Start to start ripping the DVD to .MP4. On a slow single-core P4, this will take about the same time as playback; others with more recent equipment report it taking about half that time. The .MP4 is ready for putting up on the Flash Media Server in its proper directory.

CCExtractor can't read this .MP4 for captions (and that may be because the author isn't familiar with MP4 or because DVDfab's cropping strips scanline 21, or both or neither), so we'll have to rip the DVD a second time, this time to an MPEG2 stream. Good news is, the second rip is direct to .vob ("DVD Passthrough") and requires the least transcoding (essentially all it's doing is stripping out the disc's CSS encryption).


This time, go to the main DVDFab screen and click Crop Settings. In the Crop Settings window, click Disabled and OK. This is to prevent DVDFab from stripping out the scanline that contains the closed caption data. In the main screen, click Conversion Settings.


This time, select vob as the device and click OK. Click Start: a 105 min movie (Ghostbusters) took all of 9 minutes on a crappy Dell Optiplex GX270. (edit: A scratched 125 min. disc of Spirited Away took 24 minutes)


Open CCExtractor, go to the Input files tab if it's not already open and drag the .vob you just made to the window. Click the Output tab and make sure ".srt (SubRip)" is selected.


Click the awkwardly-named Execution tab and click Start. Extracting the captions on this old machine takes roughly a tenth the time of playback. When it's finished, in the same directory as the filename.vob is now filename.srt, ready to be put anywhere that the Longtail player can find it (either locally to the player or accessible with an http url). Do not delete the .vob file until you've made sure the captions remain synched with the video all the way through; if they don't, run CCExtractor again.

An alternate method would be to only use DVDFab to rip to .vob and then use HandBrake to transcode the .vob to .MP4, but HandBrake's speed at transcoding is roughly comparable to DVDFab's direct rip to .MP4 (I have not tested this on other machines yet).