【发布时间】:2020-10-26 16:23:29
【问题描述】:
我正在开发一个 Youtube 到 mp4 的转换器,我目前有两个 webm 文件(一个包含音频,一个包含视频)和一个 .bat 程序,可以将它们转换为包含音频和视频的 webm 文件。我尝试使用以下代码打开 .bat 文件:
import subprocess
subprocess.Popen(['C:/Users/mariu/Desktop/Youtube/a3.bat'])
但是当我运行代码时,我得到了这个错误:
C:\Users\$$$\source\repos\Youtube Downloader\Youtube Downloader>ffmpeg -i
C:/Users/$$$/Desktop/Youtube/1.webm -i C:/Users/$$$/Desktop/Youtube/2.webm -c copy
C:/Users/$$$/Desktop/Youtube/output.webm
The command "ffmpeg" is either wrong or could not be found. (translated from german)
.bat 程序在我简单地执行时有效,但在使用 Python 时无效。我也尝试过使用 os.system("path") 但这也没有用。帮助将不胜感激。
【问题讨论】:
-
其实python脚本可以,问题是操作系统找不到
"ffmpeg"。 -
这应该会回答您的问题:stackoverflow.com/questions/1818774/…