python 中 使用pydub模块报ffmpeg相关错误

在运行Python程序时,遇到pydub模块找不到ffmpeg或avconv的错误,导致无法处理音频文件。错误信息提及ffmpeg和ffprobe不在系统路径中。解决方法是下载ffmpeg的Windows版本,解压后将bin目录添加到环境变量PATH中,确保程序能够找到所需工具。按照此步骤操作后,pydub模块将能正常工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

D:\Program Files\Python\Python38\lib\site-packages\pydub\utils.py:170: 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)
正在处理 c1.m4a
D:\Program Files\Python\Python38\lib\site-packages\pydub\utils.py:198: 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 "pg01(1).py", line 23, in <module>
    song = AudioSegment.from_file(filename,format="m4a")  # 路径可以使用绝对路径也可以使用相对路径
  File "D:\Program Files\Python\Python38\lib\site-packages\pydub\audio_segment.py", line 728, in from_file
    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limi

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值