Closed Captioning for the Debug-Impaired
Phil Pilgrim (PhiPi)
Posts: 23,514
Attached is an archive that demonstrates a closed captioning object I'm working on. Closed captioning ability is mandated by the FCC for all TV receivers 13" or larger. It allows text to be encoded in line 21 of the video signal, two characters per field of video. I'm using only one of the two available fields, so this works out to two characters per frame, or 600 baud. When captioning is enabled on the TV (usually by a "Menu" selection from the remote), a portion of the picture is blacked out and replaced by the captioning data. Depending on the captioning mode, this could be dialog (in one of two languages), sports scores, news headlines, etc.
For debugging purposes in a Propeller video app, closed captioning has the advantage of not occupying any of the application's screen real estate. It appears in a separate overlay window which can be turned on or off by the user at will. You can use it to monitor variables and inputs, for example, without having to accommodate them within the normal video output.
This is a very early stab at a usable object. Closed captioning uses a rather arcane set of command sequences for setting modes, colors, cursor positions, etc. I haven't yet written any subroutines to encode them from a more approachable command set. So to use it, you need to know the magic words and secret handshakes. These are all contained in Keith Jack's excellent Video Demystified. You can also find them here: www.fcc.gov/oet/info/rules/part15/part15-2-16-06.pdf, starting on page 45.
Anyway, here it is — as is — to try. I'd be interested in hearing about any successes, failures, or quirks you experience. My TV monitor, for example (a Panasonic 13" model from Costco), inserts extra spaces for every command sequence it sees. Monitors smaller than 13" and those not designed for broadcast reception may not work at all, since they're not required to support closed captioning. Also, bear in mind that the closed captioning protocol is stateful. This means that if you want to turn it on and off at your TV monitor, your program will have to resend the configuration commands on a periodic basis. Otherwise the TV won't know what to do when you turn captioning on.
The object captioner.spin gets its synchronization from the TV.spin object, which is required to be running. I've set the video output base pin to 24. Many of you will want to change that to 12 for use with the Demo Board and, probably, most PropSTICK setups.
Cheers!
Phil
Post Edited (Phil Pilgrim (PhiPi)) : 9/5/2006 6:15:46 PM GMT
For debugging purposes in a Propeller video app, closed captioning has the advantage of not occupying any of the application's screen real estate. It appears in a separate overlay window which can be turned on or off by the user at will. You can use it to monitor variables and inputs, for example, without having to accommodate them within the normal video output.
This is a very early stab at a usable object. Closed captioning uses a rather arcane set of command sequences for setting modes, colors, cursor positions, etc. I haven't yet written any subroutines to encode them from a more approachable command set. So to use it, you need to know the magic words and secret handshakes. These are all contained in Keith Jack's excellent Video Demystified. You can also find them here: www.fcc.gov/oet/info/rules/part15/part15-2-16-06.pdf, starting on page 45.
Anyway, here it is — as is — to try. I'd be interested in hearing about any successes, failures, or quirks you experience. My TV monitor, for example (a Panasonic 13" model from Costco), inserts extra spaces for every command sequence it sees. Monitors smaller than 13" and those not designed for broadcast reception may not work at all, since they're not required to support closed captioning. Also, bear in mind that the closed captioning protocol is stateful. This means that if you want to turn it on and off at your TV monitor, your program will have to resend the configuration commands on a periodic basis. Otherwise the TV won't know what to do when you turn captioning on.
The object captioner.spin gets its synchronization from the TV.spin object, which is required to be running. I've set the video output base pin to 24. Many of you will want to change that to 12 for use with the Demo Board and, probably, most PropSTICK setups.
Cheers!
Phil
Post Edited (Phil Pilgrim (PhiPi)) : 9/5/2006 6:15:46 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
...
The object seems to work OK on my cheap Magnavox TV/DVD combo but I haven't beat on it much yet. I did get paint-on captioning working using the PDF doc you included as a guide but pop-on isn't cooperating yet. I'm hoping this weekend will give me more time to play as well as dig into the code.
David
Well, you've taken this way beyond what I've done with it so far! I'm curious: did your TV add extra spaces where the commands were sent? (These will show up as gaps in the demo output where the colors change.)
I think the CC method is an excellent way to add telemetry data to a video stream and shouldn't be too hard to pull off, since you don't have to genlock to the chroma signal. The major disadvantage, of course, is the low baudrate, which could put the telemetry several frames behind the video it applies to. But if you record the video, being able to switch the text on and off at will during playback confers a tremendous advantage over more conventional overlay techniques.
BTW, if you try the '1881, use the composite sync output, and just ignore the vertical and even/odd outputs. The program can deduce these from the composite sync.
I tried putting data in both fields (lines 21 and 284), but didn't get reliable output, there being a lot of missing characters. Solving this would effectively double the baudrate, though.
-Phil
I was watching the NASA channel the other day after the recent launch, and noticed about 1/3rd of the way down on the video feed from the shuttle there appeared to be a ticker tape style data transmission.
It looked to be an alternating 3 byte or 4 byte data packet. Any ideas on what that would be? Just thought it was interesting... even more so to "read" what it is. I assume it's some sort of CC telemetry, perhaps
astronaut vitals.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I went over there and checked. The "data strip" was about halfway down when I first looked and gradually moved up the screen. My guess is that it's not data, but an artifact from the video data compression and display being out of sync with the original feed. I actually see the same thing with the PropCAM when the frame capture isn't programmed to sync with the outgoing video. Except, in the PropCAM's case, there isn't a black line with crawling white stuff -- just a discontinuity in the grayscale display that moves up the screen. That black and white stuff might be a hiccup in the compression algorithm when confronted with lines from two different frames.
-Phil
www.shuttlepresskit.com/scom/23.pdf#search=%22nasa%20video%20time-tag%20sync%22
The out-of-sync time tag is described on page 6.
-Phil
Phil I didn't mean to Off Topic your thread.
From pg 6
"Crews and flight controllers will see this as a thin, flashing, segmented white line that scrolls across the screen of the color monitors and in the downlink video."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Video Demystified describes a vertical interval timecode (VITC), which may or may not be the same thing that NASA uses. Whereas closed captioning only gets 17 bits of data between horizontal syncs, the VITC message is 90 bits (about 0.55uSec each), with the time data encoded in BCD.
-P.
This object might have more uses then just debugging.
It could be used to overlay important information that could be turned on or off.
Now only if someone can come up with a way to inject the CC into line 21 of a incoming video signal, much like overlaying graphics over a signal only this would be done on Line 21 only.
As for those who have never seen CC on line 21 before.
It looks like a grey bar with random jumping patterns on a monitor with overscanning.
Some of our high end capture-cards at the TV studio support video compression that doesn't compress line 21 but every other part of the picture with M-jpeg. This way you can lossy compress the video and not kill the CC signal.
Well sorry if this is sort of off topic.
Many thanks to Phil for this great object.
Fair enough
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Figured it had to be VGA, then re-read the above. Simple edit and voil
My apologies to anyone else who tried this and thought the title text was the closed captioning data.
-Phil
Here, This is what Closed Captioning should look like on a video signal viewed on a TV.
Be sure to enable it on your television set first or that black box won't show up. (This is why it's called "Closed" caption and not "Open")
Closed captions can be enabled or disabled unlike open captioning.
Your TV then overlays the Closed Caption onto a part of the screen if it's enabled.
It was designed for those who are hard of hearing, but in professional video it has found other uses like Cue point marking and Time Codes.