1

I want to input the audio files present in a local file and merge them with defnite overlap time in a dynamic way and that means overlap time i will be providing will change from one instance to another.I want to use ffmpeg command using python script I have been using this ffmpeg command to merge two audios

ffmpeg -i sound.mp3 -i sound2.mp3 -filter_complex "[1]adelay=10000|10000[b]; [0][b]amix=2" audiomerged.mp3

|<---- 1st mp3 file --------------------> | | <-----------2nd mp3 file ------------->|

result: |<-----------------------(overlap 10 sec )--------------------->|

Can anyone help me with this

P J
  • 11
  • 2
  • 1
    I don't see how this is connected to python? ffmpeg is a program on it's own not dependant on python whatsoever – Mahrkeenerh Dec 09 '21 at 11:52
  • i saw somewhere ffmpeg command can be written in python script – P J Dec 10 '21 at 04:56
  • https://stackoverflow.com/questions/52197883/how-to-use-ffmpeg-in-a-python-function i have referred this – P J Dec 10 '21 at 04:57
  • that's just calling commandline with the command, so you could do the same without python. – Mahrkeenerh Dec 10 '21 at 10:10
  • Thanks for replying basically, i want convert a ffmpeg command to a python script. – P J Dec 13 '21 at 09:32
  • I want to do it in python because i want to use it in a dynamic way – P J Dec 13 '21 at 09:34
  • that doesn't make sense. FFMPEG is not integrated in python, so any interaction you make with it will be through a console – Mahrkeenerh Dec 13 '21 at 09:49
  • yeah i am using Python subprocess module – P J Dec 13 '21 at 11:27
  • that means the question still doesn't have anything to do with python, and it's just pure ffmpeg. – Mahrkeenerh Dec 13 '21 at 11:29
  • So, I have ffmpeg command for merging of multiple audios working in command line interface and i have to integrate this command to a python code. Since i can't use ffmpeg command directly in python code so, I want to convert this ffmpeg command to python script. this conversion part is the one which i am facing difficulty. I have tried using subprocess module unsucessfully. – P J Dec 13 '21 at 12:03
  • https://stackoverflow.com/questions/5486725/how-to-execute-a-command-prompt-command-from-python – Mahrkeenerh Dec 13 '21 at 12:06
  • Please clear you question with separated paragraphs and use markdown fences to make clear where your command lines are, and separated from the question context. – CarlosH. Dec 20 '21 at 03:40

0 Answers0