As promised, I’m posting some sample code for converting from DFXP to SCC. Actually, the SCC generated is contained in a class (captionConvertClass.php) independent of the DFXP parsing. To use it, all you do is:
$myClass = new captionConvert(startingTimecode);
$finishedCaptions = $myClass->outputCaptions();
the “startingTimecode” item is somewhat important. Quicktime files can have timecode tracks that don’t start at zero, but DFXP captions are always relative to a 00:00:00.00 start time. So, if the timecode track of your movie begins at 01:00:00:00 (as any file coming out of FCP will) but your DFXP file starts at 00:00:00.00, you need to let the convertor know so that it adds the right times.
Otherwise, it’s pretty simple and pretty basic. There are lots of things it doesn’t do (scc formating, proper Drop Frame handling, foreign characters, etc). But at least it’s a start. If you want to see conversion done right, look at SCC Tools, which is much more feature complete, at the expense of being much more complicated and … perl.
captionConvert.phps (sample dfxp parsing)
captionConvertClass.phps (plain text -> scc conversion)