【发布时间】:2019-04-28 03:45:06
【问题描述】:
我正在尝试使用 avconv 将 test.mp4 文件从 python 代码转换为 test.wav。我可以使用 cmd 行将 test.mp4 转换为 test.wmv,但是当我从 python 运行相同的命令时,它给了我以下错误:
第 103 行,在 get_message_audio 中 subprocess.call(命令行) FileNotFoundError: [WinError 2] 系统找不到指定的文件
我在 python 文件中使用的代码是:
cmdline = ['avconv', '-一世', 'test.mp4', '-vn', '-F', '哇', 'test.wav']
subprocess.call(cmdline)
但是当我从 cmd 运行相同的命令时,它会成功运行并保存 test.wav 文件。
cmd line = avconv -i test.mp4 -f wav test.wav
注意:我已将 avconv 添加到系统变量中。 python 文件和 test.mp4 位于同一目录中。我也在同一个目录运行 cmd。
【问题讨论】:
标签: python subprocess avconv