Monday, June 20, 2011

Troubleshooting SCC (Line 21) Caption Files

From time to time you may get an error in your SCC caption files. Here is a (hopefully) helpful strategy for zeroing in on the cause of the problem. Knowing that it is a bad file in the first place is simple. I try to open it in QuickTime Pro. To be able to do this, however, you need to download a free plugin from Apple for importing SCC files into QuickTime. It is called "ClosedCaptionImporter.component". It can be downloaded (currently) from this link: http://developer.apple.com/library/mac/#samplecode/ClosedCaptionImporter/Introduction/Intro.html.

Once you download it, just drop the plugin into your QuickTime folder in your hard drive's Library folder...

Put the closed caption importer plugin into your hard drive's QuickTime folder in the Library

If you have QuickTime 7 open, you'll need to close it to make the plugin available when you re-open it. Note that as of this writing, QuickTime 7 is necessary for all the features of QuickTime Pro to work. QuickTime X, the default QT Player that comes standard with Snow Leopard does not have all the functionality of QuickTime 7. You can install QuickTime 7 from your Snow Leopard install disk, then upgrade it to QuickTime Pro via the Apple website. It only costs $30 and it well worth it for the increased ability to work with QuickTime movie files.

So, as long as you have the plugin installed you should be able to see captions in an SCC file that you open in QuickTime Pro. It should look like this...

A working SCC file in QuickTime Player

It should have a white background and if you scrub through the movie, you should see captions. A file that has errors will open like this...

A non-working SCC file in QuickTime Player

It will have a black background, it will display smaller than a working file, "Scenarist_SCC V1.0" will show at first, and the binary code will display instead of the transcribed captions if you scrub through it. If you see that, then you know you have troubles in River City. Sometimes, though, an SCC file can have a garbage character in it that may allow it to play in QuickTime properly, but will cause an error in other applications.

To troubleshoot this, I'll open the SCC file in BBedit or the free version called Text Wrangler, available from Barebones.com. Here I'll do a quick scan to look for certain types of anomalies. Here are a few types of things I might look for.

A blank caption after the timecode. All lines must have at least some formatting applied, even if there is no text in the caption.

SCC line with a blank caption

Another thing to look for is unpaired binary code. Every set of alphanumeric digits should be in sets of four usually, although they can come in twos, I believe. MovieCaptioner always creates them in sets of four digits. If you see anywhere where a line ends with a 3 digit number instead of 4, there's probably trouble there. Sometimes this could be caused by a character in the captions that is not supported by the SCC format which can goof up the sequence of numbers.

a 3 digit SCC line with an unsupported character

In the example above, an unsupported character is showing up as a bullet. Instead of it being a 2 digit number to represent the character, it is only one digit, which throws off the rest of that line. Note the last number sequence is only 3 characters long as a result. This will throw an error when it goes to display in QuickTime. The line should have ended with " 942f", but instead it is " 42f".

The other more difficult thing to find is what's known as a timecode overrun. In the SCC format, each caption needs about 1 frame of buffer time per every 2 letters of a caption. If you add all that up and subtract if from the timecode for that line, it should not be less than the timecode preceding it. So the caption "I may be going now" might need 18 frames of buffer time to display. Subtracting 18 frames from its timecode should not run into the timecode of the previous caption. This seems to vary, however, with different captions, so I've not found it to be a hard and fast rule. If someone would verify what this is exactly, I'd love to know myself. Before you can do anything about this, however, you need to find the caption (or captions) that have timecode issues. I do this by opening the SCC file in my text editor and using cut and paste, I test out sections of the file. I will typically select and cut all the captions from the midpoint of the file till the end and save it. I will leave the text editor open while I test the saved SCC file in QuickTime Pro. That way I can undo my cut and try again. I'll drag the SCC file onto the QT icon and see if it opens properly. If it does, I know that the error lies in the last half of the file. I will keep splitting the file in this manner until I get it to work again and then not work again, so I will eventually home in on the line that's giving me the problem. Once I identify the offending line, I will look it over for anomalies as above. If I can't find any, I look at the timecode and count the characters to give me an idea of whether or not the timecodes may be too close. If they do look close, I will start to add frames to the offending line's timecode and saving, then testing in QuickTime Player until I get it to work. I'll then make sure there are no other lines in the SCC file that are causing such problems. These timecode overruns typically are caused when 2 or more captions are long and come in rapid succession. I will sometimes have to abbreviate words or divide the captions more evenly to iron out this problem.

But how do you find the captions in your project when all you can read is binary code??? Well, I've got an answer for that. It's called SCC Caption Decoder, a lightweight application that will decode an SCC file and save it as a text transcript that is human readable.



This really helps. After running the file through SCC Caption Decoder I can look for that same timecode where the problem was and know what the captions says so I can find it in my caption project. You can't just go by timecode necessarily because for the SCC format, the buffer time is built into the caption's timecode, so even though you set a caption at 00:04:21:07, the buffer time might change it to 00:04:20:01, for example. SCC Caption Decoder can also convert the time to what the original time was if you select the optional radio button. If you don't need the timecode, it can also save it in paragraph text form as well. It's a handy little tool for people who work with SCC captions a lot, and is really great if you just want a text transcript of what an SCC file contains. Give it a try. There are both Windows and Mac versions and you can try it out for 7 days. Cost to purchase is only $19.95. A convenient tool to have in your arsenal.

decoded SCC file as readable text

Please try MovieCaptioner to make your movies accessible. You can download a free 14 day demo.

8 comments:

  1. Hi Patrick,

    Thanks for this info. My problem is, I have the caption working over a white background, but how do I composite the text over the footage so I can see the captions keyed over the video.? I'm trying to do this in Quicktime Pro 7.x

    Any help would be really appreciated!!

    Thanks,
    Kirk

    ReplyDelete
  2. Kirk,

    You can do it on a Mac if you have QuickTime Pro and the ClosedCaptionImporter plugin for QuickTime (email me at synchrimedia@gmail.com for that). In fact, the Mac version of MovieCaptioner will embed the SCC file for you. Otherwise you can use Subler to add your SCC file to an MPEG-4 (MP4) movie. Subler is a free app created by Google that you can download here: http://code.google.com/p/subler/

    ReplyDelete
  3. Hello,

    I am using scc caption reader and found some errors in the txt file which was created with caption reader, now how can I correct those errors and make error free scc file.

    ReplyDelete
  4. Kumar,

    What type of errors did you find? Typically, if it's an error caused by an unsupported character such as a curly apostrophe, smart quotes, ellipses, em-dash, or similar characters it will show up as a bunch of non-sense characters in the file that SCC Caption Decoder creates.

    You could try importing the SCC caption file into MovieCaptioner (if it was not created by MovieCaptioner) and then look for that caption and retype it at the point where you get the garbage characters.

    Otherwise you may be able to type in the proper code for the bad characters using this link as a reference: http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/CC_CHARS.HTML
    Note how lines in the SCC file end, however, and there is also some spacing/new line characters that may cause you issues if you do it that way. SCC captions can only have up to 32 characters per line.

    ReplyDelete
  5. Regarding Patrick's "divide and conquer" method to find .scc file timecode issues, I have written an AppleScript to do that:

    http://gildawson.com/Find%20First%20Bad%20scc%20line.scpt

    --Gil

    ReplyDelete
  6. This is fantastic Gil! Thanks for sharing your solution. I'm sure many will find this helpful.

    ReplyDelete
  7. Patrick,

    Where do I put the component if I'm on Mavericks? I don't see a Quicktime folder here: HD/Library/

    ReplyDelete
  8. in Finder, go to the Go menu and select "Go to folder..." then type this into the form field:
    ~/Library/QuickTime

    ReplyDelete