[FFmpeg-user] Input: Transport stream with DVB subtitles, output: Any format with the subtitles burned in
Henk D. Schoneveld
belcampo at zonnet.nl
Thu Jun 23 23:25:40 CEST 2016
On 23 Jun 2016, at 22:26, Carlos Fernandez <carlos at yo.tv> wrote:
> Hi,
>
>
> From a BBC1 capture in TS format that comes with DVB subtitles I'm trying to generate a file that has the subtitles burned in. The final use case is a bit more complex in that it has to be live streams but let's forget about that for now.
>
> A sample recording called BBC1.ts exists, and I want to create a file called BBC1_burned_in.avi that that the subtitles burned-in. The actual output format is not important, I'm using .avi here as that's what someone trying the same thing was using. Also tried generating a TS with no change.
>
>
> Anyway, I'm using the following (tried other variants including scaling the subtitles, as someone suggested in IRC, all of them have the same result):
>
>
> ffmpeg -i BBC1_TS.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -vcodec libx264 -preset ultrafast -x264opts keyint=100:min-keyint=50 -threads -0 -f avi BBC1_burned_in.avi
This works for me when recording from TV5
ffmpeg -y -i source.ts -ss $1 -to $2 -crf 22 -preset veryfast -g 50 -me_method umh -ab 96k -ac 2 -filter_complex '[0:v][0:s:0]overlay[v]' -map [v] -map 0:a -movflags faststart result.mp4
Note [0:s:0] instead of your [0:s] I don’t know if that’s the reason though.
>
>
> And I get an error "sub2video: rectangle overflowing" which appears a number of times.
>
>
> This is the output:
>
>
> $ ffmpeg -i BBC1_TS.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -vcodec libx264 -preset ultrafast -x264opts keyint=100:min-keyint=50 -threads -0 -f avi copy.avi
> ffmpeg version 2.5.10-0ubuntu0.15.04.1 Copyright (c) 2000-2016 the FFmpeg developers
> built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
> configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
> libavutil 54. 15.100 / 54. 15.100
> libavcodec 56. 13.100 / 56. 13.100
> libavformat 56. 15.102 / 56. 15.102
> libavdevice 56. 3.100 / 56. 3.100
> libavfilter 5. 2.103 / 5. 2.103
> libavresample 2. 1. 0 / 2. 1. 0
> libswscale 3. 1.101 / 3. 1.101
> libswresample 1. 1.100 / 1. 1.100
> libpostproc 53. 3.100 / 53. 3.100
> Input #0, mpegts, from 'BBC1_TS.ts':
> Duration: 00:02:24.43, start: 1.400000, bitrate: 1856 kb/s
> Program 1
> Metadata:
> service_name : Service01
> service_provider: FFmpeg
> Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 704x576 [SAR 16:11 DAR 16:9], max. 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
> Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s
> Stream #0:2[0x102](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
> [mpegts @ 0x2394e80] sub2video: using 704x576 canvas
> [libx264 @ 0x23c3f00] using SAR=16/11
> [libx264 @ 0x23c3f00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
> [libx264 @ 0x23c3f00] profile Constrained Baseline, level 3.0
> Output #0, avi, to 'copy.avi':
> Metadata:
> ISFT : Lavf56.15.102
> Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 704x576 [SAR 16:11 DAR 16:9], q=-1--1, 25 fps, 25 tbn, 25 tbc (default)
> Metadata:
> encoder : Lavc56.13.100 libx264
> Stream mapping:
> Stream #0:0 (mpeg2video) -> overlay:main
> Stream #0:2 (dvbsub) -> overlay:overlay
> overlay -> Stream #0:0 (libx264)
> Press [q] to stop, [?] for help
> sub2video: rectangle overflowing
> Last message repeated 1 times
> sub2video: rectangle overflowing 711kB time=00:00:04.04 bitrate=1441.9kbits/s
> Last message repeated 2 times
> sub2video: rectangle overflowing 2013kB time=00:00:13.00 bitrate=1268.3kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 2769kB time=00:00:17.52 bitrate=1294.5kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 3433kB time=00:00:21.88 bitrate=1285.4kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 4112kB time=00:00:26.44 bitrate=1273.9kbits/s
> sub2video: rectangle overflowing 4797kB time=00:00:30.96 bitrate=1269.3kbits/s
> Last message repeated 2 times
> sub2video: rectangle overflowing 5385kB time=00:00:35.44 bitrate=1244.8kbits/s
> sub2video: rectangle overflowing 6061kB time=00:00:40.12 bitrate=1237.6kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 6610kB time=00:00:44.72 bitrate=1210.8kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 7779kB time=00:00:53.80 bitrate=1184.4kbits/s
> sub2video: rectangle overflowing 8448kB time=00:00:58.36 bitrate=1185.8kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 9137kB time=00:01:03.00 bitrate=1188.0kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 9795kB time=00:01:07.56 bitrate=1187.7kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 10452kB time=00:01:11.92 bitrate=1190.6kbits/s
> Last message repeated 2 times
> sub2video: rectangle overflowing 11248kB time=00:01:16.56 bitrate=1203.5kbits/s
> sub2video: rectangle overflowing 12462kB time=00:01:25.92 bitrate=1188.2kbits/s
> Last message repeated 2 times
> sub2video: rectangle overflowing 13119kB time=00:01:30.52 bitrate=1187.3kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 13618kB time=00:01:35.20 bitrate=1171.8kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 14442kB time=00:01:39.52 bitrate=1188.8kbits/s
> Last message repeated 2 times
> sub2video: rectangle overflowing 15219kB time=00:01:43.92 bitrate=1199.7kbits/s
> Last message repeated 4 times
> sub2video: rectangle overflowing 15861kB time=00:01:48.40 bitrate=1198.7kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 16470kB time=00:01:53.04 bitrate=1193.6kbits/s
> Last message repeated 3 times
> sub2video: rectangle overflowing 17082kB time=00:01:57.64 bitrate=1189.5kbits/s
> Last message repeated 1 times
> sub2video: rectangle overflowing 18618kB time=00:02:06.60 bitrate=1204.7kbits/s
> Last message repeated 3 times
> sub2video: rectangle overflowing 19832kB time=00:02:10.64 bitrate=1243.6kbits/s
> Last message repeated 3 times
> sub2video: rectangle overflowing 21259kB time=00:02:15.04 bitrate=1289.7kbits/s
> Last message repeated 3 times
> sub2video: rectangle overflowing 22038kB time=00:02:19.40 bitrate=1295.1kbits/s
> Last message repeated 2 times
> frame= 3561 fps=224 q=-1.0 Lsize= 22532kB time=00:02:22.48 bitrate=1295.5kbits/s dup=0 drop=2
> video:22442kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.404680%
> [libx264 @ 0x23c3f00] frame I:36 Avg QP:17.08 size: 45801
> [libx264 @ 0x23c3f00] frame P:3525 Avg QP:19.99 size: 6051
> [libx264 @ 0x23c3f00] mb I I16..4: 100.0% 0.0% 0.0%
> [libx264 @ 0x23c3f00] mb P I16..4: 2.3% 0.0% 0.0% P16..4: 42.0% 0.0% 0.0% 0.0% 0.0% skip:55.7%
> [libx264 @ 0x23c3f00] coded y,uvDC,uvAC intra: 53.4% 51.8% 18.9% inter: 18.4% 12.6% 0.6%
> [libx264 @ 0x23c3f00] i16 v,h,dc,p: 53% 15% 16% 16%
> [libx264 @ 0x23c3f00] i8c dc,h,v,p: 35% 14% 41% 9%
> [libx264 @ 0x23c3f00] kb/s:1289.93
>
> Thanks
>
>
> Carlos
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user
mailing list