Wednesday, 3 May 2023

How to combine multiple audios and videos into a single file?

I have a bunch of audio and video files and their corresponding start time in a stream.

Like this diagram below:

Diagram

How can I combine this all into a single video file efficiently?

I've tried ffmpeg but it was too slow (I don't know if I used ffmpeg correctly or not)

This is my ffmpeg command example:

ffmpeg -i audio_0_3.mp3 -i audio_1_4.mp3 -i audio_2_5.mp3 -i audio_2_6.mp3 -i audio_2_7.mp3 -i audio_3_10.mp3 -i audio_3_8.mp3 -i audio_3_9.mp3 \
-filter_complex [0:a]adelay=0ms[s0];[1:a]adelay=36282ms[s1];[2:a]adelay=462385ms[s2];[3:a]adelay=686909ms[s3];[4:a]adelay=876931ms[s4];[5:a]adelay=1675187ms[s5];[6:a]adelay=1339944ms[s6];[7:a]adelay=1567946ms[s7];[s0][s1][s2][s3][s4][s5][s6][s7]amix=inputs=8[s8] \
-map [s8] out.mp4


from How to combine multiple audios and videos into a single file?

No comments:

Post a Comment