在pycharm中使用ffmpeg库报错:FileNotFoundError: [WinError 2] 系统找不到指定的文件 的解决方案
在pycharm中使用ffmpeg库报错:FileNotFoundError: [WinError 2] 系统找不到指定的文件 的解决方案
·
我在Pycharm中运行 ffmpeg库 以下代码时出现错误
import ffmpeg
stream = ffmpeg.input('test.mp4')
stream = ffmpeg.hflip(stream)
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream)
报错内容为
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-9-b00e1570ddae> in <module>()
4 # stream = ffmpeg.hflip(stream)
5 stream = ffmpeg.output(stream, 'output.mp4')
----> 6 ffmpeg.run(stream)
F:\Anaconda3\lib\site-packages\ffmpeg\_run.py in run(stream_spec, cmd, capture_stdout, capture_stderr, input, quiet, overwrite_output)
318 pipe_stderr=capture_stderr,
319 quiet=quiet,
--> 320 overwrite_output=overwrite_output,
321 )
322 out, err = process.communicate(input)
F:\Anaconda3\lib\site-packages\ffmpeg\_run.py in run_async(stream_spec, cmd, pipe_stdin, pipe_stdout, pipe_stderr, quiet, overwrite_output)
283 stderr_stream = subprocess.PIPE if pipe_stderr or quiet else None
284 return subprocess.Popen(
--> 285 args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
286 )
287
F:\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
707 c2pread, c2pwrite,
708 errread, errwrite,
--> 709 restore_signals, start_new_session)
710 except:
711 # Cleanup if the child failed starting.
F:\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
995 env,
996 os.fspath(cwd) if cwd is not None else None,
--> 997 startupinfo)
998 finally:
999 # Child is launched. Close the parent's copy of those pipe
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
以上报错主要可以看最后一句:FileNotFoundError: [WinError 2] 系统找不到指定的文件。
在模块安装正确的情况下,应该是电脑本地没有安装 ffmpeg软件 ,可以搜索 Windows下安装ffmpeg的教程,也可以直接参考以下链接:
How to Install FFmpeg on Windows - Adaptive Samples (gregzaal.com)http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/Windows 10系统下安装FFmpeg教程详解_超级小的大西瓜的博客-CSDN博客_windows安装ffmpeghttps://blog.csdn.net/qq_59636442/article/details/124526107另外ffmpeg函数库的安装可以参考以下文章:
更多推荐
已为社区贡献1条内容
所有评论(0)