1

I want to concatenate MP4 videos with FFmpeg, the problem is when I want to merge videos taken with Iphone and Android it throws problem:

Non-monotonous DTS in output stream 0:1; previous: 150528, current: 139268; changing to 150529. This may result in incorrect timestamps in the output file.

This is my code

merge.txt

file 'iphone.mp4'
file 'android.mp4'

FFmpeg command

ffmpeg -f concat -i marge.txt -c copy -y merge.mp4

If I can't merge this videos how can I make them with same parameters (frame rate, bitrate...) and merge them?

I use FFmpeg version 2.4.2, because I can't find android FFmpeg library higher then 2.4.2.

This is complete console output of: ffmpeg -i android.mp4 -i iphone.mp4

ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
       built on Oct  7 2014 15:08:46 with gcc 4.8 (GCC)
               configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
               libavutil      54.  7.100 / 54.  7.100
               libavcodec     56.  1.100 / 56.  1.100
               libavformat    56.  4.101 / 56.  4.101
               libavdevice    56.  0.100 / 56.  0.100
               libavfilter     5.  1.100 /  5.  1.100
               libswscale      3.  0.100 /  3.  0.100
               libswresample   1.  1.100 /  1.  1.100
               libpostproc    53.  0.100 / 53.  0.100
             Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'android.mp4':
               Metadata:
                 major_brand     : isom
         minor_version   : 512
                 compatible_brands: isomiso2avc1mp41
         encoder         : Lavf57.21.101
               Duration: 00:00:01.29, start: 0.023220, bitrate: 308 kb/s
         Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 113 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
         Metadata:
                   handler_name    : VideoHandler
         Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 186 kb/s (default)
         Metadata:
                   handler_name    : SoundHandler
     Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'iphone.mp4':
               Metadata:
                 major_brand     : mp42
         minor_version   : 1
                 compatible_brands: mp41mp42isom
         creation_time   : 2016-05-10 09:46:30
               Duration: 00:00:02.63, start: 0.000000, bitrate: 4768 kb/s
         Stream #1:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 101 kb/s (default)
         Metadata:
                   creation_time   : 2016-05-10 09:46:30
                   handler_name    : Core Media Audio
         Stream #1:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280, 4657 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
         Metadata:
                   creation_time   : 2016-05-10 09:46:30
                   handler_name    : Core Media Video
     At least one output file must be specified
Ara Badalyan
  • 1,304
  • 1
  • 12
  • 20

0 Answers0