Lan Lan
Lan Lan

Reputation: 39

Android- how do mix audio and audio with ffmpeg

I want mux video and audio out 1 video use run cmd ffmpeg.and length = length audio or video min. Not replacing the sound of the sound of audio videos. I want to mix two sounds together Can u help me, please.

Upvotes: 1

Views: 785

Answers (1)

llogan
llogan

Reputation: 133713

Use the amerge filter:

ffmpeg -i video_and_audio_input -i audio_input \
-filter_complex "[0:a][1:a]amerge=inputs=2[a]" -ac 2 \
-map 0:v -map "[a]" -c:v copy output

All inputs must have the same sample rate and format. If they are not, then use the aformat filter first.

If inputs do not have the same duration then output will stop with the shortest.

Upvotes: 1

Related Questions