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

Bernd Butscheidt bbutscheidt at yahoo.de
Sat Sep 1 11:20:19 CEST 2012



________________________________
> From: Roger Pack <rogerdpack2 at gmail.com>
>To: FFmpeg user questions <ffmpeg-user at ffmpeg.org> 
>Sent: Monday, August 20, 2012 6:07 PM
>Subject: Re: [FFmpeg-user] How do I encode DVB Subtitles?
> 
>> 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).
>
>what about ffplay? :)
>-r




Sorry for the long delay. Here is another example using ffplay:

1. ffplay output playing the source file. DVBsubs are shown!
2. the cutting with ffmpeg
3. ffplay output of the cut file. A subtitle stream is shown but the streams seems to empty (no subtitles are shown on the screen).


====================================
1. ffplay output playing the source file. DVBsubs are shown!

./ffplay_g /w_LD2/ProjectX/Break_up_smart.ts 
ffplay version 0.11.1.git Copyright (c) 2003-2012 the FFmpeg developers
  built on Sep  1 2012 10:49:23 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. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.101 /  3. 15.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x2c56de0] max_analyze_duration 5000000 reached at 5000000
Input #0, mpegts, from '/w_LD2/ProjectX/Break_up_smart.ts':
  Duration: 01:39:25.09, start: 43067.989300, bitrate: 9116 kb/s
  Program 132 
    Stream #0:0[0x93a]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 49 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)
Frame changed from size:0x0 to size:1920x1080KB vq= 4616KB sq=    0B f=0/0   
[h264 @ 0x2dcdbc0] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
[h264 @ 0x2d66d60] mmco: unref short failure4929KB sq=    0B f=0/0   
[h264 @ 0x2c8c6c0] mmco: unref short failure
43070.81 A-V: -0.008 fd=  10 aq=  422KB vq=14927KB sq=    0B f=1/0  


=========================================================
2. the cutting with ffmpeg

./ffmpeg_g -i /w_LD2/ProjectX/Break_up_smart.ts -map 0:0 -vcodec copy -map 0:2 -acodec copy -map 0:3 -scodec copy -ss 0:04:57.31 -t 00:01:30.850 Break_up_smart_cut_1.ts
ffmpeg version 0.11.1.git Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep  1 2012 10:49:23 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. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.101 /  3. 15.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x33d4240] max_analyze_duration 5000000 reached at 5000000
Input #0, mpegts, from 'Break_up_smart.ts':
  Duration: 01:39:25.09, start: 43067.989300, bitrate: 9116 kb/s
  Program 132 
    Stream #0:0[0x93a]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 49 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)
[mpegts @ 0x33dbf60] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 'Break_up_smart_cut_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, 49 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
frame= 4541 fps=408 q=-1.0 Lsize=   87471kB time=00:01:30.87 bitrate=7885.2kbits/s    
video:77383kB audio:2839kB subtitle:242 global headers:0kB muxing overhead 8.708271%


==========================================================
ffplay output of the cut file. A subtitle stream is shown but the 
streams seems to empty (no subtitles are shown on the screen).

./ffplay_g /w_LD2/ProjectX/Break_up_smart_cut_1.ts 
ffplay version 0.11.1.git Copyright (c) 2003-2012 the FFmpeg developers
  built on Sep  1 2012 10:49:23 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. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.101 /  3. 15.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[h264 @ 0x2b2cdc0] mmco: unref short failure
    Last message repeated 5 times
[mpegts @ 0x2b0bd20] max_analyze_duration 5000000 reached at 5000000
[NULL @ 0x2b0b1a0] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from '/w_LD2/ProjectX/Break_up_smart_cut_1.ts':
  Duration: 00:01:30.94, start: 1.426711, bitrate: 7879 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: 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[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, s16, 256 kb/s
    Stream #0:2[0x102](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
[h264 @ 0x2c30d60] mmco: unref short failureKB vq= 3410KB sq=    0B f=0/0   
    Last message repeated 1 times 0 aq=  307KB vq= 5952KB sq=    0B f=0/0   
[h264 @ 0x2bec0c0] mmco: unref short failure
    Last message repeated 3 times 0 aq=  728KB vq=14637KB sq=    0B f=0/0   
Frame changed from size:0x0 to size:1920x1080
  79.01 A-V:  0.010 fd=  14 aq=  452KB vq=14722KB sq=    0B f=0/0   f=0/0


More information about the ffmpeg-user mailing list