Use amix
duas vezes, antes de amerge
.
Alimente metade das entradas de áudio para um amix
; a outra metade para 2º amix
. Então amerge
os dois resultados.
Encontrei um problema com a codificação de vídeo. Aqui está o comando que eu uso para criar um vídeo.
ffmpeg -framerate 30 -i /Users/Images/image_%03d.png -ss 0.0 -t 3.333 -i /Users/Sounds/Info_01.wav -ss 0.0 -t 3.5 -i /Users/Sounds/Info_02.wav -filter_complex [1] volume=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=stereo [a1]; [a1]adelay=0.0|0.0,apad[b1]; [2] volume=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=stereo [a2]; [a2]adelay=0.0|0.0[b2]; [b1][b2]amerge=2[a] -map 0:v -map [a] -b:v 3200k -c:v libopenh264 -c:a aac -ac 2 /Users/Movies/output.mp4
Funciona bem com 0 ~ 15 arquivos de áudio (a1, a2, a3, a4, a5 ...), tenho erros quando tenho mais de 15 áudios.
Aqui está a saída.
ffmpeg version N-90220-g69995a9 Copyright (c) 2000-2018 the FFmpeg developers built with Apple LLVM version 9.0.0 (clang-900.0.39.2) configuration: --enable-libopenh264 libavutil 56. 8.100 / 56. 8.100 libavcodec 58. 13.102 / 58. 13.102 libavformat 58. 10.100 / 58. 10.100 libavdevice 58. 2.100 / 58. 2.100 libavfilter 7. 12.100 / 7. 12.100 libswscale 5. 0.102 / 5. 0.102 libswresample 3. 0.101 / 3. 0.101 Input #0, image2, from '/Users/Images/image_%03d.png': Duration: 00:00:04.73, start: 0.000000, bitrate: N/A Stream #0:0: Video: png, rgba(pc), 200x343, 30 fps, 30 tbr, 30 tbn, 30 tbc Guessed Channel Layout for Input Stream #1.0 : mono Input #1, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #2.0 : mono Input #2, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #3.0 : mono Input #3, wav, from '/Users/Sounds/Info_03.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #3:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #4.0 : mono Input #4, wav, from '/Users/Sounds/Info_04.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #4:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #5.0 : mono Input #5, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #5:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #6.0 : mono Input #6, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #6:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #7.0 : mono Input #7, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #7:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #8.0 : mono Input #8, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #8:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #9.0 : mono Input #9, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #9:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #10.0 : mono Input #10, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #10:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #11.0 : mono Input #11, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #11:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #12.0 : mono Input #12, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #12:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #13.0 : mono Input #13, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #13:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #14.0 : mono Input #14, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #14:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #15.0 : mono Input #15, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #15:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #16.0 : mono Input #16, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #16:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #17.0 : mono Input #17, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #17:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #18.0 : mono Input #18, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #18:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #19.0 : mono Input #19, wav, from '/Users/Sounds/Info_01.wav': Duration: 00:00:03.37, bitrate: 705 kb/s Stream #19:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Guessed Channel Layout for Input Stream #20.0 : mono Input #20, wav, from '/Users/Sounds/Info_02.wav': Duration: 00:00:03.55, bitrate: 705 kb/s Stream #20:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s Stream mapping: Stream #1:0 (pcm_s16le) -> volume (graph 0) Stream #2:0 (pcm_s16le) -> volume (graph 0) Stream #3:0 (pcm_s16le) -> volume (graph 0) Stream #4:0 (pcm_s16le) -> volume (graph 0) Stream #5:0 (pcm_s16le) -> volume (graph 0) Stream #6:0 (pcm_s16le) -> volume (graph 0) Stream #7:0 (pcm_s16le) -> volume (graph 0) Stream #8:0 (pcm_s16le) -> volume (graph 0) Stream #9:0 (pcm_s16le) -> volume (graph 0) Stream #10:0 (pcm_s16le) -> volume (graph 0) Stream #11:0 (pcm_s16le) -> volume (graph 0) Stream #12:0 (pcm_s16le) -> volume (graph 0) Stream #13:0 (pcm_s16le) -> volume (graph 0) Stream #14:0 (pcm_s16le) -> volume (graph 0) Stream #15:0 (pcm_s16le) -> volume (graph 0) Stream #16:0 (pcm_s16le) -> volume (graph 0) Stream #17:0 (pcm_s16le) -> volume (graph 0) Stream #18:0 (pcm_s16le) -> volume (graph 0) Stream #19:0 (pcm_s16le) -> volume (graph 0) Stream #20:0 (pcm_s16le) -> volume (graph 0) Stream #0:0 -> #0:0 (png (native) -> h264 (libopenh264)) amerge (graph 0) -> Stream #0:1 (aac) Press [q] to stop, [?] for help [image2 @ 0x7fcd8f002200] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) [libopenh264 @ 0x7fcd8f185400] [OpenH264] this = 0x0x7fcd8e612e90, Warning:bEnableFrameSkip = 0,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame. [Parsed_amerge_79 @ 0x7fcd8e424580] No channel layout for input 1 [Parsed_amerge_79 @ 0x7fcd8e424580] Input channel layouts overlap: output layout will be determined by the number of distinct input channels [auto_resampler_20 @ 0x7fcd8e437b00] [SWR @ 0x7fcd8eb50a00] Input channel layout '40 channels (FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+DL+DR+WL+WR+SDL+SDR+LFE2)' is not supported [auto_resampler_20 @ 0x7fcd8e437b00] Failed to configure output pad on auto_resampler_20 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #20:0 Conversion failed!
Existe uma limitação no número de arquivos?
Use amix
duas vezes, antes de amerge
.
Alimente metade das entradas de áudio para um amix
; a outra metade para 2º amix
. Então amerge
os dois resultados.