[FFmpeg-user] Reencoding pgssub to dvdsub - scaling and subtitle wipe

Hans Carlson forbyta at inbox.com
Wed Mar 9 01:34:45 CET 2016


I'm trying to reencode a video containing h264/ac3/pgssub to 
mpeg2video/ac3/dvdsub.  During the reencode, I scale the video from 
1920x1080 to 1280x720.

The video scales just fine, but the subtitles (0:2) don't scale at all 
going from pgssub to dvdsub.

In addition, the subtitles don't disappear, each subtitle is displayed 
over the last subtitle without removing the previous one.

How do I scale the subtitle stream to match the video stream?

And how do I make sure the subtitles are wiped when they should be?


$ ffmpeg -probesize 10M -i sample.m2ts -map 0:0 -map 0:1 -map 0:2 -codec:v mpeg2video -b:v 16384k -bufsize 4096k -maxrate 30000k -vf scale=-1:720 -codec:a copy -codec:s dvdsub -f vob sample.mpg
ffmpeg version N-78949-g6f5048f Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.9.2 (GCC) 20150212 (Red Hat 4.9.2-6)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-x11grab --disable-ffplay --disable-ffserver
   libavutil      55. 19.100 / 55. 19.100
   libavcodec     57. 27.101 / 57. 27.101
   libavformat    57. 28.100 / 57. 28.100
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 39.100 /  6. 39.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
Input #0, mpegts, from 'sample.m2ts':
   Duration: 00:00:45.28, start: 11.650667, bitrate: 19543 kb/s
   Program 1
     Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
     Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 320 kb/s
     Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
     Stream #0:3[0x1201]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
     Stream #0:4[0x1202]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
     Stream #0:5[0x1203]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
     Stream #0:6[0x1204]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
Output #0, vob, to 'sample.mpg':
   Metadata:
     encoder         : Lavf57.28.100
     Stream #0:0: Video: mpeg2video (Main), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 16384 kb/s, 23.98 fps, 90k tbn, 23.98 tbc
     Metadata:
       encoder         : Lavc57.27.101 mpeg2video
     Side data:
       cpb: bitrate max/min/avg: 30000000/0/16384000 buffer size: 4096000 vbv_delay: -1
     Stream #0:1: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, 320 kb/s
     Stream #0:2: Subtitle: dvd_subtitle (dvdsub), 1920x1080
     Metadata:
       encoder         : Lavc57.27.101 dvdsub
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
   Stream #0:1 -> #0:1 (copy)
   Stream #0:2 -> #0:2 (hdmv_pgs_subtitle (pgssub) -> dvd_subtitle (dvdsub))
Press [q] to stop, [?] for help
[vob @ 0x25ee700] buffer underflow st=2 bufi=16179 size=17232trate=14724.7kbits/s speed=2.63x
     Last message repeated 25 times
[vob @ 0x25ee700] packet too large, ignoring buffer limits to mux it
[vob @ 0x25ee700] buffer underflow st=2 bufi=16179 size=17232
frame= 1085 fps= 68 q=2.0 Lsize=   74094kB time=00:00:45.28 bitrate=13405.0kbits/s speed=2.84x
video:71276kB audio:1788kB subtitle:127kB other streams:0kB global headers:0kB muxing overhead: 1.232867%


More information about the ffmpeg-user mailing list