User Tools

Site Tools


doc:appunti:linux:video:subtitleripper

This is an old revision of the document!


How to rip DVD subtitles with vobsub2srt

The vobsub2srt program reads a pair of subtitles.sub and subtitles.idx files, OCRs the images contained in the sub file and creates a subtitles.srt file with the subtitles text and the appropriate timing information obtained from the idx file.

The program vobsub2srt does not exists in Debian 12 Bookworm, but it should be possible to compile it from source (see the VobSub2SRT GitHub repository). Alternatively you can get the binary package from the Deb Multimedia repository.

Extracting .sub and .idx files from the .vob

vobcopy -n '1' -i /dev/sr0 --large-file -o .
ffmpeg -probesize 500M -analyzeduration 500M \
    -i 'DVD_TITLE.vob' \
    -map 0:v:0 -map 0:a:0 -map 0:a:1 -map 0:s:0 -map 0:s:1 -map 0:s:2 \
    -vcodec 'copy' \
    -acodec 'copy' \
    -scodec 'copy' \
    'DVD_TITLE.mkv'
mkvextract 'DVD_TITLE.mkv' tracks -c 'S_VOBSUB' '3:subtitles-3'

OCR the images from the .sub file

vobsub2srt --ifo './VTS_01_0.IFO' --dump-images --tesseract-lang ita subtitles

The .IFO file is required to get the correct palette, width and hight, but it is not mandatory.

doc/appunti/linux/video/subtitleripper.1706780244.txt.gz · Last modified: 2024/02/01 10:37 by niccolo