6.9. Extracting DVD subtitles to VOBsub file
Prev | Chapter 6. Basic usage of MEncoder | Next

## 6.9. Extracting DVD subtitles to VOBsub file

MEncoder is capable of extracting subtitles from a DVD into VOBsub formatted files. They consist of a pair of files ending in `.idx` and `.sub` and are usually packaged in a single `.rar` archive. MPlayer can play these with the `-vobsub` and `-vobsubid` options.

You specify the basename (i.e without the `.idx` or `.sub` extension) of the output files with `-vobsubout` and the index for this subtitle in the resulting files with `-vobsuboutindex`.

If the input is not from a DVD you should use `-ifo` to indicate the `.ifo` file needed to construct the resulting `.idx` file.

If the input is not from a DVD and you do not have the `.ifo` file you will need to use the `-vobsubid` option to let it know what language id to put in the `.idx` file.

Each run will append the running subtitle if the `.idx` and `.sub` files already exist. So you should remove any before starting.

Example 6.5. Copying two subtitles from a DVD while doing two pass encoding

    rm subtitles.idx subtitles.sub
    mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 \
        -vobsubout subtitles -vobsuboutindex 0 -sid 2
    mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 \
        -vobsubout subtitles -vobsuboutindex 1 -sid 5

Example 6.6. Copying a French subtitle from an MPEG file

    rm subtitles.idx subtitles.sub
    mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 \
        -vobsuboutid fr -sid 1 -nosound -ovc copy

Prev | Up | Next
6.8. Encoding from multiple input image files (JPEG, PNG, TGA, etc.) | Home | 6.10. Preserving aspect ratio