So I'm trying to concatenate 5 video files. I'm running Linux, and the command line looks like this:
blist.txt contains this:Code:ffmpeg -f concat -safe 0 -i blist.txt -c copy output.mp4
Soon as it starts processing the second file, it throws errors like this, but continues running:Code:file '00 - Test Pattern.mp4' file '01 - In Memoriam.mp4' file 'Feature Presentation 01.mp4' file 'The Head.mp4' file 'Intermission 03.mp4'
The resulting video plays perfectly, up until the end of the 4th video. The 5th video has video, but no audio. Last run I did on this, with the same files, had audio but no video, just a black screen.Code:[mp4 @ 0x1c4c4c0] Non-monotonous DTS in output stream 0:1; previous: 274141424, current: 253439430; changing to 274141425. This may result in incorrect timestamps in the output file.
I know I need to re-encode all the files, but I have no idea what parameters to use, and nobody seems willing to tell me.
Can someone please help me with this? I'm going bald from pulling my hair out over this. 3 days now, and the majority of places I've tried, I either get told "paste the incredibly long log so we can ignore you" or they just ignore me. I'm at my wits end over this.
+ Reply to Thread
Results 1 to 16 of 16
-
-
"Non-monotonous Display Time Stamp" means that a later segment in the concat list does not continue the time stamps from the end of the first segment. That may make seeking in the result unreliable. Therefore, ffmpeg started to fix it by rewriting time stamps.
A warning is not an error. If it were an error, ffmpeg would have aborted.
Regarding the missing video or audio ... that needs someone with more experience than me. -
If the video and audio formats match, why don't you join your files using mkvtoolnix-gui?
-
Because I'm limited to console only. Headless machine, no X server, no gui.
-
So I just tried mkvmerge... Interesting, but no cigar:
Code:charlie@workshop:/mnt/media$ mkvmerge -o "upload/upload.mp4" "upload/00 - Test Pattern.mp4" +"upload/01 - In Memoriam.mp4" +"upload/Feature Presentation 01.mp4" +"upload/Intermission 03.mp4" mkvmerge v8.8.0 ('Wind at my back') 64bit 'upload/00 - Test Pattern.mp4': Using the demultiplexer for the format 'QuickTime/MP4'. 'upload/01 - In Memoriam.mp4': Using the demultiplexer for the format 'QuickTime/MP4'. 'upload/Feature Presentation 01.mp4': Using the demultiplexer for the format 'QuickTime/MP4'. 'upload/Intermission 03.mp4': Using the demultiplexer for the format 'QuickTime/MP4'. 'upload/00 - Test Pattern.mp4' track 0: Using the output module for the format 'AVC/h.264'. 'upload/00 - Test Pattern.mp4' track 1: Using the output module for the format 'AAC'. 'upload/01 - In Memoriam.mp4' track 0: Using the output module for the format 'AVC/h.264'. 'upload/01 - In Memoriam.mp4' track 1: Using the output module for the format 'AAC'. 'upload/Feature Presentation 01.mp4' track 0: Using the output module for the format 'AVC/h.264'. 'upload/Feature Presentation 01.mp4' track 1: Using the output module for the format 'AAC'. 'upload/Intermission 03.mp4' track 0: Using the output module for the format 'AVC/h.264'. 'upload/Intermission 03.mp4' track 1: Using the output module for the format 'AAC'. No append mapping was given for the file no. 1 ('upload/01 - In Memoriam.mp4'). A default mapping of 1:0:0:0,1:1:0:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options. No append mapping was given for the file no. 2 ('upload/Feature Presentation 01.mp4'). A default mapping of 2:0:1:0,2:1:1:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options. No append mapping was given for the file no. 3 ('upload/Intermission 03.mp4'). A default mapping of 3:0:2:0,3:1:2:1 will be used instead. Please keep that in mind if mkvmerge aborts with an error message regarding invalid '--append-to' options. Error: The track number 1 from the file 'upload/Intermission 03.mp4' cannot be appended to the track number 1 from the file 'upload/Feature Presentation 01.mp4'. The track parameters do not match.
-
Here's the data using ffprobe:
Code:charlie@workshop:/mnt/media$ /usr/local/bin/ffmpeg -i "upload/00 - Test Pattern.mp4" ffmpeg version N-92086-gd702769 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: --disable-x86asm libavutil 56. 19.101 / 56. 19.101 libavcodec 58. 31.102 / 58. 31.102 libavformat 58. 18.103 / 58. 18.103 libavdevice 58. 4.105 / 58. 4.105 libavfilter 7. 33.100 / 7. 33.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/00 - Test Pattern.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:02:26.87, start: 0.000000, bitrate: 243 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 106 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler charlie@workshop:/mnt/media$ /usr/local/bin/ffmpeg -i "upload/01 - In Memoriam.mp4" ffmpeg version N-92086-gd702769 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: --disable-x86asm libavutil 56. 19.101 / 56. 19.101 libavcodec 58. 31.102 / 58. 31.102 libavformat 58. 18.103 / 58. 18.103 libavdevice 58. 4.105 / 58. 4.105 libavfilter 7. 33.100 / 7. 33.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/01 - In Memoriam.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:01:32.07, start: 0.000000, bitrate: 219 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 82 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler charlie@workshop:/mnt/media$ /usr/local/bin/ffmpeg -i "upload/99 - End Loop.mp4" ffmpeg version N-92086-gd702769 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: --disable-x86asm libavutil 56. 19.101 / 56. 19.101 libavcodec 58. 31.102 / 58. 31.102 libavformat 58. 18.103 / 58. 18.103 libavdevice 58. 4.105 / 58. 4.105 libavfilter 7. 33.100 / 7. 33.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/99 - End Loop.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:00:15.05, start: 0.000000, bitrate: 236 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 99 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler
-
Are you missing a couple ? Why only 3 ?
upload/00 - Test Pattern.mp4
upload/01 - In Memoriam.mp4
upload/99 - End Loop.mp4
file '00 - Test Pattern.mp4'
file '01 - In Memoriam.mp4'
file 'Feature Presentation 01.mp4'
file 'The Head.mp4'
file 'Intermission 03.mp4'
1) You can try manually demuxing them to elementary streams , then appending video & audio segments separately, but you might still have problems and potential desync . This would be preferred because if it works, you avoid re-encoding and quality loss
2) Higher chance of success is decoding to some I-frame format (uncompressed or lossless compression) and uncompressed PCM audio, append, then re-encode to your final format . This is essentially the same thing as using a NLE which decodes on the timeline. -
So we have a working solution!
Some kind soul took pity of me over on Reddit, and walked me through converting to .mkv format from the original .mp4 format. And the files link up beautifully now!
Keep lurking! -
Last edited by pauloctavio; 4th Oct 2018 at 14:09.
-
-
Hello. I'm running into the same problem as you and I need your solution. Could you be so kind to post it here or PM me how you solve it. Thanks in advanced
Code:ffmpeg -i input1.mp4 -c copy -bsf h264_mp4toannexb temp1.ts ffmpeg -i input2.mp4 -c copy -bsf h264_mp4toannexb temp2.ts ffmpeg -i input3.mp4 -c copy -bsf h264_mp4toannexb temp3.ts ffmpeg -i "concat:temp1.ts|temp2.ts|temp3.ts" -c copy -absf aac_adtstoasc output.mp4
Or you can use MKVToolNix as suggested above, with the “append” feature. -
-
I would be very thankful if someone'd described to me what exactly "-bsf h264_mp4toannexb" command does though, just for the sake of knowledge.users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
FFMpeg "non-monotonous DTS in output stream" error
By CursedLemon in forum Video ConversionReplies: 4Last Post: 26th Aug 2018, 09:56 -
How to fix DTS non monotonous error in ffmpeg
By Chemist116 in forum RestorationReplies: 2Last Post: 23rd Aug 2017, 12:24 -
(Willing to pay)ffmpeg Need help downloading live stream ffmpeg and rtmp
By grabyea in forum Video Streaming DownloadingReplies: 0Last Post: 10th Apr 2016, 16:54 -
ffmpeg trim + concat = Non-monotonous DTS errors
By TorBru in forum Video ConversionReplies: 9Last Post: 27th Dec 2015, 05:33