Opened 6 years ago

Last modified 6 years ago

#6908 new defect

Concatenating mpegts files into stream longer than timestamp wrap can produce non-monotonic timestamps

Reported by: calwilson Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: concat mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

When concatenating multiple mpeg transport stream assets into a continuous mpeg transport stream, ffmpeg reports errors of non-monotonic timestamps. These timestamps are then changed to old_timestamp + 1 which produces an invalid stream.

As far as I can tell it seems to be some interplay between the concat demuxer and the timestamp wrapping logic. If the timestamp is within 60s before the the max timestamp at a file inpoint, it triggers the subtract offset timestamp wrap logic which produces negative timestamps.

I include the asset and playlist, and the ffmpeg logs.

How to reproduce:

% ffmpeg -report -nostdin -hide_banner -loglevel trace -nostats -probesize 1000000 -analyzeduration 5000000 -max_delay 0 -fflags +genpts -async 1 -f concat -y -i tears_playlist.ffmpeg -map 0 -c copy -copy_unknown -f mpegts -muxrate 1 -pcr_period 30 -pes_payload_size 50 -metadata service_provider=test -metadata service_name=test -mpegts_original_network_id 31303 -mpegts_transport_stream_id 1 -mpegts_flags +system_b -tables_version 0 /dev/null
ffmpeg version git master
built on Ubuntu 16.04 LTS 64bit

Attachments (1)

tears_playlist.ffmpeg (65.8 KB ) - added by calwilson 6 years ago.
Recursive playlist of asset

Download all attachments as: .zip

Change History (3)

by calwilson, 6 years ago

Attachment: tears_playlist.ffmpeg added

Recursive playlist of asset

comment:1 by calwilson, 6 years ago

I'm unable to connect to the FTP server so I have uploaded the asset and ffmpeg logs to my google drive:


comment:2 by Carl Eugen Hoyos, 6 years ago

Component: ffmpegundetermined
Keywords: concat added; concatdec removed
Note: See TracTickets for help on using tickets.