Eu sobreponho de 2 a 5 arquivos de vídeo em uma grade e quero mesclar todo o áudio de cada vídeo. Aqui está o meu código para combinar 3 arquivos de vídeo. Eu acho que funciona, mas eu recebo um aviso que não gosto.
C:\ffmpeg.exe -i C:\Wildlife2.mp4 -i C:\Wildlife3.mp4 -i C:\Wildlife4.mp4 -qscale:v 5 -filter_complex "[0:v]setpts=PTS-STARTPTS,pad=iw:1.5*ih[a]; [1:v]setpts=PTS-STARTPTS,scale=-1:ih/2[b]; [2:v]setpts=PTS-STARTPTS,scale=-1:ih/2[c]; [a][b]overlay=0:h*2[x]; [x][c]overlay=w:h*2; [0:a][1:a][2:a] amerge=inputs=3" grid(3)_2015-08-14.avi
Aqui está a saída.
ffmpeg version N-71544-g82d9c4e Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 23.100 / 54. 23.100
libavcodec 56. 35.100 / 56. 35.100
libavformat 56. 30.100 / 56. 30.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 14.100 / 5. 14.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Admin\Desktop\Wildlife2.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
creation_time : 2015-04-20 03:01:47
Duration: 00:00:04.04, start: 0.000000, bitrate: 2103 kb/s
Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D)
, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1908 kb/s, 29.97 fps, 29.97 tbr, 29970 t
bn, 29.97 tbc (default)
Metadata:
creation_time : 2015-04-20 03:01:47
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
p, 189 kb/s (default)
Metadata:
creation_time : 2015-04-20 03:01:47
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Admin\Desktop\Wildlife3.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
creation_time : 2015-04-20 03:03:38
Duration: 00:00:04.04, start: 0.000000, bitrate: 1835 kb/s
Stream #1:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D)
, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1642 kb/s, 29.97 fps, 29.97 tbr, 29970 t
bn, 29.97 tbc (default)
Metadata:
creation_time : 2015-04-20 03:03:38
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
p, 187 kb/s (default)
Metadata:
creation_time : 2015-04-20 03:03:38
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Admin\Desktop\Wildlife4.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
creation_time : 2015-04-20 03:05:05
Duration: 00:00:04.00, start: 0.000000, bitrate: 2172 kb/s
Stream #2:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D)
, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1977 kb/s, 29.97 fps, 29.97 tbr, 29970 t
bn, 29.97 tbc (default)
Metadata:
creation_time : 2015-04-20 03:05:05
Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
p, 188 kb/s (default)
Metadata:
creation_time : 2015-04-20 03:05:05
[Parsed_amerge_8 @ 0000000004dac960] No channel layout for input 1
[Parsed_amerge_8 @ 0000000004dac960] Input channel layouts overlap: output layou
t will be determined by the number of distinct input channels
Output #0, avi, to 'grid(3)_2015-08-14.avi':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
ISFT : Lavf56.30.100
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x1080 [SAR 1:1 D
AR 32:27], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
Metadata:
encoder : Lavc56.35.100 mpeg4
Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 48000 Hz, stereo
, s16p (default)
Metadata:
encoder : Lavc56.35.100 libmp3lame
Stream mapping:
Stream #0:0 (mpeg4) -> setpts
Stream #0:1 (aac) -> amerge:in0
Stream #1:0 (mpeg4) -> setpts
Stream #1:1 (aac) -> amerge:in1
Stream #2:0 (mpeg4) -> setpts
Stream #2:1 (aac) -> amerge:in2
overlay -> Stream #0:0 (mpeg4)
amerge -> Stream #0:1 (libmp3lame)
Press [q] to stop, [?] for help
frame= 23 fps=0.0 q=5.0 size= 876kB time=00:00:00.76 bitrate=9351.3kbits/s
frame= 46 fps= 46 q=5.0 size= 1927kB time=00:00:01.53 bitrate=10282.5kbits/
frame= 65 fps= 43 q=5.0 size= 2816kB time=00:00:02.16 bitrate=10635.2kbits/
frame= 89 fps= 44 q=5.0 size= 3736kB time=00:00:02.96 bitrate=10306.3kbits/
frame= 114 fps= 45 q=5.0 size= 4272kB time=00:00:03.80 bitrate=9200.7kbits/s
frame= 121 fps= 45 q=5.0 Lsize= 4494kB time=00:00:04.03 bitrate=9118.7kbits/
s
video:4416kB audio:62kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: 0.368438%
Aqui está o aviso de cima.
[Parsed_amerge_8 @ 0000000004dac960] No channel layout for input 1
[Parsed_amerge_8 @ 0000000004dac960] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Você pode me ajudar a corrigir meu código para mesclar os três fluxos de áudio?