Warning "[mp4 @ 0x3166f20]Non-monotonous DTS in output stream 0:0" and the concatenated video is corrupt

Asked by Vanamali

I use ffmpeg to concatenate various video files into a single file. The input and output files are both mp4 files. The command I use is "ffmpeg -f concat -i W.txt -c copy W9L25.mp4" where the file W.txt contains the list of input files and W9L25.mp4 is the output file. So far I faced no problem in executing the above command. However, when I tried to use the command today, I got " Non-monotonous DTS in output stream 0:0" as warning. The warning message repeated many times and finally the process came to a halt. On checking the output video, I found that the video and audio quality of the first input file were fine but the videos of subsequent input files were missing and their audio quality had also changed. How to solve this problem?

Some details:

Hardware: Lenovo Z50-70, i5, 8GB RAM, nvidia geforce GF117M

Software:
uname -a :
 Linux Enigma 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

lsb_release :
 LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch

ffmpeg -version:
ffmpeg version 2.6.git Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/home/vanamali/ffmpeg_build --extra-cflags=-I/home/vanamali/ffmpeg_build/include --extra-ldflags=-L/home/vanamali/ffmpeg_build/lib --bindir=/home/vanamali/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 29.100 / 56. 29.100
libavformat 56. 26.101 / 56. 26.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 13.101 / 5. 13.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100

Please help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ffmpeg Edit question
Assignee:
No assignee Edit question
Solved by:
Vanamali
Solved:
Last query:
Last reply:
Revision history for this message
Vanamali (vanamalishastry) said :
#1

The output of the concatenation process is:

vanamali@Enigma:~/Videos/HighPSciComp/W$ ffmpeg -f concat -i W.txt -c copy W9L25.mp4
ffmpeg version 2.6.git Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/vanamali/ffmpeg_build --extra-cflags=-I/home/vanamali/ffmpeg_build/include --extra-ldflags=-L/home/vanamali/ffmpeg_build/lib --bindir=/home/vanamali/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
  libavutil 54. 20.100 / 54. 20.100
  libavcodec 56. 29.100 / 56. 29.100
  libavformat 56. 26.101 / 56. 26.101
  libavdevice 56. 4.100 / 56. 4.100
  libavfilter 5. 13.101 / 5. 13.101
  libswscale 3. 1.101 / 3. 1.101
  libswresample 1. 1.100 / 1. 1.100
  libpostproc 53. 3.100 / 53. 3.100
Input #0, concat, from 'W.txt':
  Duration: N/A, start: 0.000000, bitrate: 232 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 104 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s
File 'W9L25.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'W9L25.mp4':
  Metadata:
    encoder : Lavf56.26.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=2-31, 104 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 127 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448129, current: 12873; changing to 15448130. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448130, current: 12874; changing to 15448131. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448131, current: 12875; changing to 15448132. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448132, current: 12876; changing to 15448133. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448133, current: 12877; changing to 15448134. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448134, current: 12878; changing to 15448135. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448135, current: 12879; changing to 15448136. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448136, current: 12880; changing to 15448137. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448137, current: 12881; changing to 15448138. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448138, current: 12882; changing to 15448139. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3924240] Non-monotonous DTS in output stream 0:0; previous: 15448139, current: 12883; changing to 15448140. This may result in incorrect timestamps in the output file.

[...]

[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213228, current: 75654; changing to 59213229. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213229, current: 75655; changing to 59213230. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213230, current: 75656; changing to 59213231. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213231, current: 75657; changing to 59213232. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213232, current: 75658; changing to 59213233. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213233, current: 75659; changing to 59213234. This may result in incorrect timestamps in the output file.
[mp4 @ 0x2dfa240] Non-monotonous DTS in output stream 0:0; previous: 59213234, current: 75660; changing to 59213235. This may result in incorrect timestamps in the output file.
frame=79180 fps=1957 q=-1.0 Lsize= 75058kB time=00:54:54.18 bitrate= 186.7kbits/s
video:25884kB audio:47245kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.638011%
vanamali@Enigma:~/Videos/HighPSciComp/W$

Have truncated the warning message ([...] represents truncation).

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3
Revision history for this message
Vanamali (vanamalishastry) said :
#4

Thank you for the reply!

I tried both the links. mp4joiner doesn't install. Got the following:

     " sudo apt-get install ffmpeg-real mp4joiner
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mp4joiner : Depends: libwxsvg2 but it is not installable
E: Unable to correct problems, you have held broken packages."

gpac successfully installed. But upon running the command "MP4Box -cat 1.mp4 -cat 2.mp4 -new W9L25-1.mp4" I got an mp4 file which was 274:51:27 hrs long whereas the input videos combined were not more than 20 min long!

Revision history for this message
Vanamali (vanamalishastry) said :
#5

Edit: Also only the A/V from the first input file was present.

Revision history for this message
Vanamali (vanamalishastry) said :
#6

Used openshot editor. Joined the videos successfully. Thanks for all the help!