0

The error I'm getting is in the title.

I want to merge the two audio streams from a video into one (yes, I've checked if there is two and there is). This is the command I'm using:

ffmpeg -i input.mp4 -filter_complex "[0:v]scale=-2:720,format=yuv420p[v];[0:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" -c:v libx264 -crf 23 -preset medium -c:a aac -ar 44100 -ac 2 output.mp4

Any ideas why I could be getting the error?

1 Answer 1

0

Inside a filtergraph, each pad is associated with a single stream. And a specifier such as 0:a will match the first stream that qualifies. You need to specify two pads and fully specify the input streams.

[0:a:0][0:a:1]amerge=inputs=2[a]
2
  • Will this throw an error if only one input audio stream is inputted? I'm using it in a kind of automated program, and some videos may only have one audio stream, while others may have 2. Commented Nov 21, 2020 at 6:34
  • No. of inputs should be equal to the inputs value of amerge.
    – Gyan
    Commented Nov 21, 2020 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.