ffmpeg-android-java icon indicating copy to clipboard operation
ffmpeg-android-java copied to clipboard

Merge Multiple Audios and Video

Open nacartunahan opened this issue 4 years ago • 4 comments

Does anybody know how to merge 3 or more audio with video writing a command. Also I am working on Android Studio so command must be like this. String command[ ] = {" ", " ", " "};

nacartunahan avatar Jul 14 '19 19:07 nacartunahan

please check the below command to merge 2 audio with 1 video.

String[] cmd = new String[]{"-i", videoPath, "-i", firstAudio, "-i", secondAudio "-filter_complex", "[0:a]volume=20dB[a0];[1:a]volume=10dB[a1];[2:a]volume=10dB[a2];[a0][a1][a2]amix=inputs=3[a]", "-map", "0:v", "-map", "[a]", "-c:v", "copy", "-threads", "50", "-preset", "ultrafast", finalVideoPath};

This command merge 2 audio with 1 video(with sound). You can merge as many audio as you want. just add the input using "-i", file name and add this into the filter_complex tag.

yadavkohi avatar Jul 16 '19 08:07 yadavkohi

This command is not working, do you have any other command?

nacartunahan avatar Oct 09 '19 12:10 nacartunahan

No packets were sent for some of the attached pictures

This error came along with this one below

Error writing trailer of /storage/emulated/0/AudioReplacingTest/MultipleAudioWithVideo1595589437585.mp3: Invalid argument

@yadavkohi ?? Can you elaborate, how can we solve this error.

engelbertink avatar Jul 24 '20 11:07 engelbertink

No packets were sent for some of the attached pictures

This error came along with this one below

Error writing trailer of /storage/emulated/0/AudioReplacingTest/MultipleAudioWithVideo1595589437585.mp3: Invalid argument

@yadavkohi ?? Can you elaborate, how can we solve this error.

aliraza96 avatar Jul 24 '20 11:07 aliraza96