1

I have been trying to convert mp3 audio to wav file using subprocess. I have installed ffmpeg and libav using home-brew. However whenever I run my code.

import subprocess

subprocess.call(['ffmpeg', '-i', 'input.mp3',
               'output.wav'])

I get this error

FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'

  1. I have tried to use pydub but always get ffprobe errors
  2. I have tried using os.system alternatively

For reference I am using macOS Mojave, python 3.7

Edit:

Instead of using ['ffmpeg', '-i', 'input.mp3', 'output.wav']

Use ['path/to/ffmpeg', '-i', 'input.mp3', 'output.wav']

Ways to find the path to ffmpeg-----------------------

Unix(Linux, Mac): find ffmpeg

Windows: Where ffmpeg

1 Answer 1

0

Use the whole path to the ffmpeg executable rather than justffmpeg

Sign up to request clarification or add additional context in comments.

3 Comments

Where would the path be located
You should be able to run where ffmpeg in your command line to get the path. For me it's C:\ffmpeg\bin\ffmpeg.exe.
Thanks I have tried what you have said and it no longer displays an error however the conversion still hasn't occurred.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.