RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work 解决办法

我在python里使用了 pydub 库。处理音频文件。一直没有问题。突然有点报错了。。报错信息如下:

C:\Python\lib\site-packages\pydub\utils.py:165: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)

C:\Python\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/sunlei/PycharmProjects/AutoSengItchat/demo.py", line 5, in <module>
    song = AudioSegment.from_mp3("video\\190514-110500.mp3").set_frame_rate(8000).set_sample_width(2).set_channels(1)
  File "C:\Python\lib\site-packages\pydub\audio_segment.py", line 716, in from_mp3
    return cls.from_file(file, 'mp3', parameters=parameters)
  File "C:\Python\lib\site-packages\pydub\audio_segment.py", line 665, in from_file
    info = mediainfo_json(orig_file)
  File "C:\Python\lib\site-packages\pydub\utils.py", line 263, in mediainfo_json
    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
  File "C:\Python\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Python\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

网上解决方案有好多。但是一直没有找到合适的。。

后来通过测试。。发现 原来是配置好的 ffmpeg环境变量没有了。。。配置好的 环境变量为啥平白无故失踪了呢?估计可能是我手滑误删了?测试如下:

解决方法:找到 ffmpeg 位置重新配置环境变量就可以解决

ffmpeg的bin 目录添加到path变量里

 

 

  • 6
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值