Re: [Zapping-misc] Using libzvbi to extract captions/XDS from raw caption bytes
Status: Alpha
Brought to you by:
mschimek
From: faginbagin <my...@hb...> - 2011-06-09 03:56:16
|
Hi Brian, On 6/8/2011 7:53 PM, Brian Enigma wrote: > I have what I believe to be a simple goal that I'd like to achieve > using libzvbi, but after going through the documentation and > tinkering with some test code, I am unable to get zvbi to do what I > need. > > Basically, I have VBI bytes as input. It's not attached to video, > it's just raw ATSC "line 21" bytes, each one starting with the four > characters "GA94" and 0x03 and the other assorted header bytes, > followed by the actual 608/708 triple-byte payloads. As output, I'd > like to get callbacks for captions and XDS data so that I can > programmatically grab the parsed data. It looks like I should be > able to just instantiate a decoder (vbi_decoder_new), add an event > handler (vbi_event_handler_add), then repeatedly throw bytes at it > (vbi_decode) and get callbacks. I'm not sure I quite understand the > vbi_sliced struct. I've tried loading my raw bytes into the "data" > field of vbi_sliced (using a couple of different offsets -- including > the GA94 ATSC header, just after it, starting at the first 608 byte > triplet, etc.) with no luck. I also tried vbi_raw_decode to see if > that will take my raw bytes and package them in a vbi_sliced data > structure. So far, I haven't gotten anything to work. > > I'd like to try out and step through the example code to see what > sorts of bytes they are pushing around, but the apps that take file > inputs seem to want to initialize some /dev device that I don't have, > even when I just point them to files. (I don't have any sort of > special video capture hardware.) > > What am I doing wrong and/or what is the correct way to do this? > > -Brian I have an application that does something similar. It uses mythtv's version of ffmpeg to parse ATSC recordings to get at the EIA-608 caption data, then feeds that data to libzvbi. I use libzvbi's support for generating .png files to create images I can later use with dvdauthor's spumux to convert closed captions into DVD subtitles. If this sounds interesting, you can find more details, as well as a link to the source code here: http://www.hbuus.com/cc2subtitles/ HTH, Helen |