0

I am trying to extract a .wav file from a .mp4 file using the following code:

import subprocess
import ffmpeg

command = "ffmpeg -i afoomtx.mp4 -ab 160k -ac 2 -ar 44100 -vn audio.wav"

subprocess.call(command, shell=True)

The only output I get is 127. What am I doing wrong?

NoLand'sMan
  • 534
  • 1
  • 3
  • 17
  • 1
    `127` means "command not found" https://stackoverflow.com/questions/1763156/127-return-code-from. You may want to try using absolute path such as `/usr/local/bin/ffmpeg` – Yohanes Gultom Dec 19 '19 at 12:05
  • Does this answer your question? [127 Return code from $?](https://stackoverflow.com/questions/1763156/127-return-code-from) – Yohanes Gultom Dec 19 '19 at 12:06
  • import ffmpeg is not required in your script. Ensure ffmpeg installed in your machine and your python script and afoomtx.mp4 file are under the same folder. – Vencat Dec 19 '19 at 13:36
  • Note that wav is uncompressed so it ignores `-ab`. – llogan Dec 19 '19 at 18:50

0 Answers0