PDA

View Full Version : mplayer: troubles with subtitle dump. alternative?


Sujao
8th February 2005, 07:58
Hi everybody!

I've got a probem whith the ripping of subtitles from a DVD. I do that with:

mencoder dvd://1 -dvd-device /pah/to/image -ifo path/to/image/VTS_01_0.IFO -vobsubout subtitles -vobsuboutindex 0 -sid 0 -nosound -ovc copy -o /dev/null

This runs just fine.

But when I try to merge them with mkvmerge into a matroska conatainer I get this warning:

Warning: vobsub_reader: '/tmp/nrip3/subtitles.idx', line 45: The current
timestamp (00:04:43.479) is smaller than the last one (00:04:43.480).
mkvmerge will sort the entries according to their timestamps. This might
result in the wrong order for some subtitle entries. If this is the case
then you have to fix the .idx file manually.
Warning: spu_extract_duration: Encountered broken SPU packet (next_off <
start_off) at timecode 00:04:43.479. This packet might be displayed
incorrectly or not at all.

And there is really one subtitle block missing although its only one sentence. It just doesnt appear. When I play the file with mplayer the text goes on with the next sentence spoken. When I play it with VLC in windows the subtitle stop at this position and dont appear again.

I asked already a developer of the matroska container and he told me the following:
use VSRip:
http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84442

I know it's a Windows application, but I think it works nicely with
Wine. It is WAY better than mplayer's vobsub support, e.g. it can handle
wrapping timecodes.

Unfortunately I cant use it since, as some you might alrady know ;), I am making a bash script that has to use native non-gui based progams.

Does anyone know an alternative way on how to get DVD subtitles with mplayer? Maybe I am doing something wrong. Or what about another native program?

Mosu
9th February 2005, 08:21
Well if VLC stops at that position, too, then I'd guess that the subtitle stream is simply broken at that position. Maybe you could verify this by running VSRip on this DVD (and only on this -- not as a permanent solution but only for finding out whether or not the DVD itself contains broken stuff).

BTW: transcode and its tools can also extract the subtitle stream, but they won't generate the .idx file that mkvmerge definitely needs. Here's the command in case you're interested:

tccat -i /path/to/dvd/image -T 1 -L | tcextract -x ps1 -t vob -a 0x20 > something.sub

The "-T 1" is the title, "-a 0x20" the subtitle stream number.

mikeX
9th February 2005, 12:51
Regarding transcode, there is a program that generates both the .idx and .sub files, subtitleripper (http://subtitleripper.sourceforge.net/), however the author states that he is using mplayer's vobsub code.
Typical usage:

cat vts_01_?.vob | tcextract -x ps1 -t vob -a 0x20 > mysub.ps1
subtitle2vobsub -i vts_01_0.ifo -p mysub.ps1 -o movie_name

Sujao
15th February 2005, 10:52
Meanwhile I was able to write a script to correct the .idx files. The invalid entries were just additional entries so it is safe to just remove them. After this the subtitles can be muxed just fine. I checken severalr times and no subtitles were missing.

Mosu
15th February 2005, 10:58
You watched the whole movie several times? Impressive :D

(Yes, I do realize you've probably just skipped to the appropriate timestamps ;))

Sujao
15th February 2005, 12:16
Originally posted by Mosu
You watched the whole movie several times? Impressive :D

(Yes, I do realize you've probably just skipped to the appropriate timestamps ;))

You got it :)

six6
15th February 2005, 19:46
@all
Where are you finding the subtitle stream id to be 0x20? Does that correspond to mplayer -sid 0? Google says (http://www.google.com/search?q=0x20+to+base+10&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox&rls=org.mozilla:en-US:unofficial) 0x20 = 32.

I'd like to know so I can specify the right track to rip.

Mosu
15th February 2005, 20:53
The subtitles in MPEG program stream ( = VOB files) use IDs that start at 0x20. tcextract uses those IDs (in fact, tcextract can extract arbitrary streams from PS files). mplayer simply bases its -sid parameter at 0 and adds 0x20 to that value internally when selecting the appropriate stream.

Sujao
15th February 2005, 21:12
I dont use the 0x20 syntax but only specify the sid parameter. Usually the first subtitle starts at 0 or 1 and then for every further track the number is increased.

Mosu
15th February 2005, 21:21
We're talking about two different things here!

1. Inside the VOB file each track has an ID. The IDs of subtitle tracks start at 0x20 and usually increase by 1.
2. The program tcextract expects the track ID directly, meaning you have to give it "0x20" as the parameter if you want the first subtitle track.
3. The program mplayer expects that you tell it to play "the n'th subtitle track", e.g. "-sid 0" = "play the first subtitle track". Internally it simply adds 0x20 to what you've given with -sid and looks for a track with that ID.