[FFmpeg-user] PGS subtitles and "forced flag"

Oliver Fromme oliver at fromme.com
Thu Mar 13 17:54:34 CET 2014


Hello,

Are there any usage examples for the -forced_subs_only option?
I'm trying to use ffmpeg to extract PGS subtitle tracks and
convert them to VOBSUB (.sub/.idx).  Basically this works fine,
except that I always get the whole subtitle track, i.e. both
forced and non-forced subtitles, no matter if I specify
"-forced_subs_only 1" or not.

Am I doing something wrong, or is there a known problem with
that option?  I don't get any error messages, so I assume
there is no usage error with my command line.

Here's my command line:

ffmpeg -analyzeduration 500M -probesize 500M -fix_sub_duration -forced_subs_only 1 -i 'concat:BDMV/STREAM/00000.m2ts|BDMV/STREAM/00001.m2ts|BDMV/STREAM/00002.m2ts' -vn -map 0:5 -c:s dvdsub tmp-subt5-fso.mkv

Here's the output from ffmpeg:

ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 19 2013 18:34:53 with gcc 4.2.1 (GCC) 20070831 patched [FeeBSD]
  configuration: --disable-x11grab --prefix=/usr/local --mandir=/usr/local/man --incdir=/usr/local/include/ffmpeg1 --libdir=/usr/local/lib/ffmpeg1 --shlibdir=/usr/local/lib/ffmpeg1 --datadir=/usr/local/share/ffmpeg1 --build-suffix=1 --progs-suffix=1 --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags=-L/usr/local/lib --extra-libs=-pthread --disable-debug --disable-libaacplus --disable-indev=alsa --disable-outdev=alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libass --disable-libcdio --disable-libcelt --disable-libfaac --disable-libfdk-aac --enable-fontconfig --enable-libfreetype --disable-frei0r --disable-gnutls --disable-libgsm --enable-libmp3lame --enable-libbluray --disable-libv4l2 --disable-libmodplug --disable-openal --disable-libopencv --disable-lib!
 openjpeg --disable-libopus --disable-libpulse --enable-librtmp --disable-libschroedinger --disable-libspeex --disable-libtheora --disable-vaapi --disable-vdpau --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvorbis --disable-libvpx --enable-libx264 --enable-libxvid --enable-nonfree
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 43.101 / 55. 43.101
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x80690c120] concealing 6585 DC, 6585 AC, 6585 MV errors in I frame
Input #0, mpegts, from 'concat:BDMV/STREAM/00000.m2ts|BDMV/STREAM/00001.m2ts|BDMV/STREAM/00002.m2ts':
  Duration: 02:14:04.04, start: 600.000000, bitrate: 8450 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Stream #0:1[0x1100](ger): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:2[0x1101](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:3[0x1102](fre): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:4[0x1103](ger): Audio: dts (DTS) ([130][0][0][0] / 0x0082), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Stream #0:5[0x1200](ger): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    Stream #0:6[0x1201](eng): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    Stream #0:7[0x1202](fre): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    Stream #0:8[0x1203](nld): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
    Stream #0:9[0x1204](tur): Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
Output #0, matroska, to 'tmp-subt5-fso.mkv':
  Metadata:
    encoder         : Lavf55.21.100
    Stream #0:0(ger): Subtitle: dvd_subtitle (dvdsub), 1920x1080
Stream mapping:
  Stream #0:5 -> #0:0 (pgssub -> dvdsub)
Press [q] to stop, [?] for help
[matroska @ 0x80687aa20] Encoder did not produce proper pts, making some up.
size=   11819kB time=02:13:14.65 bitrate=  12.1kbits/s
video:0kB audio:0kB subtitle:11750 global headers:0kB muxing overhead 0.586039%

The resulting VOBSUB track inside the mkv container contains
1480 subtitles.  But only 359 of them are forced.  With the
"-forced_subs_only 1" option, I would expect the VOBSUB track
to contain only the 359 forced subtitles.

In order to make sure, I extracted the PGS (.sup) track from
the .m2ts files with tsMuxeR into a .sup file (ffmpeg doesn't
seem to be able to do that), and then used BDSup2Sub with the
/forced+ option.  It correctly created an .idx file with 359
entries.

On a related note, when I run BDSup2Sub without the /forced+
option, I get an .idx file with 1477 entries, as opposed to the
1480 entries from ffmpeg.  So three entries are missing.  I'll
have to compare the lists of time stamps and then look at the
movie to find out what might be happening there.

Best regards
   Oliver

-- 


More information about the ffmpeg-user mailing list