GILO
GILO

Reputation: 2623

Python use ffmpeg not running when using os.system

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

Upvotes: 1

Views: 1768

Answers (1)

clubby789
clubby789

Reputation: 2733

Use the whole path to the ffmpeg executable rather than justffmpeg

Upvotes: 0

Related Questions