0

I am trying to merge a video and an audio using ffmpeg. What I want is to keep mix audio from both files i.e. from video as well as from audio file. I am currently trying with the below command.

-i, /storage/emulated/0/2.mp4, -i, /storage/emulated/0/1.mp3, -c, copy,
-map, 0:v:0, -map, 1:a:0, -shortest, /storage/emulated/0/1543574231129.mp4

The problem with the above command is that it removes the audio of the video file and only keep the audio of the audio file supplied. I tried with a different command too but in that case audio from the audio file was not present in the video.

How can I mix the audio tracks in the output file ?

EDIT:

I tried with the command suggested in the comments like this below.

[-i, /storage/emulated/0/2.mp4, -i, /storage/emulated/0/1.mp3, -filter_complex, [0:a:0][1:a:0]amix[outa], -map, [0:v:0], -map, ["outa"], /storage/emulated/0/1543907405323.mp4]

But now this gives the below error

Output with label '0:v:0' does not exist in any defined filter graph, or was already used elsewhere.

0 Answers0