Eu estou tentando mesclar vários arquivos de mp3 em cima uns dos outros em um servidor CentOS 7.
Estou tentando com o ffmpeg, mas tenho resultados mistos. Ao misturar 4 arquivos, o último, por exemplo, não se mistura com os outros e não é audível na saída final.
Se eu misturar esse arquivo com outro ou dois (assim, no máximo 3 arquivos mesclados), isso funciona.
Existe um limite ao mesclar? Para referência, cada arquivo tem cerca de 10 MB de tamanho e 5 minutos de duração.
Este é o comando que estou usando
ffmpeg -i /var/www/vhosts/site/httpdocs/uploads/tracks/1.mp3 -i /var/www/vhosts/site/httpdocs/uploads/tracks/2.mp3 -i /var/www/vhosts/site/httpdocs/uploads/tracks/3.mp3 -i /var/www/vhosts/site/httpdocs/uploads/tracks/4.mp3 -filter_complex amerge -ac 2 -c:a libmp3lame -q:a 4 /var/www/vhosts/site/httpdocs/uploads/mix.mp3
A saída após a mesclagem é esta:
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[mp3 @ 0x1c8ba60] Skipping 0 bytes of junk at 1044.
Input #0, mp3, from '/var/www/vhosts/site/httpdocs/uploads/tracks/1.mp3':
Duration: 00:05:44.08, start: 0.025057, bitrate: 320 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Metadata:
encoder : LAME3.98r
Side data:
replaygain: track gain - 6.000000, track peak - unknown, album gain - unknown, album peak - unknown,
[mp3 @ 0x1c8eac0] Skipping 0 bytes of junk at 2446.
[mp3 @ 0x1c8eac0] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from '/var/www/vhosts/site/httpdocs/uploads/tracks/2.mp3':
Metadata:
genre : Other
Duration: 00:05:44.19, start: 0.000000, bitrate: 320 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
[mp3 @ 0x1c9d640] Skipping 0 bytes of junk at 1044.
Input #2, mp3, from '/var/www/vhosts/site/httpdocs/uploads/tracks/3.mp3':
Duration: 00:05:44.08, start: 0.025057, bitrate: 320 kb/s
Stream #2:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Metadata:
encoder : LAME3.98r
Side data:
replaygain: track gain - 3.400000, track peak - unknown, album gain - unknown, album peak - unknown,
[mp3 @ 0x1cc2b80] Skipping 0 bytes of junk at 1044.
Input #3, mp3, from '/var/www/vhosts/site/httpdocs/uploads/tracks/4.mp3':
Duration: 00:05:44.08, start: 0.025057, bitrate: 320 kb/s
Stream #3:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Metadata:
encoder : LAME3.98r
Side data:
replaygain: track gain - 12.100000, track peak - unknown, album gain - unknown, album peak - unknown,
[Parsed_amerge_0 @ 0x1cc34e0] No channel layout for input 1
[Parsed_amerge_0 @ 0x1cc34e0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mp3, to '/var/www/vhosts/site/httpdocs/uploads/mix.mp3':
Metadata:
TSSE : Lavf56.40.101
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p (default)
Metadata:
encoder : Lavc56.60.100 libmp3lame
Stream mapping:
Stream #0:0 (mp3) -> amerge:in0
Stream #1:0 (mp3) -> amerge:in1
amerge -> Stream #0:0 (libmp3lame)
Press [q] to stop, [?] for help
size= 2360kB time=00:05:44.03 bitrate= 56.2kbits/s
video:0kB audio:2360kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.010468%
Existe uma maneira de resolver isso, ou pelo menos saber qual é o problema?
Além disso, algumas pessoas recomendaram sox
, mas não sei como instalá-lo no CentOS.
Quaisquer outras alternativas também ajudarão.
Obrigado