[MEncoder-users] ATSC closed captioning

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 7 22:16:16 CET 2010


On Sun, Nov 07, 2010 at 11:24:38AM -0800, Scott W. Larson wrote:
> The biggest problem is that the caption data arrives with the frames
> associated with the captions. That means they'll be out of order as they
> arrive so you have to put them back in order. My code stored them in a
> linked list in pts order and sent them to the existing EIA-608 caption
> code when the frames were displayed.

In the long-term it would probably be best if libavcodec could extract
the user data and return it in an AVFrame along with the decoded image.

> Unfortunately I found some bugs in the existing caption code and had to
> make some improvements. Since I don't have any other EIA-608 test cases,
> I had no idea if I was breaking things. The code was really old but for
> all I know it had been working perfectly for earlier caption systems.

Yes, it worked really badly for me, and as said I couldn't really
find a way to reconcile it with any specs or anything I could find.

> Also back in 2005, if you submitted code here that had a superfluous
> cast or needlessly initialized a variable, you were publicly declared an
> idiot even if everything worked. I already know I'm an idiot, thank you
> very much!

I don't know what exactly was going on, however review comments really
shouldn't be taken personally, there are very few people reviewing code
and they get to see the same "mistakes" over and over get tired of
explaining everything, so it can easily sound worse than it was meant...

> I still have the old patch if anyone wants to do anything with it. It
> has lots of comments.

I suspect the reordering code etc. is likely to not be in a way
I'd like to have for maintainabilty reasons, however the bugfixes
would be interesting, should make it easier for me to figure out
which parts of the code I just don't get vs. where the code is broken.

> > Unfortunately I haven't been able to match any specification
> > up with the data that is actually in those streams, and I
> > have neither enough samples nor do I care enough to reverse-engineer
> > the format.
> 
> No need to reverse engineer. All ATSC specs are published and
> well-documented, either in the documents at atsc.org or on wikipedia.
> Even I was able to figure out how to display the EIA-608 data.

Well, the part how you find the EIA-608 part was rather unclear to me.
I think I figured it out now though.

> The
> CEA-708 captions would require serious graphic support since it can
> create text windows, change font colors, and draw captions aligned with
> nine different screen locations.

I doubt much of that is really necessary for something that works for
most people.
However already just reassembling the packets across frames sounds
like a pain, particularly within the current code.


More information about the MEncoder-users mailing list