我试图使用thispython视频转换器,但我甚至无法运行测试。我在手册中读到,我必须单独安装FFMPEG,所以我这样做了(我在C:\,环境变量“path”中创建了文件夹,并对其进行了测试和工作),但仍然不起作用。
当我运行命令时:python setup.py test
我明白了:Traceback (most recent call last):
File "setup.py", line 51, in
packages=['converter'],
File "C:\Python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 20, in run
raise Exception('tests failed')
Exception: tests failed
当我运行此示例代码时:from converter import Converter
c = Converter()
info = c.probe('test1.ogg')
conv = c.convert('test1.ogg', '/tmp/output.mkv', {
'format': 'mkv',
'audio': {
'codec': 'mp3',
'samplerate': 11025,
'channels': 2
},
'video': {
'codec': 'h264',
'width': 720,
'height': 400,
'fps': 15
}})
for timecode in conv:
print "Converting (%f) ...\r" % timecode
我明白了:Traceback (most recent call last):
File "C:\Users\USER\worspace_pyth\cosa\prueba1.py", line 3, in
c=Converter()
File "C:\Python27\converter\__init__.py", line 27, in __init__
ffprobe_path=ffprobe_path)
File "C:\Python27\converter\ffmpeg.py", line 345, in __init__
raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path)
converter.ffmpeg.FFMpegError: ffmpeg binary not found: ffmpeg
我不明白我还需要做什么才能成功。谢谢你的帮助。