0

I encountered a problem with video encoding. Here it the command I use to create a video.

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  

It works fine with 0~15 audio files(a1,a2,a3,a4,a5...), I got errors when I have more than 15 audios.
Here is the output.

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!

Is there a limitation on file number?

5
  • The number "15" suggests that somewhere 4 bits are used, with one special value (probably 0)... but that's a guess.
    – dirkt
    Commented Jul 3, 2018 at 6:10
  • What is the intended channel layout of the merged output?
    – Gyan
    Commented Jul 3, 2018 at 6:55
  • @Gyan to one audio stream.
    – Ives
    Commented Jul 3, 2018 at 8:04
  • Yes, but what channel layout? Mono, Stereo, 7.1 ..etc?
    – Gyan
    Commented Jul 3, 2018 at 8:17
  • @Gyan 2 channels AAC
    – Ives
    Commented Jul 3, 2018 at 8:20

1 Answer 1

1

Use amix twice, before amerge.

Feed half the audio inputs to one amix; the other half to 2nd amix. Then amerge the two results.

2
  • Do I always need two amix? if I have 30 audios then I separate them to 15,15?
    – Ives
    Commented Jul 3, 2018 at 9:11
  • One amix for each output channel.
    – Gyan
    Commented Jul 3, 2018 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .