How to convert ffmpeg adelay filter to ffmpeg-python
I am trying to learn to convert ffmpeg command line adelay filter to ffmpeg-python format.
This is the ffmpeg command line argument
ffmpeg -i first.mka -i second.mka -i third.mka -i fourth.mka
-filter_complex
"[1]adelay=184000|184000[b];
[2]adelay=360000|360000[c];
[3]adelay=962000|962000[d];
[0][b][c][d]amix=4"
merged.mka
How to define this filter in ffmpeg-python?
This is what I have tried. I am very new to ffmpeg.
lk = [60,120] # delay time in seconds
audios = []
for k, i in enumerate(audio_file):
audio = ffmpeg.input(i['src'], select_streams="a")
if audio['streams'] and i['muted'] == False:
a = (audio.filter('adelay', f"{i[lk] * 1000}|
{i[lk] * 1000}"))
audios.append(a)
mix_audios = ffmpeg.filter_(audios, 'amix') if len(audios) > 1
else audios[0]
Read more here: Source link