10

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.

ihnatkuk
  • 147
  • 3
  • 8
  • 1.mp4 contains a "count" of the bytes in the file. After processing "count" bytes (exactly the file 1.mp4 contents), the reading of the stream stops and the rest is ignored. You can use stream concat only with raw streams (f.i. VOB). The file concat processes each file as a new stream. – Martin May 25 '19 at 13:09

2 Answers2

8

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.

Hunter Perrin
  • 243
  • 3
  • 5
1

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.

ihnatkuk
  • 147
  • 3
  • 8
  • 4
    Your command in your question uses the [concat protocol](http://ffmpeg.org/ffmpeg-protocols.html#concat). Your command in your answer uses the [concat demuxer](http://ffmpeg.org/ffmpeg-formats.html#concat). [These are different](http://ffmpeg.org/faq.html#How-can-I-join-video-files_003f). – llogan Oct 12 '14 at 19:02
  • 1
    @LordNeckbeard Thanks for pointing out the difference. I didn't make the distinction before... http://www.ffmpeg.org/faq.html#How-can-I-concatenate-video-files_003f – Sun Dec 27 '14 at 16:02
  • what is ffmpeg-sound.txt? – Duck Nov 29 '15 at 19:56
  • 1
    This is of no help if someone WANTS to use the concat protocol. The concat protocol is SIGNIFICANTLY faster in some circumstances. – user3541092 Jun 05 '17 at 17:28