Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg 2.4.2 concatenate mp4 files

I am trying to concatenate some mp4 files one after another. I execute the following:

ffmpeg -i concat:1.mp4\|2.mp4\|3.mp4\|4.mp4 -c copy final_output.mp4

But always get the message "[mov,mp4,m4a,3gp,3g2,mj2 @ 0x148d420] Found duplicated MOOV Atom. Skipped it"

Here is the output:

    ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  6 2014 17:33:05 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared --enable-avresample --disable-stripping --enable-gpl --enable-version3 --enable-runtime-cpudetect --build-suffix=.ffmpeg --enable-postproc --enable-x11grab --enable-libcdio --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libvo-aacenc --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libopus --enable-pthreads --enable-zlib --enable-libvpx --enable-libfreetype --enable-libpulse --enable-debug=3
  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
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x148d420] Found duplicated MOOV Atom. Skipped it
    Last message repeated 2 times
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'concat:1.mp4|2.mp4|3.mp4|4.mp4':
  Metadata:
    encoder         : Lavf56.4.101
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
  Duration: 00:00:10.00, start: 0.000000, bitrate: 741 kb/s
    Stream #0:0(und): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p, 640x480, 177 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Output #0, mp4, to 'final_output.mp4':
  Metadata:
    compatible_brands: isomiso2avc1mp41
    major_brand     : isom
    minor_version   : 512
    encoder         : Lavf56.4.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv422p, 640x480, q=2-31, 177 kb/s, 30 fps, 15360 tbn, 15360 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  300 fps=0.0 q=-1.0 Lsize=     221kB time=00:00:09.90 bitrate= 183.0kbits/s    
video:217kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.995090%

As result I have output file, which contains the 1.mp4 only.

I heard about mp4 can not be concatenated without re-encoding. But actually I have this problem (Found duplicated MOOV Atom) for any format, which I tried (ts, mpg and etc.).

Please let me know what is wrong here. Because it seems like nobody has the same problem as me.

Thanks in advance.

like image 384
ihnatkuk Avatar asked Oct 08 '14 15:10

ihnatkuk


2 Answers

You answer is correct, but not complete. The solution is to use a concat script, which it looks like you did. The "ffmpeg-sound.txt" in your answer will look something like this:

file 1.mp4
file 2.mp4
file 3.mp4
file 4.mp4

With that file, you provide it to ffmpeg as the input using the concat format:

ffmpeg -f concat -i ffmpeg-sound.txt -c copy final_output.mp4

Thank you for posting the solution. I hope this clarification of the input file format helps the next person.

like image 183
Hunter Perrin Avatar answered Oct 10 '22 16:10

Hunter Perrin


I have found the solution, which works for me:

ffmpeg -f concat -i ffmpeg-sound.txt -c copy output-sound.mp4

It is pretty strange why the other ones didn't work, because it seems to me that this is almost the same.

like image 1
ihnatkuk Avatar answered Oct 10 '22 18:10

ihnatkuk