ffmpeg trouble concatenating similar but different files

When things go wrong your video is basically unplayable or the first video plays fine and then freezes when moving on to the next.  Generally if both videos weren't produced with the exact 100% same settings you will have issues.  You can try the basic concat but it often won't work right.

Solution for me:

My example uses 3 videos in total so "n=3"  and a=1 to include audio.

ffmpeg -threads 12  -i file1.mp4 -i file2.mp4 -i file3.mp4 -filter_complex concat=n=3:v=1:a=1 $outputfile-final.mp4

=======

ffmpeg -i $intro -i $outputfile -i $outtro \
-filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1 [v] [a]" \
-map "[v]" -map "[a]" $outputfile-branded-final.mp4

ffmpeg -i $intro -i uservideoRendered.mp4-branded.mp4 -i $outtro \
> -filter_complex "[0:v:0] [0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1 [v] [a]" \
> -map "[v]" -map "[a]" $outputfile-branded-final.mp4^C

fmpeg -safe 0 -f concat -i files.txt -c copy video_draft.avi
ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
  libavutil      55. 58.100 / 55. 58.100
  libavcodec     57. 89.100 / 57. 89.100
  libavformat    57. 71.100 / 57. 71.100
  libavdevice    57.  6.100 / 57.  6.100
  libavfilter     6. 82.100 /  6. 82.100
  libavresample   3.  5.  0 /  3.  5.  0
  libswscale      4.  6.100 /  4.  6.100
  libswresample   2.  7.100 /  2.  7.100
  libpostproc    54.  5.100 / 54.  5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f22100] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'files.txt':
  Duration: N/A, start: 0.000000, bitrate: 2284 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 1967 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc
    Metadata:
      creation_time   : 2017-06-30T22:34:32.000000Z
      handler_name    : Alias Data Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s
    Metadata:
      creation_time   : 2017-06-30T22:34:32.000000Z
      handler_name    : Alias Data Handler
Output #0, avi, to 'video_draft.avi':
  Metadata:
    ISFT            : Lavf57.71.100
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, q=2-31, 1967 kb/s, 30 fps, 30 tbr, 60 tbn, 60 tbc
    Metadata:
      creation_time   : 2017-06-30T22:34:32.000000Z
      handler_name    : Alias Data Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 317 kb/s
    Metadata:
      creation_time   : 2017-06-30T22:34:32.000000Z
      handler_name    : Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3fe3be0] Auto-inserting h264_mp4toannexb bitstream filter
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3fe3be0] Auto-inserting h264_mp4toannexb bitstream filtered=61.6x   
frame=16287 fps=1824 q=-1.0 Lsize=  385206kB time=00:09:03.50 bitrate=5806.0kbits/s speed=60.9x   
video:372728kB audio:11086kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.362498%


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2af7da0] Found duplicated MOOV Atom. Skipped it

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x33639c0] Auto-inserting h264_mp4toannexb bitstream filter
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x33639c0] Auto-inserting h264_mp4toannexb bitstream filtered= 153x   
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107362, current: 6437563; changing to 16107363. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107363, current: 6437963; changing to 16107364. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107364, current: 6438363; changing to 16107365. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107365, current: 6438763; changing to 16107366. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107366, current: 6439163; changing to 16107367. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107367, current: 6439563; changing to 16107368. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107368, current: 6439963; changing to 16107369. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107369, current: 6440363; changing to 16107370. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107370, current: 6440763; changing to 16107371. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107371, current: 6441163; changing to 16107372. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107372, current: 6441563; changing to 16107373. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107373, current: 6441963; changing to 16107374. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107374, current: 6442363; changing to 16107375. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107375, current: 6442763; changing to 16107376. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107376, current: 6443163; changing to 16107377. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107377, current: 6443563; changing to 16107378. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107378, current: 6443963; changing to 16107379. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107379, current: 6444363; changing to 16107380. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107380, current: 6444763; changing to 16107381. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107381, current: 6445163; changing to 16107382. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107382, current: 6445563; changing to 16107383. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107383, current: 6445963; changing to 16107384. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107384, current: 6446363; changing to 16107385. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107385, current: 6446763; changing to 16107386. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107386, current: 6447163; changing to 16107387. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107387, current: 6447563; changing to 16107388. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107388, current: 6447963; changing to 16107389. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107389, current: 6448363; changing to 16107390. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107390, current: 6448763; changing to 16107391. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107391, current: 6449163; changing to 16107392. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107392, current: 6449563; changing to 16107393. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107393, current: 6449963; changing to 16107394. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107394, current: 6450363; changing to 16107395. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107395, current: 6450763; changing to 16107396. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107396, current: 6451163; changing to 16107397. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107397, current: 6451563; changing to 16107398. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107398, current: 6451963; changing to 16107399. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107399, current: 6452363; changing to 16107400. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107400, current: 6452763; changing to 16107401. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107401, current: 6453163; changing to 16107402. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107402, current: 6453563; changing to 16107403. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107403, current: 6453963; changing to 16107404. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107404, current: 6454363; changing to 16107405. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107405, current: 6454763; changing to 16107406. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107406, current: 6455163; changing to 16107407. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107407, current: 6455563; changing to 16107408. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107408, current: 6455963; changing to 16107409. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107409, current: 6456363; changing to 16107410. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107410, current: 6456763; changing to 16107411. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107411, current: 6457163; changing to 16107412. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107412, current: 6457563; changing to 16107413. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107413, current: 6457963; changing to 16107414. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107414, current: 6458363; changing to 16107415. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107415, current: 6458763; changing to 16107416. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107416, current: 6459163; changing to 16107417. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107417, current: 6459563; changing to 16107418. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107418, current: 6459963; changing to 16107419. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107419, current: 6460363; changing to 16107420. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107420, current: 6460763; changing to 16107421. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107421, current: 6461163; changing to 16107422. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107422, current: 6461563; changing to 16107423. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107423, current: 6461963; changing to 16107424. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107424, current: 6462363; changing to 16107425. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107425, current: 6462763; changing to 16107426. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107426, current: 6463163; changing to 16107427. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107427, current: 6463563; changing to 16107428. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107428, current: 6463963; changing to 16107429. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107429, current: 6464363; changing to 16107430. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107430, current: 6464763; changing to 16107431. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107431, current: 6465163; changing to 16107432. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107432, current: 6465563; changing to 16107433. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107433, current: 6465963; changing to 16107434. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107434, current: 6466363; changing to 16107435. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107435, current: 6466763; changing to 16107436. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107436, current: 6467163; changing to 16107437. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107437, current: 6467563; changing to 16107438. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107438, current: 6467963; changing to 16107439. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107439, current: 6468363; changing to 16107440. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107440, current: 6468763; changing to 16107441. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107441, current: 6469163; changing to 16107442. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107442, current: 6469563; changing to 16107443. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107443, current: 6469963; changing to 16107444. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107444, current: 6470363; changing to 16107445. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107445, current: 6470763; changing to 16107446. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107446, current: 6471163; changing to 16107447. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107447, current: 6471563; changing to 16107448. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107448, current: 6471963; changing to 16107449. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107449, current: 6472363; changing to 16107450. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107450, current: 6472763; changing to 16107451. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107451, current: 6473163; changing to 16107452. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107452, current: 6473563; changing to 16107453. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107453, current: 6473963; changing to 16107454. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107454, current: 6474363; changing to 16107455. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107455, current: 6474763; changing to 16107456. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107456, current: 6475163; changing to 16107457. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107457, current: 6475563; changing to 16107458. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107458, current: 6475963; changing to 16107459. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107459, current: 6476363; changing to 16107460. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107460, current: 6476763; changing to 16107461. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107461, current: 6477163; changing to 16107462. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107462, current: 6477563; changing to 16107463. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107463, current: 6477963; changing to 16107464. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107464, current: 6478363; changing to 16107465. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107465, current: 6478763; changing to 16107466. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107466, current: 6479163; changing to 16107467. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107467, current: 6479563; changing to 16107468. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107468, current: 6479963; changing to 16107469. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107469, current: 6480363; changing to 16107470. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107470, current: 6480763; changing to 16107471. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107471, current: 6481163; changing to 16107472. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107472, current: 6481563; changing to 16107473. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107473, current: 6481963; changing to 16107474. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107474, current: 6482363; changing to 16107475. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107475, current: 6482763; changing to 16107476. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107476, current: 6483163; changing to 16107477. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107477, current: 6483563; changing to 16107478. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107478, current: 6483963; changing to 16107479. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107479, current: 6484363; changing to 16107480. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107480, current: 6484763; changing to 16107481. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107481, current: 6485163; changing to 16107482. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107482, current: 6485563; changing to 16107483. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107483, current: 6485963; changing to 16107484. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107484, current: 6486363; changing to 16107485. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107485, current: 6486763; changing to 16107486. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107486, current: 6487163; changing to 16107487. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107487, current: 6487563; changing to 16107488. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107488, current: 6487963; changing to 16107489. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107489, current: 6488363; changing to 16107490. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107490, current: 6488763; changing to 16107491. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107491, current: 6489163; changing to 16107492. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107492, current: 6489563; changing to 16107493. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107493, current: 6489963; changing to 16107494. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107494, current: 6490363; changing to 16107495. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107495, current: 6490763; changing to 16107496. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107496, current: 6491163; changing to 16107497. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107497, current: 6491563; changing to 16107498. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107498, current: 6491963; changing to 16107499. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107499, current: 6492363; changing to 16107500. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107500, current: 6492763; changing to 16107501. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107501, current: 6493163; changing to 16107502. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107502, current: 6493563; changing to 16107503. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107503, current: 6493963; changing to 16107504. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107504, current: 6494363; changing to 16107505. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107505, current: 6494763; changing to 16107506. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107506, current: 6495163; changing to 16107507. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107507, current: 6495563; changing to 16107508. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107508, current: 6495963; changing to 16107509. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107509, current: 6496363; changing to 16107510. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107510, current: 6496763; changing to 16107511. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107511, current: 6497163; changing to 16107512. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107512, current: 6497563; changing to 16107513. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107513, current: 6497963; changing to 16107514. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107514, current: 6498363; changing to 16107515. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107515, current: 6498763; changing to 16107516. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107516, current: 6499163; changing to 16107517. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107517, current: 6499563; changing to 16107518. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107518, current: 6499963; changing to 16107519. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107519, current: 6500363; changing to 16107520. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107520, current: 6500763; changing to 16107521. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107521, current: 6501163; changing to 16107522. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107522, current: 6501563; changing to 16107523. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107523, current: 6501963; changing to 16107524. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107524, current: 6502363; changing to 16107525. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107525, current: 6502763; changing to 16107526. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107526, current: 6503163; changing to 16107527. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107527, current: 6503563; changing to 16107528. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107528, current: 6503963; changing to 16107529. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107529, current: 6504363; changing to 16107530. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107530, current: 6504763; changing to 16107531. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107531, current: 6505163; changing to 16107532. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107532, current: 6505563; changing to 16107533. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107533, current: 6505963; changing to 16107534. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107534, current: 6506363; changing to 16107535. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107535, current: 6506763; changing to 16107536. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107536, current: 6507163; changing to 16107537. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107537, current: 6507563; changing to 16107538. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107538, current: 6507963; changing to 16107539. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107539, current: 6508363; changing to 16107540. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107540, current: 6508763; changing to 16107541. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107541, current: 6509163; changing to 16107542. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107542, current: 6509563; changing to 16107543. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107543, current: 6509963; changing to 16107544. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107544, current: 6510363; changing to 16107545. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107545, current: 6510763; changing to 16107546. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107546, current: 6511163; changing to 16107547. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107547, current: 6511563; changing to 16107548. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107548, current: 6511963; changing to 16107549. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107549, current: 6512363; changing to 16107550. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107550, current: 6512763; changing to 16107551. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107551, current: 6513163; changing to 16107552. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107552, current: 6513563; changing to 16107553. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107553, current: 6513963; changing to 16107554. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107554, current: 6514363; changing to 16107555. This may result in incorrect timestamps in the output file.
[mp4 @ 0x32c4ca0] Non-monotonous DTS in output stream 0:0; previous: 16107555, current: 6514763; changing to 16107556. This may result in incorrect timestamps in the output file.
frame=16287 fps=1824 q=-1.0 Lsize=  381293kB time=00:22:23.64 bitrate=2324.7kbits/s speed= 150x   
video:369967kB audio:10784kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.142437%

This makes the video about 22 minutes even though it should be about 9!
This is because the main video is CBR audio and the other ones being joined at variable.  To fix they must be constant CBR of 163kbps to match

maybe it's also framerate mode one of them is variable and needs to be constant for the video.
use the -crf flag instead of -r

Frame rate mode                          : Variable


Change FPS to 29.97 or change the "-r 29.97" to whatever frame rate you want
ffmpeg -i 02.mp4 -r 29.97 02-30fps.mp4

#changes to 29.97 fps and sets aac audio to 163kbit constant
ffmpeg -i 02.mp4 -vcodec copy -acodec libfdk_aac -ab 163k -r 29.97 02-30fps.mp4



ffmpeg -i 02.mp4 -vcodec copy  -acodec libfdk_aac -ab 163k -crf 29.97 02-30fps.mp4

ffmpeg -i 02.mp4 -vcodec copy  -acodec libfdk_aac -ab 163k -crf 29.97 -r 29.97 02-30fps.mp4

ffmpeg -i 02.mp4 -vcodec h264  -acodec libfdk_aac -ab 163k -vf "fps=29.97" 02-30fps.mp4


ffmpeg -i initial.mp4 -i initial.mp4 -i initial.mp4 -i ending.mp4 -filter_complex concat=n=4:v=1:a=0 -f MOV output.mp4 -y

ffmpeg -threads 12  -i 02.mp4 -i uservideoRendered.mp4 -i 02.mp4 -filter_complex concat=n=3:v=1:a=0 -acodec copy -f h264 output.mp4 -y
#above works but video is unplayable and time is all wrong and no audio

change concat=n=3:v=1:a=0 to concat=n=3:v=1:a=1

ffmpeg -threads 12  -i 02.mp4 -i uservideoRendered.mp4 -i 02.mp4 -filter_complex concat=n=3:v=1:a=1 output.mp4


Tags:

ffmpeg, concatenating, fileswhen, unplayable, freezes, generally, videos, weren, produced, settings, concat, quot, audio, threads, mp, filter_complex, outputfile, intro, outtro, branded, uservideorendered, fmpeg, txt, video_draft, avi, copyright, developers, gcc, ubuntu, configuration, libs, ldl, prefix, opt, mandir, usr, enable, avresample, disable, debug, nonfree, gpl, libopencore, amrnb, amrwb, decoder, libpulse, libfreetype, gnutls, libx, libfdk, aac, libvorbis, libmp, libopus, libvpx, libspeex, libass, avisynth, libsoxr, libxvid, libvidstab, libwavpack, nvenc, libavutil, libavcodec, libavformat, libavdevice, libavfilter, libavresample, libswscale, libswresample, libpostproc, mov, gp, mj, auto, inserting, _mp, toannexb, bitstream, filter, input, duration, bitrate, kb, stream, eng, avc, yuv, bt, fps, tbr, tbn, tbc, metadata, creation_time, z, handler_name, alias, handler, encoder, coding, lc, hz, stereo, fltp, output, isft, lavf, ff, mapping, fe, filtered, lsize, kbits, subtitle, streams, global, headers, muxing, overhead, af, duplicated, moov, atom, skipped, ca, monotonous, dts, previous, incorrect, timestamps, cbr, variable, kbps, framerate, mode, crf, kbit, vcodec, acodec, libfdk_aac, ab, vf, initial,

Latest Articles

  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -
  • Ubuntu Debian How To Install Recommended Packages Automatically
  • How to set Linux Ubuntu Redhat Debian Command Line http https socks proxy for yum apt