3

I have two audio files and I want merge them into one with volume and delay filter. I need insert delay in one audio stream, also change volumes. I have problem with understanding map option...

ffmpeg -i one.mp3 -i two.mp3 -shortest -filter_complex \
"[0:a]volume=0.4[a0]; \
 [1:a]volume=5.0[a1]; \
 [0:a]adelay=10000[0:a]; \
 [0:a][1:a]amerge=inputs=2[out]" \
 #wrong 
 -map [a0] -map [a1] -map ["out"] -ac 2 -c:a libfdk_aac output.m4a

How to do this correctly?

2
  • how does this command run? Your adelay output is the input and isn't mapped for output in any case. amerge merges channels from the input rather than a mixdown.
    – Gyan
    Jan 21, 2016 at 17:22
  • @Mulvya Thanks for responce, I update my question
    – zella
    Jan 22, 2016 at 6:52

1 Answer 1

5

Assuming you intend to delay the entire first input by 10000 milliseconds,

ffmpeg -i one.mp3 -i two.mp3 -shortest -filter_complex \
"[0:a]adelay=10000|10000,volume=0.4[a0]; \
 [1:a]volume=5.0[a1]; \
 [a0][a1]amix=inputs=2[out]" \
 -map "[out]" -ac 2 -c:a libfdk_aac output.m4a

(Remember not to include any whitespace after the slash at end of line.)

4
  • It gives me error The following filters could not choose their formats: Parsed_amerge_3. Consider inserting the (a)format filter near their input or output.
    – zella
    Jan 22, 2016 at 7:28
  • Paste the full console output of the command into your question.
    – Gyan
    Jan 22, 2016 at 7:41
  • Ok, it worked with amix. Is there a difference between amerge and amix?
    – zella
    Jan 22, 2016 at 7:52
  • 4
    amix does mixdown i.e. 2 channel + 2 channel = 2 channel output whereas amerge is 2 channel; + 2 channel = 4 channels
    – Gyan
    Jan 22, 2016 at 8:00

You must log in to answer this question.

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