Opened 7 years ago

#6531 new defect

MPEG-TS encoder may stop emitting SDT/PAT/PMT after DTS jump or rollover

Reported by: Jernej Virag Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


When transcoding broadcast MPEG-TS streams, there may be jumps or a rollover in PTS/DTS values in stream. That's perfectly valid, however ffmpeg's MPEG-TS muxer may stop emitting SDT/PAT/PMT tables.

The issue was tracked down to retransmit_si_info method where two following comparisons are made:

        (dts != AV_NOPTS_VALUE && dts - ts->last_sdt_ts >= ts->sdt_period*90000.0)
        if (dts != AV_NOPTS_VALUE)
            ts->last_sdt_ts = FFMAX(dts, ts->last_sdt_ts);


        (dts != AV_NOPTS_VALUE && dts - ts->last_pat_ts >= ts->pat_period*90000.0) ||
        if (dts != AV_NOPTS_VALUE)
            ts->last_pat_ts = FFMAX(dts, ts->last_pat_ts);

All those comparisons fail to take into account the possibility of DTS regressing which means a negative DTS jump will cause the muxer to stop emitting SDT tables alltogether in all streams and PAT/PMT tables alltogether in audio-only streams.

Change History (0)

Note: See TracTickets for help on using tickets.