環境
Mac OS monterey 12.3.1
Python 3.10.2
VS Code
質問
Pydubを使って曲の音量を上げる作業をしていたのですが、No Such file Or Directory: 'ffprobe'とのErrorが出たため、(とりあえず)brew install ffmpeg , pip install ffmpeg-python, pip install ffprobe-pythonをターミナルで実行したのですが、依然としてエラーは改善しませんでした。
誰か改善策を教えていただけないでしょうか?
足りない情報などがあればすぐに対応します。
コード
python3
1from pydub import AudioSegment 2 #音声ファイルを読み込む 3 4sourceAudio = AudioSegment.from_mp3("/Users/J/Downloads/test.mp3") 5 6processedAudio = sourceAudio + 3 7#音量を上げる 8 9processedAudio = processedAudio[:10*1000] 10#はじめの10秒を取り出す 11 12processedAudio.export("out.mp3", format="mp3") 13#結果を出力 14
エラー文
terminal
1Traceback (most recent call last): 2 File "/Users/programming/complete/test2.py", line 4, in <module> 3 sourceAudio = AudioSegment.from_mp3("/Users/J/Downloads/test.mp3") 4 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydub/audio_segment.py", line 796, in from_mp3 5 return cls.from_file(file, 'mp3', parameters=parameters) 6 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydub/audio_segment.py", line 728, in from_file 7 info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) 8 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydub/utils.py", line 274, in mediainfo_json 9 res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) 10 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in __init_ 11 self._execute_child(args, executable, preexec_fn, close_fds, 12 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child 13 raise child_exception_type(errno_num, err_msg, err_filename) 14OSError: [Errno 8] Exec format error: 'ffprobe'
参考(Terminalの実行結果)
pip show ffmpeg-python → Name: ffmpeg-python Version: 0.2.0 Summary: Python bindings for FFmpeg - with complex filtering support Home-page: https://github.com/kkroening/ffmpeg-python Author: Karl Kroening Author-email: karlk@kralnet.us License: UNKNOWN Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages Requires: future Required-by: pip show ffprobe-python → Name: ffprobe-python Version: 1.0.3 Summary: A wrapper around ffprobe command to extract metadata from media files. Home-page: https://github.com/gbstack/ffprobe-python Author: Simon Hargreaves Author-email: simon@simon-hargreaves.com License: UNKNOWN Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages Requires: Required-by: pip show pydub → Version: 0.25.1 Summary: Manipulate audio with an simple and easy high level interface Home-page: http://pydub.com Author: James Robert Author-email: jiaaro@gmail.com License: MIT Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages Requires: Required-by:
あなたの回答
tips
プレビュー