Pydub无法定位ffprob

2024-06-01 00:50:13 发布

您现在位置:Python中文网/ 问答频道 /正文

首先,这里有一个类似问题的链接:Pydub (WindowsError: [Error 2] The system can not find the file specified) 虽然在这个例子中,问题是ffmpeg,我通过设置绝对路径解决了这个问题。

为转换器和/或ffmpeg设置绝对路径后,使用以下任一选项:

AudioSegment.converter = r'C:\ffmpeg\bin'

或者

AudioSegment.ffmpeg = r'C:\ffmpeg\bin'

我仍然得到这个错误:

C:\Program Files\Python36\lib\site-packages\pydub\utils.py:193: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning) Traceback (most recent call last): File "C:/Users/Sean/Desktop/vp/encode_audio/m4a_to_wav.py", line 4, in song = AudioSegment.from_file("pines.m4a", "m4a") File "C:\Program Files\Python36\lib\site-packages\pydub\audio_segment.py", line 660, in from_file info = mediainfo_json(orig_file) File "C:\Program Files\Python36\lib\site-packages\pydub\utils.py", line 263, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) File "C:\Program Files\Python36\lib\subprocess.py", line 707, in init restore_signals, start_new_session) File "C:\Program Files\Python36\lib\subprocess.py", line 990, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified`

我的路径envvar中有ffmpeg。我的路径envvar中还有libav,然后按照https://github.com/jiaaro/pydub#dependencies中指定的顺序安装libav和pydub。

我所做的一切似乎都不起作用,所以任何想法或解决方案都将非常感谢!


Tags: inpyliblinenotfilesfindprogram