Howto:vbi
From IVTV
The Vertical Blanking Interval (VBI) is part of the video signal that does not carry picture information. Its original purpose is to provide timing necessary for primitive video cameras and monitors to process the signal, but today it carries various ancillary data, such as closed captioning and television program name.
An IVTV device can deliver the information from the VBI to you in various ways. There is a Linux device, called the VBI capture device, from which you can read the VBI information, conventionally named /dev/vbi0. You configure the device with ioctls to deliver particular parts of the VBI data and choose the form in which it supplies it: raw or sliced. Alternatively, you can have IVTV include the VBI information in the MPEG data stream that you read from the encoded video capture device.
There are details on this in the file doc/README.vbi in the IVTV source tree.
ivtvctl has options to control all of these things (via the ioctls).
Contents |
Embedded In MPEG
When you configure IVTV to embed VBI information in the MPEG stream, it embeds it in an IVTV-specific format. I.e. this is not a standard; there is no other known facility that generates this format.
To configure IVTV to embed VBI information in the MPEG stream, you can use ivtvctl --set-vbi-embed. You can query the existing setting with ivtvctl --get-vbi-embed.
IVTV puts the data in Private Stream 1 in the MPEG stream. Each packet is the VBI from one video field. The packet starts with either ASCII "ITV0" or "itv0" to identify it as IVTV VBI data. The details of the format are in the file doc/README.vbi in the IVTV source tree.
Programs that know how to use this data include:
- MythTV
- Mplayer - with patch
- ccextractor
All of these recognize and use the closed caption information in the VBI. MythTV and Mplayer also use the Extended Data Service information (such as program name).
The Mplayer patch is available from Bryan Henderson (bryanh@giraffe-data.com).
One way to know whether an MPEG file captured from an IVTV device contains embedded VBI (which means the device was configured that way when the file was captured) is to run ccextractor on it. ccextractor issues a message as soon as it detects the VBI data, even if there is nothing in it of interest to ccextractor (i.e. the program is not closed captioned).
Similar Formats
Do not confuse the IVTV embedded VBI MPEG format with the way closed captioning and other VBI-type information is embedded in MPEG on a DVD or digital television broadcast. DVDs and digital television broadcasts don't have any vertical blanking interval, so they carry the same information in other (more straightforward) ways within their MPEG streams.
VBI Capture Device
There are two main formats in which you can extract VBI via the VBI capture device: raw and sliced. In the raw format, you get all of the information the video capture hardware captures: 720 one-byte luminosity samples per line. Sliced is a decoded version with the data greatly reduced. For example, for the Line 21 closed caption data, it is two bytes per line (plus metadata generated by IVTV).
Many programs exist to process VBI data from the VBI capture device:
- osc
- zvbi
- zvbi-ntsc-cc
- capture
- libzvbi
- Mplayer (teletext only)
- zapping
- libvbi
- IVTV source distribution - test directory
- vbi-detect
- vbi-passthrough
- vbi
- wss
Old IVTV
In some older versions of IVTV, such as 0.4.10, a bug causes a kernel crash if you try to read sliced VBI from the VBI capture device. There is no plan to fix this, as these are not current releases and the function is of little importance. You can get a patch for this from Bryan Henderson (bryanh@giraffe-data.com).
