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

Moritz Barsnick barsnick at gmx.net
Thu Mar 15 18:32:20 EET 2018


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 -
  ffmpeg version N-90214-gdd3f1e3 Copyright (c) 2000-2018 the FFmpeg developers
    built with icc (ICC) 14.0.3 20140422
    configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2018-03-04 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio --enable-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-librtmp --enable-libass --enable-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libzvbi --enable-libtesseract --enable-libzmq --enable-libopus --enable-libcodec2
    libavutil      56.  8.100 / 56.  8.100
    libavcodec     58. 13.102 / 58. 13.102
    libavformat    58. 10.100 / 58. 10.100
    libavdevice    58.  2.100 / 58.  2.100
    libavfilter     7. 12.100 /  7. 12.100
    libswscale      5.  0.102 /  5.  0.102
    libswresample   3.  0.101 /  3.  0.101
    libpostproc    55.  0.100 / 55.  0.100
  Input #0, mpeg, from 'Downloads/TV/VTS_03_1.VOB':
    Duration: 00:00:31.55, start: 0.280000, bitrate: 8357 kb/s
      Stream #0:0[0x1bf]: Data: dvd_nav_packet
      Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
      Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
      Stream #0:3[0x22]: Subtitle: dvd_subtitle
      Stream #0:4[0x21]: Subtitle: dvd_subtitle
      Stream #0:5[0x23]: Subtitle: dvd_subtitle
  Output #0, null, to 'pipe:':
    Metadata:
      encoder         : Lavf58.10.100
      Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc
      Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
  Stream mapping:
    Stream #0:1 -> #0:0 (copy)
    Stream #0:2 -> #0:1 (copy)
  Press [q] to stop, [?] for help
  [mpeg @ 0xb086980] New subtitle stream 0:6 at pos:5179406 and DTS:5.28s
  frame=  791 fps=0.0 q=-1.0 Lsize=N/A time=00:00:31.56 bitrate=N/A speed=57.8x
  video:30898kB audio:740kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

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:

  Stream map '0:6' matches no streams.

Perhaps it only appears for one packet, and I can't navigate exactly to that one.

Moritz


More information about the ffmpeg-user mailing list