VLC Video4Linux VBI Support Submitted Upstream

Last year I did some work related to EIA-608 closed captioning support for VLC. This basically broke down into two projects: 1. Providing support to VLC to support reading CC data from the /dev/vbiX Video4Linux2 device node. 2. Improving the rendering of the captions to be more consistent with the official specification.

While I was pretty happy with the outcome, I never got around to get the changes submitted upstream (they were originally done against version 1.1.15). Over the last year, the mainline has continued to evolve, and now the patches no longer apply.

Over the last couple of weeks though, I’ve restarted that initiative, and today I have submitted the first phase upstream:

[vlc-devel] [PATCH 0/3] Add support for V4L2 VBI devices
[vlc-devel] [PATCH 1/3] Initial support for EIA-608 closed captions via V4L2 VBI devices
[vlc-devel] [PATCH 2/3] v4l2: make VBI mode work with UserPtr and ReadStream mode
[vlc-devel] [PATCH 3/3] v4l2: only use VBI device is standard selected is NTSC

Hopefully this addresses all the codingstyle issues that cropped up when I first attempted to submit the code over a year ago (and never got around to fixing until now). It’s also been made more generic, so that it only gets used if you indicate an intention to capture NTSC as well as working for cards that don’t support MMAP capture mode.

The other work related to the rendering improvements is underway. Aside from addressing the refactoring that occurred in later VLC releases, I need to do work to ensure that I don’t break the other platforms (e.g. OSX, Windows) and subtitle renderers. When I originally wrote the code, I only really cared about NTSC closed captions under Linux. However in order for it to be accepted into the mainline, it cannot have and adverse effects for the other platforms.

10 thoughts on “VLC Video4Linux VBI Support Submitted Upstream

  1. Hi Devin, question about these patches.

    Are they enough to get things working for vlc? I’m trying to stream from a capture card (Hauppauge 2250 or 250) which both have working vbi (as per zvbi-ntsc-cc /dev/vbiX), and no matter what I can’t get anything to work.

    I’m trying something like:

    vlc ‘v4l2c:///dev/video0:norm=ntsc:width=720:height=575’ –sout ‘#standard{access=udp,mux=ts,dst=1.2.3.4:50004}’

    This is with a ubuntu nightly build, which from looking at the current git tree, your patches seem to have been merged upstream. But maybe I’m wrong. =/

    Thoughts?

    • Devin Heitmueller

      Hello,

      720×576 is a resolution for PAL. You probably need 720×480, unless you really are trying to do PAL, which is unsupported for VBI in VLC. The VBI support is only for NTSC closed captions.

      This is the command line I typically use for testing:

      ./vlc “v4l2:///dev/video1” “:v4l2-vbidev=/dev/vbi0” “:v4l2-input=1” “:v4l2-standard-NTSC” “:v4l2-width=720” “:v4l2-height=480”

      In particular you need the v4l2-vbidev parameter. Alternatively if you are going through the GUI there is an advanced option to specify the VBI device, which would be required in order to see captions.

      Note that with either of these two paths you still have to choose the “Closed Caption 1” subtitle stream under the Video menu in order for captions to be rendered.

      Devin

      • Yeah, I didn’t mean 576, it was just me testing (saw something a while back saying you had to be bigger than 480 to get line 21). Anyway, tried this:

        vlc -vvv ‘v4l2c:///dev/video0:v4l2-vbidev=/dev/vbi0:v4l2-input=0:v4l2-standard-NTSC:v4l2-width=720:v4l2-height=480’ –sout ‘#standard{access=http,dst=:8001,mux=ts}’

        And it didn’t seem to work. Not getting an option for subtitles (with 2.0.5 release, or 2.1 nightly). If I change the input from v4l2c to v4l2 the stream doesn’t work. =/

        Maybe it doesn’t work over http (tried –sout ‘#standard{access=udp,dst=128.223.58.131:50004,mux=ts}’ as well, and that didn’t work either).

        Any thoughts? And thanks so much!

          • though, trying to transcode with something like this:

            –sout ‘#transcode{vcodec=h264,vb=2000,soverlay}:standard{access=udp,dst=128.223.58.131:50004,mux=ts}’

            Doesn’t do anything either. =/ So something isn’t working quite right… =(

          • Devin Heitmueller

            Any sort of transcoding or streaming is highly likely to result in the CC data being lost (due to VLC). You should definitely get them working properly running the application interactively before trying anything more elaborate.

            Devin

  2. hmm, sad. system’s whole point is to stream catv to digital signage…

    I’ll try putting a desktop flavor of ubuntu on the system and see if I can get vbi working on the desktop portion.

    If it turns out to work locally, should them not streaming be reported as a bug, or do you think it should work given the appropriate flags/options?

  3. Okay, just dropped the PVR-250 into another machine running ubuntu desktop (12.10), a nightly vlc, and made sure zvbi-vlc plugin was installed. zvbi-ntsc-cc can read the closed captions from /dev/vbi0, but vlc, with your example command above, does not show any subtitles option (just Open File).

    Can you confirm that’s the correct command? What I am using is:

    /vlc “v4l2:///dev/video0″ “:v4l2-vbidev=/dev/vbi0″ “:v4l2-input=0″ “:v4l2-standard-NTSC” “:v4l2-width=720″ “:v4l2-height=480″

    It SEEMS like that v4l2-vbidev flag isn’t the right flag… because it doesn’t seem to indicate at all that it’s opening /dev/vbi0, or even trying. =/ Also tried changing “:v4l2-standard=ntsc” but that did nothing. =/

    Thoughts? Help?

  4. Correction:

    Command I’m using is:

    vlc “v4l2c:///dev/video0″ “:v4l2-vbidev=/dev/vbi0″ “:v4l2-input=0″ “:v4l2-standard-NTSC” “:v4l2-width=720″ “:v4l2-height=480″

    Or

    vlc “v4l2c:///dev/video0″ “:v4l2-vbidev=/dev/vbi0″ “:v4l2-input=0″ “:v4l2-standard=NTSC” “:v4l2-width=720″ “:v4l2-height=480″

Leave a Reply