0

I'm trying to concatenate two audio files and add it to a video file but the output does not contain the audio.

I can see the duration of the output video is the sum of the two audio. But the audio is not present.

ffmpeg -i v1.mp4 -i a1.mp3 -i a2.mp3 -filter_complex "[1][2]concat=a=1:n=2:v=0[s0]" -map 0 -map '[s0]' -shortest 'out.mp4'

Any help on this issue would be great!

3
  • The part where you set the audio codec is missing? Commented May 15, 2023 at 19:18
  • 2
    Change -map 0 to -map 0:v
    – Gyan
    Commented May 16, 2023 at 3:59
  • Thanks @Gyan that helped! Can you please post that as an answer? I'll mark that as resolved. Commented May 16, 2023 at 19:45

1 Answer 1

0

The -map 0 is leading to the audio stream in the first input being included and written before the filtered audio, so many players will just play that one.

Change -map 0 to -map 0:v, so only the original video is mapped.

You must log in to answer this question.

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