Reputation: 2623
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'
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
Upvotes: 1
Views: 1768
Reputation: 2733
Use the whole path to the ffmpeg executable rather than justffmpeg
Upvotes: 0