Log in Register FAQ Memberlist Search pcHDTV Forum Index
pcHDTV Forum

pcHDTV Forum Index -> General pcHDTV topics -> Question: Closed Caption? Goto page 1, 2, 3, 4  Next
Post new topic  Reply to topic View previous topic :: View next topic 
Question: Closed Caption?
PostPosted: Sun Sep 11, 2005 7:38 pm Reply with quote
dr_nikon
Guest
 




I plan to buy HD-3000 card but no idea about any closed caption.

We do not have any pay cable tv or DirecTV (part of TIVO or DVR). Not worth to spend $$ on many channels. Just watch ABC, NBC, PBS, CBS. WB and FOX.

I am interested in HDTV card but no idea about Closed Caption. Yes. we have Panasonic plasma EDTV with built in ATSC. Sometime, I need to have record from over the air antenna (use HDTV)

I am not sure what I need any special software (Closed Caption) or computer connect to Panasonic EDTV or burn DVD then put DVD in DVD player connect to Panasonic EDTV.

Thank you for try to help me
PostPosted: Mon Sep 12, 2005 4:51 pm Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




Unfortunately the EIA-708 standard used to deliver closed captions in HD is not well known so there's no free software that can decode them yet. A few months ago I couldn't find a damn thing about this standard on the Internet (although there were lots of expensive books that described it) but finally someone posted a Wiki article that explains it so there's a chance that it will show up in free applications like xine and mplayer soon.
View user's profile Send private message
PostPosted: Tue Sep 13, 2005 9:58 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




Last night I decided to not do the important things I was supposed to do and look at this. mplayer already has code to extract and print the user data in MPEG headers (look at process_userdata() in libmpdemux/video.c). I turned that code on during MNF and saw "47 41 39 34" which is the ATSC identifier for EIA-708 captions. That was followed by "03" which means there was caption data right there. Awesome!

Things looked even better when I checked the cc_type flag in these packets. EIA-708 supports two kinds of captions: the new fancy shmancy DTVCC captions which support 63 caption streams and all kinds of fonts and colors, and the old "Line 21" EIA-608 captions which are already supported in mplayer (sub_cc.c). cc_type was always either NTSC_CC_FIELD_1 or NTSC_CC_FIELD_2 indicating that every station in town is passing the old EIA-608 captions. This isn't surprising since they're all extracting the captions from their SD feeds (even after all these years, it's still up to the affliliates to put captions in their digital channels). This meant that all I had to do (according to the standard) was pass the remaining EIA-608 data to subcc_decode() and we'd have captions in HDTV!

Of course it didn't work and so far I don't know what's wrong. The first suspcious thing is that every packet had the same amount of data (cc_count was always the same) and every packet was valid (cc_valid bit was set). Since there was user data on every packet with an I-frame (I think), I was seeing a continuous stream of caption data instead of chunks of data at random intervals like captions normally display. Of course a lot of that data wasn't anything that subcc_decode() recognized so I'm doing something wrong.

I'll have to take a closer look at the flags that indicate valid caption data (there's some "if this and that but not that other" logic I may have misunderstood) and get a better understanding of how EIA-608 captions work so I'll be able to recognize when I'm getting data good enough to pass to subcc_decode(). I think I'm doing pretty well for two hours of work with something I knew nothing about.
View user's profile Send private message
PostPosted: Tue Sep 13, 2005 1:27 pm Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




Oh I see what I was doing wrong. I was checking only the first cc_data_pkt and assuming that one packet described all the data that followed it.

The data is actually a series of independent 24 bit cc_data_pkt's and each one of these packets have to be processed individually. Each packet's cc_type flag only describes what's in the next two bytes (cc_data_1 and cc_data_2). Those bytes could be EIA-608 data, EIA-708 data or just padding if the cc_valid flag isn't set. This allows them to send both caption formats at the same time. The ATSC encoder probably does send the same number of packets with every I frame and just marks the unused packets as invalid.

So I'll have to scan the data for valid EIA-608 packets, collect their data two bytes at a time, and pass that data onto subcc_decode(). If I'm right, this will still be very easy.

Someone will need to do some serious programming when stations start using DTVCC captions. That is probably several years away since they can barely get the EIA-608 data right at this point. My WB station had to shut down its HD feed for a few weeks because the hardware that inserts the ATSC captions was screwing up. They couldn't legally broadcast HD without proper ATSC captions.
View user's profile Send private message
PostPosted: Tue Sep 13, 2005 9:18 pm Reply with quote
dr_nikon
Guest
 




I remember that older ATI TV (NTSC) Card and software. They have closed caption but I never try it by myself at home. NTSC is outdate

No idea about PVR or DVR PC or HD DVR or record HD programming from HDTV Card/ATSC (over the air). I wish to playback from computer's HD or burn DVD or CD disk then CD/DVD Disk in regular DVD player connect to Panasonic Plasma EDTV. Set up closed caption "CC1". Will it work? (avoid to use MPEG or AVI)

I think HDTV PC Card is not like TIVO or DVR. What kind of format in TIVO?
PostPosted: Tue Sep 13, 2005 9:34 pm Reply with quote
Guest
 




Scott Larson wrote:


EIA-708 supports two kinds of captions: the new fancy shmancy DTVCC captions which support 63 caption streams and all kinds of fonts and colors.


Yes, my Panasonic 37" Plasma EDTV has built in ATSC. I can set up color font, size, color background and style fonts.

One time, I bought Westingthouse LCD TV plus HDTV receiver. HDTV receiver gave us pain in the neck with DVD player and HDTV receiver in closed caption. Returned it then bought Panasonic with built in ATSC. My opinion about Westinghouse LCD TV is very nice image but not right kind for us.
PostPosted: Tue Sep 13, 2005 10:20 pm Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




Anonymous wrote:
Yes, my Panasonic 37" Plasma EDTV has built in ATSC. I can set up color font, size, color background and style fonts.

You can do that with the captioning on NTSC TV's these days. The DTVCC captions (when stations start using them) will change fonts, colors and sizes automatically. It can also create multiple caption windows and lots of other features no one will ever use or need.

Sadly I'm not having any more luck with my code changes. The supposedly EIA-608 data I'm looking at is certianly not EIA-608. It should have lots of hex FF's and FE's and control codes in the hex 10-1F range, not to mention a lot of ASCII characters. I'm not seeing any of this stuff at all. Here's a stream from the NTSC_CC_FIELD_1 packets:

(lots of 80's) ...
Code:
80 80 80 80 94 AB 94 '&' 94 AB 94 '&' 94 AD 94 AD 94 'p' C1 'L' 94 'p' BA ' ' 'W' CE
C4 'O' 'T' 'O' 80 80 'W' CE 80 80 80 80 80 80 ' ' C1 C1 CE 'T' 'L' 'T' C1 80 80 80 80
80 80 CE 80 ' ' 'O' 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ' ' C1
80 80 80 80 C1 'R' ' ' 'W' CD 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80

and then lots more 80's. Clearly the hex 80's are some kind of padding and there are bursts of some kind of data but none of the bytes in those packets work with the EIA-608 decoder in any way. For example at some point in an EIA-608 stream there has to be a hex 14 followed by a hex 2C otherwise the caption will never be displayed. I have to assume that this standard posted on Wiki (and duplicated verbatum all over the Internet) is just wrong.

I mean it has to be wrong. On most stations, the process_cc_data_flag is always set to false. According to the standard, you're never going to get captions from those stations. That can't be right.
View user's profile Send private message
PostPosted: Wed Sep 14, 2005 10:43 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




I found one more possibility. All of the EIA-708 standards on the Internet say that valid EIA-708 data always has user_data_type_code field set to 0x03 so I've been throwing away all data that doesn't have that. Howver, I stumbled across one document from the SCTE that describes other valid codes for that field. The most interesting one is 0x04 "additional_EIA_608_data". If I understand it right, this gives the encoder yet another way to send the old EIA-608 format captions through ATSC. In this case all the packets in the data will contain EIA-608 data and there will be no DTVCC packets.

Remember I noticed that most stations have process_cc_data_flag set to false? Maybe all of their 0x03 data is false. Maybe they're sending all of their captions with this 0x04 "additional_EIA_608_data" tag. This would make sense since they're really just pulling the EIA-608 captions from their SD feed and they have no DTVCC captions to send with them. Since I've been throwing away all data that wasn't tagged 0x03, that would explain why I'm not having much luck!
View user's profile Send private message
PostPosted: Wed Sep 14, 2005 8:50 pm Reply with quote
dr_nikon
Guest
 




Thank to Scott for help.

Last night, I found some info from ATI's HDTV manual at
http://www2.ati.com/manuals/hdtvwonder.pdf

Let you read page 24 (30 of 58)
PostPosted: Thu Sep 15, 2005 8:59 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




There's really no technical information in their manual, just that their software decodes EIA-708 captions.
View user's profile Send private message
PostPosted: Thu Sep 15, 2005 9:12 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




What I think what's wrong with the byte stream I'm extracting is that every byte is odd parity so I may just have to rip off the upper parity bit on every byte. That would turn those 80's into 00's which are proper padding bytes and the 94's become 14's which is a proper EIA-608 control code. This doesn't turn it into a EIA-608 byte stream exactly and some of the characters are still wrong but it does make it a lot closer.
View user's profile Send private message
PostPosted: Thu Sep 15, 2005 12:27 pm Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




Yeah, the parity bit was part of the problem. Now for a more difficult problem -- the packets are out of order. For example, this byte stream from The Office:

Code:
ifBut re thee, werd I'robe


should be displayed:

Code:
But if there were,I'd be"


The two-byte packet order was 2 3 1 5 6 4 8 9 7 11 10 13. That means they're putting the captions on frames that can be out of order (jerks!) so I'll need to write some fancy code that sorts the caption packets by PTS or something.
View user's profile Send private message
PostPosted: Sat Sep 17, 2005 1:30 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




So if any out there isn't bored hearing about closed captions in HDTV, I finally figured out how to associate the pts's of these out of order frames with the caption data they contain. I don't have the code to sort them yet, but printf's of the data to a file with a "sort -n" will turn this random garbage:

Code:
704.584167: t.
705.451660: if
705.384949: Bu
705.418335: t
705.551758: re
705.485046:  t
705.518433: he
705.651855: e,
705.585144:  w
705.618530: er
705.852112: d
705.818726: I'
705.952209: ro
705.885437: be
705.918823:  p
706.052307: ed
705.985535: te
706.018921: ct


into this:

Code:
705.384949: Bu
705.418335: t
705.451660: if
705.485046:  t
705.518433: he
705.551758: re
705.585144:  w
705.618530: er
705.651855: e,
705.818726: I'
705.852112: d
705.885437: be
705.918823:  p
705.952209: ro
705.985535: te
706.018921: ct
706.052307: ed


so this will just be a matter of adding the packets to a sorted linked list or maybe a cheesy buffer array and passing packets to the EIA-608 decode function when the master clock has advanced past their pts's. Genius! Very Happy

BTW, stations are required to pass both EIA-608 (VBI) and EIA-708 (DTVCC) data. Why? Because If an ATSC receiver is connected to an NTSC TV (which is a likely occurance in the transition to digital broadcasting), the receiver is required to generate the old VBI Line 21 captions from the ATSC stream so the old TV will still have closed captions. This is enough to make me put off writing the DTVCC code for a while!
View user's profile Send private message
PostPosted: Sun Sep 18, 2005 8:34 am Reply with quote
dr_nikon
Guest
 




Scott...
I am just curious about you. Are you programming? What kind of computer language, do you familiar? I am not sure this code is part of Assembler Language?
DR
PostPosted: Mon Sep 19, 2005 10:08 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




I have almost everything done and I'll be submitting a patch to the mplayer people as soon as I can figure out how to do that properly. There is still one bug that's causing every caption to make XvMC retrace continuously. It only happens occasionally and it's very annoying since it makes the screen jumpy. Turning off captions stops the retracing. I'm hoping there's something in the XvMCSubpicture code that's not set up right.

The code supports EIA-608 CC1 captions that stations are passing along with their DTVCC captions. As I said previously, the FCC requires DTV stations to pass both EIA-608 and DTVCC captions but I've found one local station that's only passing DTVCC captions. Technically they're breaking the law. Some stations also pass CC2 data but that's not too interesting (mostly info you can get from the PSIP stream) so it's ignored

One local station sends the captions ridiculously late, like three or four seconds behind the sound. This also breaks the FCC requirement but I guess no one has complained about it yet. Perhaps the station's DTVCC captions are closer and no one is using the EIA-608 captions. I might be able to make this adjustable in the mplayer code, but it's hard to display a caption that hasn't arrived yet.

I had to add support for two line and three line "roll up" captions since mplayer only supported "pop on" captions. EIA-608 also specifies four line roll up captions but I haven't seen those used yet. I should probably support them anyway.

Ultimately this stuff should be added to xine (which looks complicated) and it should support some subset of DTVCC captions since those should be more reliable.
View user's profile Send private message
Question: Closed Caption?
  pcHDTV Forum Index -> General pcHDTV topics
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 4  
Goto page 1, 2, 3, 4  Next
  
  
 Post new topic  Reply to topic  


Powered by phpBB © 2001-2003 phpBB Group
Theme created by Vjacheslav Trushkin