Visualhub Discontinued | Main | Sony EX3 studio rig

October 7, 2008

DFXP to SCC

Please note, this blog has been archived and now lives at www.discretecosine.com

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);
$myClass->addCaptions(time,caption);
$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)

Posted by at October 7, 2008 2:24 PM | News | Tutorials

Comments

Hi there,

I just found this old post when searching for caption conversion tools.

We are currently developing an open source web app in php that will allow to create captions and descriptive video on line as well as many import export among caption formats.

I'm trying to contact the author of this DFXP to SCC solution and ask him/her about the copyright of the code here posted.

please feel free to contact me to my personal email or through the capscribe.ca website.

Thank you, and looking forward to hear from you soon.

Sincerely,

Antonio Gamba

ATRC University of Toronto,
Capscribe Developer

Posted by: Antonio Gamba at June 8, 2009 1:13 PM