[FFmpeg-trac] #9006(undetermined:new): merge_pmt_versions not working properly for transportstream with multiple streams having same stream_identifier

FFmpeg trac at avcodec.org
Tue Nov 24 00:53:06 EET 2020


#9006: merge_pmt_versions not working properly for transportstream with multiple
streams having same stream_identifier
-------------------------------------+-------------------------------------
             Reporter:  deeptho      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 Some transport streams contain multiple audio streams with the
 the same stream_identifier. In this case, when the merge_pmt_versions
 option is activated, ffmpeg gets confused.



 How to reproduce:

 Compare

 {{{
 ffplay -ast 0 00_20201123_230057.ts

   Stream #0:0[0x1b6]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
 yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50
 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1c1](ita): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
 stereo, fltp, 448 kb/s
     Stream #0:2[0x1c2](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 stereo, fltp, 128 kb/s
     Stream #0:3[0x24c](ita,ita,eng): Subtitle: dvb_teletext ([6][0][0][0]
 / 0x0006), 492x250
     Stream #0:4[0x28a](Oth): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 mono, fltp, 64 kb/s
     Stream #0:5[0xbb9]: Unknown: none ([11][0][0][0] / 0x000B)
     Stream #0:6[0xbba]: Unknown: none ([11][0][0][0] / 0x000B)
     Stream #0:7[0x7d1]: Unknown: none ([5][0][0][0] / 0x0005)
     Stream #0:8[0x7d2]: Unknown: none ([5][0][0][0] / 0x0005)
     Stream #0:9[0xc1d]: Unknown: none ([12][0][0][0] / 0x000C)

 }}}
 to
 {{{
 ffplay -merge_pmt_versions 1 -ast 0 00_20201123_230057.ts

    Stream #0:0[0x1b6]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
 yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50
 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x1c1](ita): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
 stereo, fltp, 448 kb/s
     Stream #0:2[0x1c2](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 stereo, fltp, 96 kb/s
     Stream #0:3[0x24c](ita,ita,eng): Subtitle: dvb_teletext ([6][0][0][0]
 / 0x0006), 492x250
     Stream #0:4[0xbb9]: Unknown: none ([11][0][0][0] / 0x000B)
     Stream #0:5[0xbba]: Unknown: none ([11][0][0][0] / 0x000B)
     Stream #0:6[0x7d1]: Unknown: none ([5][0][0][0] / 0x0005)
     Stream #0:7[0x7d2]: Unknown: none ([5][0][0][0] / 0x0005)
     Stream #0:8[0xc1d]: Unknown: none ([12][0][0][0] / 0x000C)


 }}}

 The second mp2 stream is missing.

 Note that this test stream does not
 have pmt changes. The net effect is that in my own viewer
 that I am developing the stream fails to play back properly.
 I have not been able to create a simple ffplay command that
 actually shows a failing playback,

 Still an inspection of the source shows the problem:
 when the very first pmt is loaded,
 "find_matching_stream" is called
 with the following audio streams:

 pid 450 (eng), stream_identifier=2
 pid 650 (Oth), stream_identifier=2
 ...

 The code then decides that 650 replaces 450, which is
 of course incorrect.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9006>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list