【问题标题】:FileNotFoundError: No such file or directory: 'ffprobe' FileNotFoundError: No such file or directory: 'ffmpeg'FileNotFoundError:没有这样的文件或目录:'ffprobe' FileNotFoundError:没有这样的文件或目录:'ffmpeg'
【发布时间】:2021-06-24 19:49:42
【问题描述】:
from os import path
from pydub import AudioSegment
input_file = "audio.mp3"
output_file = "result.wav"

sound = AudioSegment.from_mp3(input_file)
sound.export(output_file, format="wav")

当我运行上面的代码时。它显示以下错误。

FileNotFoundError: No such file or directory: 'ffprobe'

我也尝试过使用子进程模块。

input_file = "audio.mp3"
output_file = "result.wav"

import subprocess
subprocess.call(['ffmpeg', '-i', input_file, output_file])

它给出了以下错误

FileNotFoundError: No such file or directory: 'ffmpeg'

我不确定这段代码有什么问题。我目前正在使用 Windows 10。请解决这个问题。

【问题讨论】:

    标签: python ffmpeg ffprobe


    【解决方案1】:

    【讨论】:

    • 在 Windows 下,您还需要确保 ffmpeg bin 目录在 PATH 中可用。否则会出现同样的错误,因为pydub 期望那些 ffmpeg 工具在那里可用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-09
    • 1970-01-01
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多