VLC and V4L2 closed captioning

Just wanted to give you all a heads up on some stuff we’ve been working on:

Closed captions for the hearing impaired seems to be one of those features that is ignored all too often in Linux TV. Application support is poor, driver support is rarely present. Being a little hard-of-hearing myself, I can appreciate though why this would be important though.

In the past KernelLabs has added driver support for em28xx based devices, saa7164 (better known as the HVR-2250) and the HVR-950q, and done a bunch of work on the tvtime application to better support it.

Going forward, KernelLabs has been contracted to improve closed captioning support for the popular VLC application. I’ve got patches to make it work with V4L2 devices, and I’ve started to look at improving the quality of the EIA-608 decoder.

But wait! If you go to the VLC features page, it says that it already supports closed captions! Unfortunately, if you actually try the functionality, the definition of “supports” means:

  • No support for colors
  • No support for styles (bold, italics, underlining)
  • No support for positional placement of captions
  • No support for mid-row codes
  • All captions are rendered horizontally centered at the bottom of the screen
  • Certain international characters are not rendered properly, including some popular ones such as ‘¡’ character commonly found in Spanish.

We look forward to making improvements in this area, meeting the FCC requirements in providing a compliant EIA-608 decoder.

The work has also uncovered several bugs in different drivers, for which I have already started submitting patches to the linux-media mailing list.

7 thoughts on “VLC and V4L2 closed captioning

  1. Does this imply that EIA-608 closed captions are already supported, but with those limitations? We have been trying to get captions to work in VLC with the 950q tuner on analog channels with zero success. The captions display fine when using zvbi-ntsc-cc so we know the tuner and driver support them, but getting them to show up in VLC is a different story. Have you made any progress on this?

    • Devin Heitmueller

      Hello Nick,

      There are two phases to the project: the first is getting EIA-608 decoding support to work with V4L2 devices in general (such as the HVR-950q). The second phase is improving the VLC EIA-608 renderer to be compliant with the specification (meaning the issues described above with placement/colors/styles, etc).

      Neither of these capabilities are currently supported in the upstream version of VLC.

      Also note, if you’re using the 950q, there was actually a bug in VBI capture driver which I fixed as part of the VLC work. So you will likely need to update the kernel driver in order to take advantage of the VLC changes.


  2. Hi Devin,

    Thanks for all your work and for the postings. I’ve picked up your 950Q VBI and tvtime patches for analog TV with CC. Thank you for getting the driver changes back in the kernel and for providing the tvtime code.

    I would really like to use VLC for analog TV with CC. Do you have a public repo for this project? Do you plan to get it into VLC mainline?

    Thanks again,
    – Patrick

    • Hi Patrick,

      The current VLC work is going on here:


      Note it’s based on version 1.1.5, which is what the customer needed. The patches have to be forward ported before they can go upstream, and it’s likely that some work might be needed to make it work on platforms other than Linux. Also, the patches probably don’t meet the VLC coding style requirements, so that’s on my TODO list as well.

      But to answer your question, yes my intention is to get the VLC work upstream.


  3. Hi Devin,
    There are excellent news!
    I wanna help with developing the support to ISDB-t captions (Brazil, Japan and some other countries ). Could you point me what steps I have to do?

    • Devin Heitmueller

      Hi Rafael,

      I don’t really know anything about the specifics of captioning for ISDB-T, but a quick google search yielded this: http://www.arib.or.jp/english/html/overview/doc/6-STD-B37v2_4-E1.pdf

      You can look at the patches I did for EIA-608 captioning. That should show you all the basics of how data is pulled from the stream, parsed, and rendered on-screen. Bear in mind though that writing a captioning decoder tends to be a fairly large amount of work since your code is responsible for all the text positioning.


Leave a Reply