View Full Version : McPoodle - About Your Closed Captioning Tools
slk001
19th August 2002, 16:05
McPoodle,
I have been using your CCASDI.EXE tool and I have encountered a couple of "bugs" (program features?):
1) When it compiles the timecodes, it will sometimes convert a timecode of 00:08:12:00 to 00:08:11:30. Because I have specified NTSC non-drop frame rate of 29.97fps, this causes Scenarist to crash (took me two weeks to find this).
2) For the text to be displayed, if there is an ODD number of characters, it displays okay. If there is an EVEN number of characters, the last character will repeat after an additional space. For example,
{1500}THE MEETING IS TODAY, SO I{EDM}{EOC} - EVEN NUMBER
will display as:
THE MEETING IS TODAY, SO I I (LAST CHAR REPEATED WITH A SPACE).
{1500}WHEN WE GET TO TOWN, I EXPECT{EDM}{EOC} - ODD NUMBER
will display as:
WHEN WE GET TO TOWN, I EXPECT (okay).
Also, could you put in a TEMPORAL check to see if the timecodes are in temporal order? I enter the TC's by hand and an error in the sequence will cause Scenarist to fail to load the file. I did this check (in EXCEL) by converting everything to seconds, then subtracting the previous value, then looking for negative numbers (which would indicate an error).
McPoodle
23rd August 2002, 07:11
I've worked out a fix to # 1 (number of frames sometimes greater than framerate), and I've also incorporated your suggestion (the program will terminate with a message if you repeat timecodes or have any that are earlier than the timecode above it). The error will include the timecode causing the problem, to help you find it.
As for problem # 2 (repeated characters displayed at the end of cpations), I was unable to reproduce it in Maestro. In fact, when I tried to compile with a caption with an odd number of characters, I would get a parsing error until I went back and put an underscore character into the CCD file, assembled to SCC, and replaced in Maestro. I'd rather not try installing Scenarist if possible. considering how much trouble it is to get Maestro working on my W2K machine on a day-to-day basis. The best I can suggest is to double-up the codes and see if that fixes it (i.e. change your sample line to {1500}{1500}THE MEETING IS TODAY, SO I{EDM}{EDM}{EOC}{EOC}). Please report whatever happens, as I am holding up releasing my fixed version of CCASDI until we get this resolved.
--McPoodle (43 at yahoo.com)
P.S. Here are links to the test files I was using, with known good captions before and after the test captions:
http://www.geocities.com/mcpoodle43/SCC_TOOLS/1.ccd and http://www.geocities.com/mcpoodle43/SCC_TOOLS/1.scc: CCD and SCC files for a caption with an even number of characters. The test caption displayed with no repeated characters on my TV.
http://www.geocities.com/mcpoodle43/SCC_TOOLS/2.ccd and http://www.geocities.com/mcpoodle43/SCC_TOOLS/2.scc: CCD and SCC files for a caption with an odd number of characters. Maestro refused to compile the project with this file.
http://www.geocities.com/mcpoodle43/SCC_TOOLS/3.ccd and http://www.geocities.com/mcpoodle43/SCC_TOOLS/3.scc: CCD and SCC files for a caption with an odd number of characters, followed by the underscore character. Maestro compiled this project, and the caption displayed with no repeated characters.
slk001
23rd August 2002, 16:02
McPoodle,
For my original problem #2, Scenarist would act as I discribed in my original message. DVDMaestro would act just like you discribed (the ol' nasty PARSING ERROR). My fix for #2 was to examine the compiled XX.SCC file. In it, you will find sequences like this:
AEBF 12DD 3133 20 9402 9402
with the " 20 " (ie, SPACE, 20, SPACE) representing the "odd man out". To fix it for Maestro, I just searched for " 20 " and replaced it with " 2020 " (or maybe, to save bandwidth, I should just delete them). I got the last character in a line to be a space by always putting a SPACE at the end of the line (I use EXCEL to format the text file, so this was pretty easy and this is why my "odd number" never gave an error and my "even number" does). I get the feeling that Maestro is only satisfied with input codes that are in groups of 4.
You could put in a test like IF (LEN(TEXT$) MOD 2) > 0 THEN TEXT$ = TEXT$ + " "
This would always guarantee an "even" number of text characters (for me, anyway, with my extra SPACE at the end). You put in the UNDERSCORE character - a SPACE works just as well (and doesn't appear on the screen).
Let me know when you have something to test.
mpucoder
23rd August 2002, 16:15
You should also be able to insert a null (80) after any single character.
Closed captioning is always done 2 characters per frame, and control sequences (like 9402) must always be repeated.
slk001
23rd August 2002, 18:38
I had hope that the "repeating" of the control codes was only "a good idea" and not mandatory. This is because I was running into problems with bandwidth when the dialog is moving very fast (at 2 characters a frame, or one control character a frame, I was running out of BW very quickly). I thought that I would "cheat" and only send one control code, instead of a pair. The result was that the machine recognized that there was closed captioning available, but nothing was ever displayed.
It would have been nice if the CC's would have displayed, because this would have allowed about ten more characters to be sent in a two second period.
The problem with a "null" is that it is a control character (91B9), so would take up 4 times the BW as a SPACE.
mpucoder
23rd August 2002, 19:23
Wrong null - CC is padded with 80 (ascii 00 + parity), so, if you have an odd number of characters preceeding a control sequence, add 80 as the last character. In your example "AEBF 12DD 3133 20 9402 9402" becomes "AEBF 12DD 3133 2080 9402 9402" (although the trailing space could also be removed)
I should also mention that control sequences always have the escape (10-1f w/o parity) as the first of a pair of bytes, never split across frames.
edit: I guess ASCII calls it "nul"
McPoodle
25th August 2002, 06:43
OK, I've put a new version of SCC Tools out at http://www.geocities.com/mcpoodle43/SCC_TOOLS/SCC_TOOLS.ZIP. Here is a list of changes:
[list=1]
Fixed the timecode rounding bug (# 1 in slk001's post) in RAW2SCC, CCASDI, and CCADJ.
Added check for out-of-order timecodes in CCASDI and CCADJ.
I've discovered that the closed captions that can be added to VCD's are in the (broadcast) raw format, so I added a new tool, SCC2RAW, to the set.
Described SCC2RAW in the documentation (http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_TOOLS.HTML#scc2raw), along with fixing numerous typos. In addition, I decided to call "_" in the CCD description the blank character instead of the null character to avoid confusing it with the null code {}.
[/list=1]
McPoodle
26th August 2002, 05:29
OK, I finally broke down and installed Scenarist (it is a lot easier to launch on a W2K PC than Maestro). I tried all three of my test files (see my earlier e-mail), and this is what I found:
The SCC file with an even number of characters (http://www.geocities.com/mcpoodle43/SCC_TOOLS/1.scc) displayed correctly.
The SCC file with an odd number of characters (http://www.geocities.com/mcpoodle43/SCC_TOOLS/2.scc) displayed with the second-to-the-last character repeated immediately after the last character (i.e. " IF" displayed as " IFI").
The SCC file with an odd number of characters followed by the blank character "_" (http://www.geocities.com/mcpoodle43/SCC_TOOLS/3.scc) did not display at all, although I don't know why.
So the question to slk001 is, are you sure there are no extra spaces in the CCD file before you translate with CCASDI? Maybe you can try my files and see what you get. Also, it appears that you can get away with no repeating codes and even leaving {RCL} out of most captions, so long as it's in the first caption.
slk001
26th August 2002, 16:22
Here's a sample of my text file (you may have to adjust your margins):
00:13:46:03 {RCL}{RCL}{1500}{1500}THE PRESENT SITUATION? {EDM}{EDM}{EOC}{EOC}
00:13:47:27 {RCL}{RCL}{1400}{1400}I MEAN THE REASON FOR MY COMING {1500}{1500}HERE... {EDM}{EDM}{EOC}{EOC}
00:13:49:27 {RCL}{RCL}{1400}{1400}WE'RE VERY CURIOUS ABOUT THAT {1500}{1500}TOO... {EDM}{EDM}{EOC}{EOC}
I add a space after each line of text. I input these using EXCEL, and I was going to write a macro to either add this space, if the number of characters in the string was odd, or not add it if the number was even. The extra space also means that any extra will always appear in the .SCC file as " 20 " (since your program seems to always group the control characters in byte pairs). This makes it easy to do a search and destroy on the extra space.
You said that I could leave out most of the {RCL}{RCL} commands. Under what circumstances should they be included? Or, where can I take them out?
McPoodle
27th August 2002, 05:17
I think you can get away with {RCL} in just the first caption displayed. This would work out to the very first caption and if your video is divided into chapters someone can navigate to, the first caption for each chapter.
slk001
28th August 2002, 15:42
I was able to eliminate the {RCL}{RCL} everywhere except at the beginning and at all chapter points. Really seems to speed things up. One remaining question: What exactly does the time code mean? Is this the time that the decoder begins reading the caption info, or is this the time where the caption will first pop onto the display? I ask, because it seems like the longer the length of the caption, the more that it is temporally out of sync.
slk001
29th August 2002, 22:46
One problem with leaving out the {RCL}{RCL} sequences. You can't turn on CC's during the movie and get them to show up immediately. They won't begin showing until you reach a {RCL}{RCL} sequence (currently, at chapter points).
McPoodle
31st August 2002, 04:12
For the timing, the caption is not displayed until the {EOC} is reached, since that is the code to display the caption composed in the buffer. The timecode applies to the first item after it (usually {ENM}, {RCL}, or {EDM}). Each code takes one frame to transmit, the same with each pair of characters. So, for the line
00:13:46:03 {RCL}{RCL}{1500}{1500}THE PRESENT SITUATION?{EDM}{EDM}{EOC}{EOC}
the caption will display at 00:13:46:21 (7 codes and 11 pairs of characters after 00:13:46:03).
And you're right about the {RCL}'s being needed to display the caption when switching them on and off manually. At least you got rid of the optional {EDM} tags before the {RCL}.
McPoodle
14th October 2002, 06:30
I've just put a new version of SCC Tools out at http://www.geocities.com/mcpoodle43/SCC_TOOLS/DOCS/SCC_TOOLS.HTML. The most important change as far as this thread is concerned is the addition of a new flag (-a) to the CCASDI program. Using this flag will adjust the timecodes so that for SCC files the timecode is the start of the caption (and therefore up to three seconds before the caption is displayed), while for CCD files the timecode is the time the caption is displayed.
The major problem I anticipate coming out of this change is when the caption takes up more than one line in the SCC and CCD files (which would have happened if you used the previous version of RAW2SCC on long-line captions to create the SCC/CCD files). You can either manually adjust the CCD files to put one caption on each line (starting with {RCL} or {EDM} and ending with {EOC}), or else go through the following chain:
[list=1]
CCASDI (without the -a flag) to get a SCC file
SCC2RAW to get a raw CC file
RAW2SCC to get a SCC file without multi-line captions
CCASDI with the -a flag to get a correct time-adjusted CCD file
[/list=1]
wilson2k
17th December 2004, 15:03
Can somebody send me the SCC Tools? I can't find them anywhere!!
You will be appreciated!
My e-mail address: wilson3000@163.com
Thank you!
mpucoder
17th December 2004, 15:09
Are you not able to use the link in the post above yours? On the page that McPoodle links to is another link for the download, on the first line.
wilson2k
17th December 2004, 15:43
mpucoder,
No, I can't open the link at all! But I want desperately to get these useful tools.
Please tell me how to get them, or could you please send them to me if you have them. Thanks a lot!!
mpucoder
17th December 2004, 16:25
It's about 4M, so I mirrored it at http://www.mpucoder.com/doom9/SCC_TOOLS_3_1.ZIP
wilson2k
17th December 2004, 18:24
mpucoder,
Thank you very much! Now I can get the tools and I will play with them a little bit to see if they work for me. I think they will work just fine. I will let you know the result.
You are appreciated!:)
wilson2k
18th December 2004, 10:01
mpucoder,
I have tried the tools and they are just great!! Thank you for your help!
And since I am new here, I'd like to ask you some more questions. I will appreciate your answers.
I am doing some DVD backup and re-authoring, and I would like to include the OST CD's tracks on my DVD. Thus I can have them together on one DVD+R DL. But I have no idea how to make it done. Would your please show me the know-how or tell me where to find the information?
Thanks a lot!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.