[FFmpeg-trac] #4855(avformat:new): Support subtitles in (most likely) broken old vdr recordings

FFmpeg trac at avcodec.org
Tue Aug 23 00:34:23 EEST 2016


#4855: Support subtitles in (most likely) broken old vdr recordings
-------------------------------------+-------------------------------------
             Reporter:  cehoyos      |                    Owner:
                 Type:  enhancement  |                   Status:  new
             Priority:  wish         |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  mpegps       |               Blocked By:
  dvbsub dvdsub                      |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by keynet):

 I got to the bottom of this

 Old VDR (1.x) adds a 4 byte "subheader" 0x20, 0x01, 0x00, 0x00 ahead of
 the subtitle data to indicate beginning of subtitle page. Subsequent
 fragments have 0x20, 0x01, 0x00, 0x01 headers.  It is necessary to decode
 the packets containing fragments of segments, which may be spread over
 multiple packets (VDR limits packet size to 2048 bytes by default), so a
 number of packets may be needed to get a complete PES packet with a
 complete set of segments describing a single subtitle. VDR puts the PTS
 for the subtitle in the first packet only.

 Once the various fragments are assembled into a set of segments, the
 subtitles conform to standard EN 300 743 dvbsub segments, and ffmpeg can
 recognise them.

 However ffmpeg often probes them as "bin_data" not "dvbsub" due to
 broadcasters regularly sending what I call "cleardown" PES packets
 containing just page and region composition segments, these look like this
 in dvbsnoop.  IMHO dvbsub.c is a bit too simplistic in its stream scoring,
 and should really recognise these as valid, or at least probe further for
 "real" subtitle data. Using -analyzeduration and -probesize switches don't
 usually help much, if at all, in this respect.
 {{{
 VDR hdr:v--v--v--v  ETSI subs >>>>>>
 0000:  20 01 00 00 20 00 0f 10  00 02 00 02 3c 84 0f 11    ... .......<...
 0010:  00 02 00 0a 01 f0 02 d0  00 20 48 01 00 00 0f 11   ......... H.....
 0020:  00 02 00 0a 02 50 02 d0  00 20 48 02 00 00 0f 11   .....P... H.....
 0030:  00 02 00 0a 03 40 02 d0  00 20 48 03 00 00 0f 11   ..... at ... H.....
 0040:  00 02 00 0a 04 80 02 d0  00 20 48 04 00 00 0f 80   ......... H.....
 0050:  00 02 00 00 ff                                     .....
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4855#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list