[FFmpeg-user] Burning DVD subtitles into video using overlay filter not working

Thierry Lelegard thierry at lelegard.fr
Thu Aug 29 18:32:04 CEST 2013


Hello all,

Sorry, yet another "subtitles" + "not working" topic ;-)

I have read the manual and a lot of posts about burning DVD subtitles into
the video stream using the overlay filter. I cannot make it work on a small
file. To make it clear, I want to remove the subtitles as an independent
stream and I want to burn/hardcode/encrust/whatever the subtitles into the
video images.

I have a small Matroska file (20 seconds) with one video stream, one audio
stream and one DVD subtitle stream:

Stream #0:0: Video: h264 (High), yuv420p, 1280x536 [SAR 1:1 DAR 160:67], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2: Subtitle: dvd_subtitle (default)

The subtitles are correctly displayed when the file is played using vlc
and mplayer. So, I assume that the subtitles data are correct.

To make a test, I try to burn the subtitles into the video using the following
command (full output at end of mail).

ffmpeg -i f.mkv -filter_complex "[0:v][0:s]overlay" -codec:v mpeg2video -codec:a mp2 -ac 2 -y f.hardsubs.mpg

It seems the simplest possible command to do. Please don't comment on video
quality, it is just a test to see if the subtitles are burnt into the video.
The resulting video does not contain subtitles.

I tried explicit x,y placement in the overlay and other options without more luck.

Any idea? So many people report successful DVD subtitles processing using
that type of command. What could be wrong?

Thanks in advance.
-Thierry

Full command output:
$ ffmpeg -i f.mkv -filter_complex "[0:v][0:s]overlay" -codec:v mpeg2video -codec:a mp2 -ac 2 -y f.hardsubs.mpg
ffmpeg version N-55753-g88909be Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug 24 2013 21:47:18 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 42.100 / 52. 42.100
  libavcodec     55. 29.100 / 55. 29.100
  libavformat    55. 14.102 / 55. 14.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.102 /  3. 82.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from 'f.mkv':
  Metadata:
    ENCODER         : Lavf55.14.102
  Duration: 00:00:23.00, start: 0.000000, bitrate: 5539 kb/s
    Chapter #0.0: start 0.000000, end 20.000000
    Stream #0:0: Video: h264 (High), yuv420p, 1280x536 [SAR 1:1 DAR 160:67], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
    Stream #0:2: Subtitle: dvd_subtitle (default)
[mpeg @ 00000000026aed20] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'f.hardsubs.mpg':
  Metadata:
    encoder         : Lavf55.14.102
    Chapter #0.0: start 0.000000, end 20.000000
    Stream #0:0: Video: mpeg2video, yuv420p, 1280x536 [SAR 1:1 DAR 160:67], q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 128 kb/s (default)
Stream mapping:
  Stream #0:0 (h264) -> overlay:main (graph 0)
  Stream #0:2 (dvdsub) -> overlay:overlay (graph 0)
  overlay (graph 0) -> Stream #0:0 (mpeg2video)
  Stream #0:1 -> #0:1 (dca -> mp2)
Press [q] to stop, [?] for help
frame=  483 fps= 80 q=31.0 Lsize=    2188kB time=00:00:20.10 bitrate= 891.6kbits/s dup=15 drop=0    
video:1866kB audio:303kB subtitle:0 global headers:0kB muxing overhead 0.877978%


More information about the ffmpeg-user mailing list