[FFmpeg-trac] #2989(avformat:new): broken remuxing DVB subtitles from MPEG-TS to MPEG-TS

FFmpeg trac at avcodec.org
Tue Dec 24 10:34:42 CET 2013


#2989: broken remuxing DVB subtitles from MPEG-TS to MPEG-TS
-------------------------------------+-------------------------------------
             Reporter:  ubitux       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  mpegts       |               Blocked By:
  dvbsub                             |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by mrlika):

 Hi,

 I know the issue of the problem but I need FFmpeg expert advice in
 choosing a way of fixing it.

 Description of the issue:

 DVB subtitles have the following format in MPEG-TS stream:

 data_identifier 8bit - always set to 0x20
 subtitle_stream_id 8bit - always set to 0x00
 subtitling_segments - actual payload
 end_of_PES_data_field_makrer 8bit - always set to 0xFF

 MPEG-TS demuxer throws everything except subtitling_segments and produces
 AVPacket.data in FORMAT 1:

 subtitling_segments - actual payload


 DVB subtitles decoder also expects AVPacket.data in FORMAT 1.


 DVB subtitles encoder produces AVPacket.data in FORMAT 2:

 subtitle_stream_id 8bit - always set to 0x00
 subtitling_segments - actual payload
 end_of_PES_data_field_makrer 8bit - always set to 0xFF

 MPEG-TS muxer expects AVPacket.data to be in FORMAT 2 also.

 So we have problem: from one hand demuxed and decoder work with
 AVPacket.data in FORMAT 1, from other hand encoder and muxer work with
 AVPacket data in FORMAT 2.

 That is why when you copy subtitles directly from demuxer into muxer you
 get incorrect subtitles stream.

 I see three possible ways of fixing the issue:

 1) Use FORMAT 1 everywhere (i.e. fix DVB subtitles encoder and all muxers
 that support DVB subtitles to use FORMAT 1)

 2) Use FORMAT 2 everywhere (i.e. fix DVB subtitles decoder and all
 demuxers that produce DVB subtitles to user FORMAT 2)

 3) Use some other format for AVPacket.data with DVB subtitles and fix all
 the components to work with it.

 Can you please advice the correct way of solving the issue?

 Regards,
 Andriy Lysnevych

--
Ticket URL: <https://trac.ffmpeg.org/ticket/2989#comment:3>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list