[FFmpeg-user] How to extract DVD subtitle from this VOB file?

Hans Carlson forbyta at gmx.com
Thu Mar 15 21:20:32 EET 2018


On Thu, 15 Mar 2018, Moritz Barsnick wrote:

> On Thu, Mar 15, 2018 at 09:18:01 -0700, Carl Zwanzig wrote:
>> On 3/15/2018 9:05 AM, Moritz Barsnick wrote:
>>> AFAIU, MPEG-PS can contain streams which appear later. (Same for
>>> MPEG-TS, I think.) Perhaps the subtitle streams aren't visible at t=0.
>>
>> That is my experience- often a subtitle stream itself won't appear until
>> time for the first one to appear;
>
> Here's an example:
>
>  $ ffmpeg -i Downloads/TV/VTS_03_1.VOB -c copy -f null -
>  ...
>  Input #0, mpeg, from 'Downloads/TV/VTS_03_1.VOB':
>      ...
>      Stream #0:3[0x22]: Subtitle: dvd_subtitle
>      Stream #0:4[0x21]: Subtitle: dvd_subtitle
>      Stream #0:5[0x23]: Subtitle: dvd_subtitle
>  ...
>  [mpeg @ 0xb086980] New subtitle stream 0:6 at pos:5179406 and DTS:5.28s
>
> Note the subtitle streams 0:3 to 0:5, and the message when 0:6 appears.
>
>> (Can be highly annoying, but there it is.)
>
> Indeed, in the given example, I can't map 0:6, no matter the "-ss" I give:

The way to "fix" this is to specify a large analyzeduration/probesize, eg:

   $ ffmpeg -analyzeduration 100M -probesize 100M -i movie.vob ...

Exactly how large depends on where the first subtitle appears within each 
subtitle stream.  I've used values of 2G (and even larger) in order to see 
some subtitles that only appear much later in the movie.  This is 
especially true for movies that use a separate subtitle stream for 
"forced" foreign language.  In other words, an hour into the movie the 
"aliens" are first encountered and they speak in an unintelligible 
language that appears translated as a subtitle on stream 0:10.  Within 5 
mins they somehow learn English and no other subtitles appear for the rest 
of the movie.  So, stream 0:10 only contains a few subtitles right in the 
middle.

In the above example, try using increasingly larger values for 
analyzeduration/probesize until 0:6 shows up with the following command. 
(No other options, just want to see the input streams.  You could also use 
ffprobe if you prefer.)

   $ ffmpeg -analyzeduration 10M -probesize 10M -i Downloads/TV/VTS_03_1.VOB
   $ ffmpeg -analyzeduration 100M -probesize 100M -i Downloads/TV/VTS_03_1.VOB
   $ ffmpeg -analyzeduration 500M -probesize 500M -i Downloads/TV/VTS_03_1.VOB
   $ ffmpeg -analyzeduration 1G -probesize 1G -i Downloads/TV/VTS_03_1.VOB

You can try different values for analyzeduration and probesize, but I seem 
to recall they both have to be "large enough".  They don't need to be the 
SAME value, just large enough for their respective purposes.  Where 
analyzeduration is TIME (micro-secs) and probesize is SIZE (bytes).  The 
algorithm appears to stop analyzing/probing when either of the limits is 
reached, so both need to be sufficiently large.


More information about the ffmpeg-user mailing list