<p>This is due to the different configurations/formats of your input files, like fps. You need to convert all the files to the sample configuration.</p>
<p>You can refer to my answer <a href="https://superuser.com/questions/1730350/i-want-to-concatenate-two-mp4-files-but-ffmpeg-shows-an-error-all-over/1748092#1748092">here</a>.</p>

CC BY-SA 4.0
2022-10-18T09:51:08.477Z
2022-10-18T09:51:08.477Z
Karim
<p>Adding all <code>mp4</code> file in the directory with FFMPEG .</p>
<p>my usual command:</p>
<pre><code>ffmpeg -f concat -safe 0 -i &lt;(for f in ./*.mp4; do echo &quot;file '$PWD/$f'&quot;; done) -c copy output.mp4
</code></pre>
<p>This shows below problem sometimes.</p>
<p>Now what do i need to do to resolve this problem?</p>
<pre><code>[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783482, current: 16149020; changing to 26783483. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783483, current: 16150020; changing to 26783484. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783484, current: 16151020; changing to 26783485. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783485, current: 16152020; changing to 26783486. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783486, current: 16153020; changing to 26783487. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783487, current: 16154020; changing to 26783488. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783488, current: 16155020; changing to 26783489. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783489, current: 16156020; changing to 26783490. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783490, current: 16157020; changing to 26783491. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783491, current: 16158020; changing to 26783492. This may result in incorrect timestamps in the output file.
</code></pre>
<p>I have tried Multiple solutions:</p>
<pre><code>ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i &lt;(for f in ./*.mp4; do echo &quot;file '$PWD/$f'&quot;; done) -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 -c copy output.mp4
</code></pre>
<pre><code>ffmpeg -f concat -safe 0 -use_wallclock_as_timestamps 1 -i &lt;(for f in ./*.mp4; do echo &quot;file '$PWD/$f'&quot;; done) -acodec copy -vcodec copy output.mp4
</code></pre>
<pre><code>ffmpeg -f concat -err_detect ignore_err -safe 0 -i &lt;(for f in ./*.mp4; do echo &quot;file '$PWD/$f'&quot;; done) -c copy output.mp4
</code></pre>
<pre><code>ffmpeg -f concat -safe 0 -i &lt;(for f in ./*.mp4; do echo &quot;file '$PWD/$f'&quot;; done) -filter_complex &quot;[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] concat=n=3:v=1:a=1 [vv] [aa]&quot; -map &quot;[vv]&quot; -map &quot;[aa]&quot; -c copy output.mp4
</code></pre>
<p>I have tried from</p>
<ul>
<li><a href="https://stackoverflow.com/questions/57167127/non-monotonous-dts-in-output-stream-00-this-may-result-in-incorrect-timestamps">https://stackoverflow.com/questions/57167127/non-monotonous-dts-in-output-stream-00-this-may-result-in-incorrect-timestamps</a></li>
<li><a href="https://stackoverflow.com/questions/53021266/non-monotonous-dts-in-output-stream-previous-current-changing-to-this-may-result">https://stackoverflow.com/questions/53021266/non-monotonous-dts-in-output-stream-previous-current-changing-to-this-may-result</a></li>
</ul>
<p>But none of their solutions worked for me.</p>

<ffmpeg><video><mp4><concatenation>
"Non-monotonous DTS in output stream 0:0 This may result in incorrect timestamps in the output file." error
Shezan
# "Non-monotonous DTS in output stream 0:0 This may result in incorrect timestamps in the output file." error

(Asked by: username_0 on 2022-08-25)

Adding all mp4 file in the directory with FFMPEG .
my usual command:
ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy output.mp4

This shows below problem sometimes.
Now what do i need to do to resolve this problem?
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783482, current: 16149020; changing to 26783483. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783483, current: 16150020; changing to 26783484. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783484, current: 16151020; changing to 26783485. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783485, current: 16152020; changing to 26783486. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783486, current: 16153020; changing to 26783487. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783487, current: 16154020; changing to 26783488. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783488, current: 16155020; changing to 26783489. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783489, current: 16156020; changing to 26783490. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783490, current: 16157020; changing to 26783491. This may result in incorrect timestamps in the output file.
[mp4 @ 0x556a367c4200] Non-monotonous DTS in output stream 0:0; previous: 26783491, current: 16158020; changing to 26783492. This may result in incorrect timestamps in the output file.

I have tried Multiple solutions:
ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 -c copy output.mp4

ffmpeg -f concat -safe 0 -use_wallclock_as_timestamps 1 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -acodec copy -vcodec copy output.mp4

ffmpeg -f concat -err_detect ignore_err -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy output.mp4

ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -filter_complex "[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] concat=n=3:v=1:a=1 [vv] [aa]" -map "[vv]" -map "[aa]" -c copy output.mp4

I have tried from

https://stackoverflow.com/questions/57167127/non-monotonous-dts-in-output-stream-00-this-may-result-in-incorrect-timestamps
https://stackoverflow.com/questions/53021266/non-monotonous-dts-in-output-stream-previous-current-changing-to-this-may-result

But none of their solutions worked for me.

**Tags:** ffmpeg, video, mp4, concatenation


---

## 1 answers

### Answer by username_1 on 2022-10-18. Score: 0

This is due to the different configurations/formats of your input files, like fps. You need to convert all the files to the sample configuration.

You can refer to my answer [here](https://superuser.com/questions/1730350/i-want-to-concatenate-two-mp4-files-but-ffmpeg-shows-an-error-all-over/1748092#1748092).


---

