m(We now use mythutil to get the cutlist, not mythcommflag. Script updated.)

(12 intermediate revisions by 5 users not shown)

Line 3:

Line 3:

In order to view '''Closed Captioning''' data you must first [[User Manual:Detailed configuration Backend|configure the backend]] to properly set the [[VBI]] format. The default value is None, which means no closed captioning.

In order to view '''Closed Captioning''' data you must first [[User Manual:Detailed configuration Backend|configure the backend]] to properly set the [[VBI]] format. The default value is None, which means no closed captioning.

−

+

Note that [http://en.wikipedia.org/wiki/Closed_captioning#Television_and_video ATSC captions] should not require the VBI setting.

−

== Configuring Closed Captioning ==

+

−

+

−

In some cases, the kernel module '''ivtv''' must be (re)configured to allow Closed Captioning (a.k.a. VBI data) to be displayed.

+

−

+

−

If closed captioning is enabled as above but does not appear on-screen, the following may be necessary:

+

−

* Stop mythbackend

+

−

* Unload ivtv with "rmmod ivtv"

+

−

* Add the following lines to your modules.conf file (or, under Debian, create the following lines as "ivtv.conf" under "/etc/modprobe.d"):

You also need to [[User Manual:Detailed configuration Frontend|configure the frontend]] to set whether you want Closed Captioning to turn on whenever you select a channel. Regardless of your choice for the frontend, you can toggle Closed Captioning on and off by using the [http://www.mythtv.org/docs/mythtv-HOWTO-11.html#ss11.1 keyboard]. The default key is '''T'''.

You also need to [[User Manual:Detailed configuration Frontend|configure the frontend]] to set whether you want Closed Captioning to turn on whenever you select a channel. Regardless of your choice for the frontend, you can toggle Closed Captioning on and off by using the [http://www.mythtv.org/docs/mythtv-HOWTO-11.html#ss11.1 keyboard]. The default key is '''T'''.

+

If captions don't appear for you, it may be because the player (from your video profile) is not supporting playback for the kind of captions in the video. Try [http://www.gossamer-threads.com/lists/mythtv/users/461139 switching to a different video profile] (one that uses VDPAU or ffmepg, for example) to improve the chances of captions working. The [[HD-PVR]] is unable to capture VBI data and thus recordings it produces do not have captions. (Enabling captions on the cable box would work, but that would result in captions being "burned" into the HD-PVR recording's video.) [[Captions With HD PVR|A workaround for the HD-PVR is possible]] if another tuner is available.

This will extract the captions from the recording that starts at 2:00 PM on May 30, 2009, recorded on channel 1020 (probably channel 20 of source 1). This script may not work with older versions of MythTV, prior to the introduction of storage groups. You may have to modify the MySQL username, password, or database name if you are not using default values, and you may have to modify the PATH variable if the mysql or ccextractor binaries are not in that set.

This will extract the captions from the recording that starts at 2:00 PM on May 30, 2009, recorded on channel 1020 (probably channel 20 of source 1). This script may not work with older versions of MythTV, prior to the introduction of storage groups. You may have to modify the MySQL username, password, or database name if you are not using default values, and you may have to modify the PATH variable if the mysql or ccextractor binaries are not in that set.

Viewing closed captions when present in a recording

You also need to configure the frontend to set whether you want Closed Captioning to turn on whenever you select a channel. Regardless of your choice for the frontend, you can toggle Closed Captioning on and off by using the keyboard. The default key is T.

If captions don't appear for you, it may be because the player (from your video profile) is not supporting playback for the kind of captions in the video. Try switching to a different video profile (one that uses VDPAU or ffmepg, for example) to improve the chances of captions working. The HD-PVR is unable to capture VBI data and thus recordings it produces do not have captions. (Enabling captions on the cable box would work, but that would result in captions being "burned" into the HD-PVR recording's video.) A workaround for the HD-PVR is possible if another tuner is available.

Extracting closed captions to a .srt file

If you have a recording that contains closed caption data, and a cutlist, you can extract the time-corrected .srt data. You will need CCExtractor. Install the following script:

This will extract the captions from the recording that starts at 2:00 PM on May 30, 2009, recorded on channel 1020 (probably channel 20 of source 1). This script may not work with older versions of MythTV, prior to the introduction of storage groups. You may have to modify the MySQL username, password, or database name if you are not using default values, and you may have to modify the PATH variable if the mysql or ccextractor binaries are not in that set.

Viewing transcoded recordings with captions in mplayer

The mplayer program automatically loads .srt files that match the media basename. That is, if you are watching Babylon5.mpg, it will automatically load captions from Babylon5.srt in the same directory. By using the script shown above after setting the cutlist, but before transcoding, you can produce a pair of files that will allow you to view the transcoded, commercial-cut recording with optional closed captions.

Creating DVDs with captions present

It should be possible to use the script above to insert captions into DVDs created with mytharchive. These captions will be in their own video stream, so can be turned on and off, they are not overlaid directly on the original video stream. The mytharchive script will have to be modified to call the caption-extracting script above, and put the .srt file into the appropriate directory. Then, after the .mpg file has been extracted and optionally requantized, it should create a file similar to this, call it 'b5.xml':

The width and height are for NTSC 4x3 video, they will have to be changed appropriately for other formats. Then, the .mpg file should be augmented with the captions using the command:

spumux -s0 b5.xml < origfile.mpg > with-captions.mpg

This will result in the creation of DVDs with a caption track associated with each .mpg that went into it, which can be toggled by the usual CC selection mechanism on the DVD playback system in use. I have tested the creation of .mpg files with the embedded captioning track, but have not yet tried to change the mytharchive python script to write these to a DVD filesystem.