我正在做一个验证码解译器,我需要使用ffmpeg,虽然没什么用。Windows 10用户。
第一次运行代码时警告:
C:\Users\user\AppData\Roaming\Python\Python310\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)
然后,当我尝试运行脚本时,它需要ff探头,我得到了以下错误:
C:\Users\user\AppData\Roaming\Python\Python310\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 "D:\Scripts\captcha\main.py", line 164, in <module>
main()
File "D:\Scripts\captcha\main.py", line 155, in main
captchaSolver()
File "D:\Scripts\captcha\main.py", line 106, in captchaSolver
sound = pydub.AudioSegment.from_mp3(
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\pydub\audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\pydub\audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\pydub\utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "C:\Program Files\Python310\lib\subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\Python310\lib\subprocess.py", line 1435, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
我试着正常下载它,编辑环境变量,将它们粘贴在与脚本相同的文件夹中,用pip安装,手动测试ffmpeg以查看它是否有效,实际上它将mkv转换为mp4,但是我的脚本无意运行。
发布于 2022-12-02 15:51:16
如果您还没有安装@Rotem回答的ffmpeg/ff探头,您可以使用我的ffmpeg-downloader
包:
pip install ffmpeg-downloader
ffdl install --add-path
--add-path
选项将已安装的FFmpeg文件夹添加到用户的系统路径。重新打开Python窗口,ffmpeg和ff探头将对您的程序可用。
https://stackoverflow.com/questions/74651215
复制相似问题