必須的程式:mplayer、subtitleripper、transcode
首先先抓出該 DVD 內有幾個字幕軌道:
mplayer -dvd-device $RIPDIR dvd://$TITLE -vo null -ao null -frames 0 -v
$TITLE 是該影片位在 DVD 的哪個 Title 中。
輸出結果應該如下:
...... DVD successfully opened. audio stream: 0 format: ac3 (5.1) language: en aid: 128. audio stream: 1 format: ac3 (stereo) language: en aid: 132. number of audio channels on disk: 2. subtitle ( sid ): 0 language: en subtitle ( sid ): 1 language: es subtitle ( sid ): 2 language: pt subtitle ( sid ): 3 language: ko subtitle ( sid ): 4 language: zh subtitle ( sid ): 5 language: th subtitle ( sid ): 6 language: es subtitle ( sid ): 7 language: pt subtitle ( sid ): 8 language: ko number of subtitles on disk: 9 ......
再接下來抓出字幕:
tccat -i $RIPDIR -T $TITLE -L | tcextract -x ps1 -t vob -a 0x24 > subs-zh
註:0x24 為 0x20 + 4 (language:zh 的 index)
再接下來轉成 idx+sub:
subtitle2vobsub -o vobsubs-zh -i $RIPDIR/VIDEO_TS/VTS_01_0.IFO < subs-zh
就會生出 vobsubs-zh.idx 與 vobsubs-zh.sub 了。