[FFmpeg-user] How to concatenate multiple mp4 files without re-encoding to an intermediate format

Rares Pop raresp at axz.ro
Fri Aug 31 12:08:59 CEST 2012


command
ffmpeg -i file1.mp4 -i file2.mp4 -vcodec copy -acodec copy  -y asset.mp4
output
ffmpeg version git-2012-08-27-60924df Copyright (c) 2000-2012 the FFmpeg developers
  built on Aug 27 2012 13:36:43 with gcc 4.5.3 (GCC) 20120403 (ALT Linux 4.5.3-alt1.M60P.1)
  configuration: --enable-gpl --enable-libfdk-aac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libx264 --enable-nonfree --enable-version3 --enable-yasm
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 54.100 / 54. 54.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 13.101 /  3. 13.101
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.25.104
  Duration: 00:05:00.03, start: 0.000000, bitrate: 961 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [SAR 12:11 DAR 15:11], 850 kb/s, 50 fps, 50 tbr, 50 tbn, 100 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(rus): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, s16, 104 kb/s
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'file2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.25.104
  Duration: 00:03:00.05, start: 0.000000, bitrate: 963 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [SAR 12:11 DAR 15:11], 852 kb/s, 50 fps, 50 tbr, 50 tbn, 100 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(rus): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, s16, 104 kb/s
    Metadata:
      handler_name    : SoundHandler
Output #0, mp4, to 'asset.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.25.104
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 12:11 DAR 15:11], q=2-31, 850 kb/s, 50 fps, 50 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(rus): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, mono, 104 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=15000 fps=0.0 q=-1.0 Lsize=   35220kB time=00:04:59.96 bitrate= 961.9kbits/s    
video:31137kB audio:3836kB subtitle:0 global headers:0kB muxing overhead 0.706769%

result: file asset.mp4 has only 5mins, same as file1.mp4



On Aug 31, 2012, at 1:03 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Rares Pop <raresp <at> axz.ro> writes:
> 
>> I have tried -i concat: file1|file2, also concatenated the 
>> actual files and tried to run ffmpeg with copy on
>> video and audio codecs. No luck.
> 
> Command line and complete, uncut console output missing.
> 
> Carl Eugen
> 
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 

---------------------
Rares Pop
Chief Executive
M: +40 745 028 869 | E: raresp at axz.ro | Skype: ra_axz
www.azoth.eu | A: Grigore Alexandrescu 54, Bucuresti - Romania


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the ffmpeg-user mailing list