Я пытаюсь использовать FFMPEG на холостом ходу 3.7.4 python на macOS Catalina.
Я запустил brew install ffmpeg
, и он успешно установлен.
Однако, когда я go для IDLE и запуска моего сценария (сценарий для преобразования файла .mp3 в .wav):
from os import path
from pydub import AudioSegment
src = "transcript.mp3"
dst = "test.wav"
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")
Вот что я получаю взамен:
Warning (from warnings module):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pydub/utils.py", line 165
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
Warning (from warnings module):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pydub/utils.py", line 193
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
Traceback (most recent call last):
File "/Users/edenhikri/Desktop/transcript.py", line 9, in <module>
sound = AudioSegment.from_mp3(src)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pydub/audio_segment.py", line 716, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pydub/audio_segment.py", line 665, in from_file
info = mediainfo_json(orig_file)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pydub/utils.py", line 263, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'