Mailing List Archive

closed captions with zvbi to file?
Hi,

I just had a question about how to use the zvbi command.

I have a system with one Hauppauge PVR 150 card with Mythtv on Ubuntu
8.04 Hardy Heron and I managed to set up Mythtv. The mythtv saves the
subtitles and I can play them with Mythtv. My problem is that I'm trying
to work out how to save subtitles with a program, and I've tried all
kinds of programs (ccextract, vbiutil, streamparser and other programs)
to extract the caption information from the saved file before I
transcode but, but that hasn't had any success.

My next attempt is that I got a second card, which is exactly the same
maker and model as the first, and I want to save subtitles from that
card while it's saving the program from the first. Subtitles is pretty
important to me (somewhat hard of hearing) so that's why all the work on
subtitles. I was able to get subtitles from a card while it's not saving
a program, but not while it is working on a program, that's why I got
the second card.

I am trying to find out how to save subtitles to a textfile or even .srt
file so I can play them with vlc or mplayer for example. Now, if I use
the following command:
zvbi-ntsc-cc --cc -C subtitles -d /dev/vbi0 -p
I actually can save the subtitles by themselves in a txt file, but I
would love to have timecodes with it, and adding --filter [timecode]
doesn't add any timecodes.

Do any of you know if it's possible to save closed caption information
from a card into a file with timecodes with this zvbi command? Is there
another command that can be used to do this? If it would be possible to
save subtitles in a format that could be used right away as an .srt
file, that would be ideal, but just having timecodes in the file and
being able to get it done with just some minor changes would be good too.

Any help would be much appreciated, I'm kind of stuck.

Alexandra

_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: closed captions with zvbi to file? [ In reply to ]
On Fri, 2009-10-09 at 10:55 -0700, amaranth13 wrote:
> Hi,
>
> I just had a question about how to use the zvbi command.
>
> I have a system with one Hauppauge PVR 150 card with Mythtv on Ubuntu
> 8.04 Hardy Heron and I managed to set up Mythtv. The mythtv saves the
> subtitles and I can play them with Mythtv. My problem is that I'm trying
> to work out how to save subtitles with a program, and I've tried all
> kinds of programs (ccextract, vbiutil, streamparser and other programs)
> to extract the caption information from the saved file before I
> transcode but, but that hasn't had any success.
>
> My next attempt is that I got a second card, which is exactly the same
> maker and model as the first, and I want to save subtitles from that
> card while it's saving the program from the first. Subtitles is pretty
> important to me (somewhat hard of hearing) so that's why all the work on
> subtitles. I was able to get subtitles from a card while it's not saving
> a program, but not while it is working on a program, that's why I got
> the second card.

Technically, you shouldn't need a second card, if you can coax MythTV to
not turn on embedded VBI packets when recording.



> I am trying to find out how to save subtitles to a textfile or even .srt
> file so I can play them with vlc or mplayer for example. Now, if I use
> the following command:
> zvbi-ntsc-cc --cc -C subtitles -d /dev/vbi0 -p
> I actually can save the subtitles by themselves in a txt file, but I
> would love to have timecodes with it, and adding --filter [timecode]
> doesn't add any timecodes.

> Do any of you know if it's possible to save closed caption information
> from a card into a file with timecodes with this zvbi command? Is there
> another command that can be used to do this?

cat /dev/vbi0 > foo.vbi

For raw vbi:
Will save all the VBI buffers and have a frame counter stuffed in at the
very end of every other field (aka every frame).

For sliced VBI:
Will save the sliced VBI data but there are no timestamps nor frame
counter. The format is documented in include/linux/videodev2.h and

http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html


> If it would be possible to
> save subtitles in a format that could be used right away as an .srt
> file, that would be ideal, but just having timecodes in the file and
> being able to get it done with just some minor changes would be good too.

If you're up to the application programming task, you could just pull
out the IVTV embedded packets from the MPEG stream that MythTV recorded.
The packets contain are sliced VBI, and the MPEG hedaers should have the
a PTS so you can sync things up later.

The latest ivtv-utils code

http://dl.ivtvdriver.org/ivtv/archive/1.4.x/ivtv-utils-1.4.0.tar.gz

has a patched "ps-analyzer" utility that knows how to partially decode
the packets: text is not displayed, but the contents of the private VBI
packet are described.

A recent version of include/linux/videodev2.h describes the format and
the a recent version of the V4L2 specification documents the IVTV VBI
Private packet format:

http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html
http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#id2842004

That documentation doesn't describe the MPEG-2 stream formats, as those
are documented in MPEG specifications.


Or, I just noticed that, from vbiutil:

http://www.linuxowl.com/vbiutil.html

you could just use getvbi and cc2srt on the file that MythTV saves.


Regards,
Andy

> Any help would be much appreciated, I'm kind of stuck.
>
> Alexandra



_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: closed captions with zvbi to file? [ In reply to ]
Hi Alexandra,

amaranth13 wrote:
> Hi,
>
> I just had a question about how to use the zvbi command.
>
> I have a system with one Hauppauge PVR 150 card with Mythtv on Ubuntu
> 8.04 Hardy Heron and I managed to set up Mythtv. The mythtv saves the
> subtitles and I can play them with Mythtv. My problem is that I'm trying
> to work out how to save subtitles with a program, and I've tried all
> kinds of programs (ccextract, vbiutil, streamparser and other programs)
> to extract the caption information from the saved file before I
> transcode but, but that hasn't had any success.
>
> My next attempt is that I got a second card, which is exactly the same
> maker and model as the first, and I want to save subtitles from that
> card while it's saving the program from the first. Subtitles is pretty
> important to me (somewhat hard of hearing) so that's why all the work on
> subtitles. I was able to get subtitles from a card while it's not saving
> a program, but not while it is working on a program, that's why I got
> the second card.
>
> I am trying to find out how to save subtitles to a textfile or even .srt
> file so I can play them with vlc or mplayer for example. Now, if I use
> the following command:
> zvbi-ntsc-cc --cc -C subtitles -d /dev/vbi0 -p
> I actually can save the subtitles by themselves in a txt file, but I
> would love to have timecodes with it, and adding --filter [timecode]
> doesn't add any timecodes.
>
> Do any of you know if it's possible to save closed caption information
> from a card into a file with time codes with this zvbi command? Is there
> another command that can be used to do this? If it would be possible to
> save subtitles in a format that could be used right away as an .srt
> file, that would be ideal, but just having time codes in the file and
> being able to get it done with just some minor changes would be good too.

If I understand correctly, you got the second card as a way to capture the VBI/CC data for MythTV recordings so you can somehow convert that data into a form you can later display when you play back MythTV recordings using other programs like mplayer or vlc viewer. If I understand correctly, you don't need to use the second card for that purpose. The VBI/CC data is in the files recorded by MythTV, including the needed timestamps. What you need is a way to extract them and convert them into a form that vlc and/or mplayer can use, right? If so, I think I can help.

But first, I'd like to understand why you want to use vlc or mplayer to play the recordings. Is it because you're using a Windows PC? If you're playing back on a Linux computer, why not use the MythTV frontend? Would it be possible to turn your Windows PC into a multi boot machine, one that can boot either Windows or Linux, depending on what you want to do?

FWIW, closed captions are important to me, too. In my case, I wanted to be able to burn DVDs of MythTV recordings that preserved closed captions. If DVDs with closed captions in the form of subtitles would work for you, then you might like to try my solution. You can read all the details here:
http://www.hbuus.com/cc2subtitles/

Even if my solution doesn't exactly meet your needs, I might be able to adapt it to do what you want. That's because it uses libzvbi, from the zapping project that also provided the zvbi program you're trying to use, and it can be configured to save different file formats, like SRT. If you'd like to discuss the possibilities, I welcome you to contact me off list, since I think we're straying away from a ivtv driver issue.

Another thought is to post about your problem to the mythtv-users group:
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Or to the mythbuntu forum on ubuntuforums.org:
http://ubuntuforums.org/forumdisplay.php?f=301

HTH,
Helen

_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: closed captions with zvbi to file? [ In reply to ]
On Sat, 2009-10-10 at 17:25 -0400, faginbagin wrote:
> Hi Alexandra,


> FWIW, closed captions are important to me, too. In my case, I wanted
> to be able to burn DVDs of MythTV recordings that preserved closed
> captions. If DVDs with closed captions in the form of subtitles would
> work for you, then you might like to try my solution. You can read all
> the details here:
> http://www.hbuus.com/cc2subtitles/
>
> Even if my solution doesn't exactly meet your needs, I might be able
> to adapt it to do what you want. That's because it uses libzvbi, from
> the zapping project that also provided the zvbi program you're trying
> to use, and it can be configured to save different file formats, like
> SRT. If you'd like to discuss the possibilities,


> I welcome you to contact me off list, since I think we're straying
> away from a ivtv driver issue.

Helen,

I respectfully disagree. :)

This is certainly on topic for an ivtv-users list discussion. Only the
ivtv and cx18 driver use the ivtv embedded VBI private packets. A linux
kernel driver isn't worth much without effective methods for use by
applications and end users.

Plus once potential solutions are discussed on list, they'll be archived
in the list archive for others to find later.

Regards,
Andy


> Another thought is to post about your problem to the mythtv-users
> group:
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
> Or to the mythbuntu forum on ubuntuforums.org:
> http://ubuntuforums.org/forumdisplay.php?f=301
>
> HTH,
> Helen



_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: closed captions with zvbi to file? [ In reply to ]
Hi Andy,

Andy Walls wrote:
> On Sat, 2009-10-10 at 17:25 -0400, faginbagin wrote:
>> Hi Alexandra,
>
>
>> FWIW, closed captions are important to me, too. In my case, I wanted
>> to be able to burn DVDs of MythTV recordings that preserved closed
>> captions. If DVDs with closed captions in the form of subtitles would
>> work for you, then you might like to try my solution. You can read all
>> the details here:
>> http://www.hbuus.com/cc2subtitles/
>>
>> Even if my solution doesn't exactly meet your needs, I might be able
>> to adapt it to do what you want. That's because it uses libzvbi, from
>> the zapping project that also provided the zvbi program you're trying
>> to use, and it can be configured to save different file formats, like
>> SRT. If you'd like to discuss the possibilities,
>
>
>> I welcome you to contact me off list, since I think we're straying
>> away from a ivtv driver issue.
>
> Helen,
>
> I respectfully disagree. :)
>
> This is certainly on topic for an ivtv-users list discussion. Only the
> ivtv and cx18 driver use the ivtv embedded VBI private packets. A linux
> kernel driver isn't worth much without effective methods for use by
> applications and end users.
>
> Plus once potential solutions are discussed on list, they'll be archived
> in the list archive for others to find later.
>
> Regards,
> Andy

Thanks for your assessment on what is and isn't on topic. Perhaps the fact that I've posted the link to my solution is sufficient at this time?

I am helping Alexandra to get it working for her. Mostly issues with Debian package management tools, like when to be root. Although Alexandra's experience has made me aware of one step I need to add to my documentation.

If you feel our conversation belongs on list, I'll forward what's transpired so far, with Alexandra's permission, and continue the conversation on list.

Regards,
Helen

_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users