Pydub无法找到ffprobe [英] Pydub unable to locte ffprobe

查看:1079
本文介绍了Pydub无法找到ffprobe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这是一个与此类似的问题的链接:

First of all, here is the link to a similar question to this: Pydub (WindowsError: [Error 2] The system can not find the file specified) Although in this one the problem is with ffmpeg, which I solved by setting the absolute path.

使用以下任意一种设置转换器和/或ffmpeg的绝对路径后:

After setting the absolute path for converter and/or ffmpeg with either:

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

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

我仍然收到此错误:

C:\ Program Files \ Python36 \ lib \ site-packages \ pydub \ utils.py:193:运行时警告:找不到ffprobe或avprobe-默认为ffprobe,但可能不起作用 警告(找不到ffprobe或avprobe-默认为ffprobe,但可能不起作用",RuntimeWarning) 追溯(最近一次通话): 文件"C:/Users/Sean/Desktop/vp/encode_audio/m4a_to_wav.py",第4行,在 歌曲= AudioSegment.from_file("pines.m4a","m4a") 文件"C:\ Program Files \ Python36 \ lib \ site-packages \ pydub \ audio_segment.py",行660,在from_file中 信息= mediainfo_json(orig_file) mediainfo_json中的文件"C:\ Program Files \ Python36 \ lib \ site-packages \ pydub \ utils.py",行263 res = Popen(命令,stdin = stdin_parameter,stdout = PIPE,stderr = PIPE) init 中的文件"C:\ Program Files \ Python36 \ lib \ subprocess.py",第707行 restore_signals,start_new_session) _execute_child中的文件"C:\ Program Files \ Python36 \ lib \ subprocess.py",第990行 startupinfo) FileNotFoundError:[WinError 2]系统找不到指定的文件.

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://所指定的顺序安装了libav,然后安装了pydub. github.com/jiaaro/pydub#dependencies .

I have ffmpeg in my path envvar. I also have libav in my path envvar, and installed libav and then pydub in the order specified at https://github.com/jiaaro/pydub#dependencies.

我正在做的事情似乎没有任何作用,因此任何想法或解决方案都将不胜感激!

Nothing I'm doing appears to be working, so any ideas or solutions would be greatly appreciated!

推荐答案

我遇到了同样的问题,但五分钟前我解决了.

I had the same problem, but I solved it five minutes ago.

这是解决方案:

  1. 将ffmpeg文件下载到您的计算机中并安装.

  1. Download ffmpeg file into your computer and install it.

传递ffmpeg文件位置的系统路径.

Pass the system path of the ffmpeg file location.

(¥表示\)

我将文件放入C:\\ffmpeg\\ffmpeg\\bin\\ffmpeg.exe

(注意:这是在我更改文件名之后)

from pydub import AudioSegment
AudioSegment.converter = "C:\\ffmpeg\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffmpeg = "C:\\ffmpeg\\ffmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe ="C:\\ffmpeg\\ffmpeg\\bin\\ffprobe.exe"

将这些行放在导入句子之后.

Put these lines after the import sentence.

最后,重新启动计算机

这个问题我受了很多苦,但是问题现在已经解决了.

I have suffered from this problem very much, but the problem is solved now.

这篇关于Pydub无法找到ffprobe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆