[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:27:25 CEST 2012
Thanks for your time.
Here it is:
ffmpeg -i concat:'file1.mp4|file2.mp4' -vcodec copy -acodec copy -y asset.mp4
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
[h264 @ 0x168b4a0] AVC: nal size 20988544
[aac @ 0x1691ce0] channel element 3.1 is not allocated
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'concat:file1.mp4|file2.mp4':
Metadata:
compatible_brands: isomiso2avc1mp41
major_brand : isom
minor_version : 512
encoder : Lavf54.25.104
Duration: 00:03:00.05, start: 0.000000, bitrate: 2566 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
Stream #0:2(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 #0:3(rus): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, s16, 104 kb/s
Metadata:
handler_name : SoundHandler
Output #0, mp4, to 'asset.mp4':
Metadata:
compatible_brands: isomiso2avc1mp41
major_brand : isom
minor_version : 512
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: asset.mp4 file is the same as file1.mp4 . It behaves like it ignores file2.mp4
On Aug 31, 2012, at 1:21 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.
>>
>> ffmpeg -i file1.mp4 -i file2.mp4 -vcodec copy -acodec copy
>
> This does not look as if you are using the concat protocol.
>
> (It is possible that it simply does not work, but testing
> is easier for me if you provide an actual command line.)
>
> 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