Non-monotonous DTS in output stream previous current changing to This may result in incorrect timestamps in the output file

21,928

The concat demuxer will select portions of the input outside the stated range if that portion is required for decoding purposes. These will cause a timestamp clash as well extra material in your output. You'll need to use the select filter to get rid of them.

ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i file.txt -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 out.mp4
Share:
21,928
Vitalis Hommel
Author by

Vitalis Hommel

Adresse: Vitalis Hommel, Stangestraße 33, 44795 Bochum Geburtsdatum: 16.05.1963 Beruf: Albanologe Interessen: Wandern, Hobbys und Hobbys Internetadresse: http://www.vitalishommel.de ICQ-Nummer: 558726104 Aim: vitalishommel Twitter: http://www.twitter.com/vitalishommel Skype: hommelvitalis

Updated on July 09, 2022

Comments

  • Vitalis Hommel
    Vitalis Hommel almost 2 years

    I am having a file.txt with rather close snippets

    file 'input.mp4'
    inpoint 1.5402465510368346
    outpoint 2.722609395980835
    file 'input.mp4'
    inpoint 3.192511146068573
    outpoint 7.074568028450012
    file 'input.mp4'
    inpoint 7.851800565719604
    outpoint 9.023683423995971
    file 'input.mp4'
    inpoint 10.054571752548219
    outpoint 12.008032734394073
    file 'input.mp4'
    inpoint 18.70977670431137
    outpoint 21.20993923664093
    file 'input.mp4'
    inpoint 24.51183382153511
    outpoint 26.465287650823594
    ...
    

    I concat them with

    ffmpeg -safe 0 -f concat -i file.txt out.mp4
    

    and I tried

    ffmpeg -use_wallclock_as_timestamps 1 -safe 0 -f concat -i file.txt out.mp4
    

    Yet I get

    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 2069, current: 2067; changing to 2070. This may result in incorrect timestamps in the output file.
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 2070, current: 2067; changing to 2071. This may result in incorrect timestamps in the output file.
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 2071, current: 2067; changing to 2072. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 2758, current: 2756; changing to 2759. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
        Last message repeated 5 times
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7581, current: 7579; changing to 7582. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7582, current: 7579; changing to 7583. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7583, current: 7579; changing to 7584. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7584, current: 7579; changing to 7585. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7585, current: 7579; changing to 7586. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7586, current: 7579; changing to 7587. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7587, current: 7579; changing to 7588. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7588, current: 7579; changing to 7589. This may result in incorrect timestamps in the output file.
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7589, current: 7579; changing to 7590. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    [mp4 @ 00000178c514cc00] Non-monotonous DTS in output stream 0:1; previous: 7590, current: 7579; changing to 7591. This may result in incorrect timestamps in the output file.
    [aac @ 00000178c50f8a80] Queue input is backward in time
    

    And the final file is cut at wrong places.

    How to make the file.txt work?

  • Guglie
    Guglie about 4 years
    select filter documentation at this link 👈
  • Hashim Aziz
    Hashim Aziz about 3 years
    Since this requires a re-encode, does it render the concat demuxer redundant? At that point would it be the same thing to just encode without using the concat demuxer?
  • Gyan
    Gyan about 3 years
    You would have to feed all files individually as inputs with -ss and -to for each and then use concat filter. If it's a few files, manageable else it will get too tedious.
  • QkiZ
    QkiZ about 2 years
    it also works with x11grab