我尝试使用
通过自制软件安装ffmpegbrew install ffmpeg
当我尝试将ffmpeg导入Python时,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named ffmpeg
我可以确认ffmpeg是通过brew列表安装的。我不确定为什么python没有认识到它。
答案 0 :(得分:4)
您安装的是class func TestConnection(_ urlBase: String, usingCommand command: String, completionHandler: @escaping (Bool) -> Void) {
let urlString = urlBase + "/" + command
var IsValidConnection = false
guard let url = URL(string: urlString) else {
completionHandler(IsValidConnection)
return
}
URLSession.shared.dataTask(with: url) { (data, response, error) in
//App blows up when running this block of code.
//Doesn't return. App crashes/locks up
guard error == nil else {
completionHandler(false)
return
}
//App works as expected when running code below
guard let _: HTTPURLResponse = response as? HTTPURLResponse else {
completionHandler(false)
return
}
let serverResponse = response as! HTTPURLResponse
if serverResponse.statusCode == 200 {
IsValidConnection = true
}
completionHandler(IsValidConnection)
}.resume()
}
命令行工具和各种C库。它不包含任何Python绑定。如果您要安装ffmpeg-python,请运行/usr/local/bin/ffmpeg
。