[FFmpeg-user] How do I encode DVB Subtitles?

Bernd Butscheidt bbutscheidt at yahoo.de
Sun Aug 19 18:03:38 CEST 2012



>________________________________
>
>On Tue, Jun 19, 2012 at 4:08 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>
>> Wagner Patriota <wagner.patriota <at> gmail.com> writes:
>>
>> > ffmpeg -i video.ts -i subtitle.srt -vcodec copy -acodec copy
>> > -scodec dvbsub output.ts



So I tried this using a recording from ITVHD made with vdr:


ffmpeg_g -i 
/media/videoPIII/video/The_Break-Up/2012-08-19.00.22.191-0.rec/00001.ts -map 0:0 -vcodec copy -map 0:2 -acodec copy -map 0:3 -scodec copy -ss 0:04:57.31 -t 00:32:30.850 Break_up_test_1.ts


Complete output at the end - so far - no errors. FFmpeg used to complain in my memories when trying to remux subtitles. But even mediainfo showing that there is a subtitle stream, I cannot visualize it neither with mplayer, vlc or xine or demux it with ProjectX (which is possible using the uncut original recording).


Here are the outputs:

===============================



/extern07/ffmpeg_neu/ffmpeg/ffmpeg_g -i /media/videoPIII/video/The_Break-Up/2012-08-19.00.22.191-0.rec/00001.ts -map 0:0 -vcodec copy -map 0:2 -acodec copy -map 0:3 -scodec copy -ss 0:04:57.31 -t 00:32:30.850 Break_up_test_1.ts
ffmpeg version 0.11.1.git Copyright (c) 2000-2012 the FFmpeg developers
  built on Aug 19 2012 11:52:57 with gcc 4.6.3 (Gentoo Hardened 4.6.3 p1.3, pie-0.5.2)
  configuration: --enable-gpl --enable-libx264 --enable-filter=hqdn3d --enable-nonfree --enable-libmp3lame --enable-libfaac --enable-frei0r
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 53.100 / 54. 53.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 11.101 /  3. 11.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[h264 @ 0x1ee5140] mmco: unref short failure
    Last message repeated 5 times
[mpegts @ 0x1ee1240] Stream #3: not enough frames to estimate rate; consider increasing probesize
[NULL @ 0x1ee6d00] start time is not set in estimate_timings_from_pts                                                                                                                                                                     
[mpegts @ 0x1ee1240] PES packet size mismatch                                                                                                                                                                                             
    Last message repeated 1 times
Input #0, mpegts, from '/media/videoPIII/video/The_Break-Up/2012-08-19.00.22.191-0.rec/00001.ts':
  Duration: 02:02:53.47, start: 42770.197300, bitrate: 9146 kb/s
  Program 132 
    Stream #0:0[0x93a]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x941]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16, 192 kb/s
    Stream #0:2[0x93b](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, s16, 256 kb/s
    Stream #0:3[0x924](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
File 'Break_up_test_1.ts' already exists. Overwrite ? [y/N] y
muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'Break_up_test_1.ts':
  Metadata:
    encoder         : Lavf54.25.104
    Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50 fps, 90k tbn, 25 tbc
    Stream #0:1(eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, 256 kb/s
    Stream #0:2(eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
PES packet size mismatch.0 size= 1670647kB time=00:23:07.87 bitrate=9861.1kbits/s     
frame=97537 fps=867 q=-1.0 Lsize= 2290978kB time=00:32:29.58 bitrate=9626.5kbits/s    
video:2043516kB audio:60964kB subtitle:7155 global headers:0kB muxing overhead 8.493097%



===========================


mediainfo Break_up_test_1.ts 
General
ID                                       : 1 (0x1)
Complete name                            : Break_up_test_1.ts
Format                                   : MPEG-TS
File size                                : 2.18 GiB
Duration                                 : 32mn 30s
Overall bit rate                         : 9 621 Kbps

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main at L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=4, N=12
Codec ID                                 : 27
Duration                                 : 32mn 30s
Bit rate                                 : 8 887 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.171
Stream size                              : 2.02 GiB (92%)
Color primaries                          : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics                 : BT.709-5, BT.1361
Matrix coefficients                      : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : 129
Duration                                 : 32mn 30s
Bit rate mode                            : Constant
Bit rate                                 : 256 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -300ms
Stream size                              : 59.5 MiB (3%)
Language                                 : English

Text
ID                                       : 258 (0x102)
Menu ID                                  : 1 (0x1)
Format                                   : DVB Subtitle
Codec ID                                 : 6
Language                                 : English

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 32mn 30s
List                                     : 256 (0x100) (AVC) / 257 (0x101) (AC-3, English) / 258 (0x102) (DVB Subtitle, English)
Language                                 :  / English / English
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television


========================================


More information about the ffmpeg-user mailing list