1

We have this multimedia files:

  • a video video.mp4
    • video track 0
    • audio track 0 is audio we don't want
    • audio track 1 is audio we want
  • an audio audio.mp3 track

How to use ffmpeg with this video and

  • just put there audio.mp3
  • and mix it with audio track 1 of this video, because we don't want audio track 0 of this video

And in final to have output.mp4 where:

  • Video is video.mp4
  • audio track 1 from video.mp4 + audio.mp3. Audio as one track, merged, mixed.
0

Use

ffmpeg -i video -i audio -filter_complex "[0:a:1][1:a]amix[a]" -map 0:v -c:v copy -map "[a]" -c:a aac output.mp4

The amix filter will mix the 2nd audio track of the video with the audio of the 2nd input. Duration of audio will be same as duration of the longer audio track in the mix.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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