子进程调用 ffmpeg(命令行) [英] subprocess call ffmpeg (command line)
本文介绍了子进程调用 ffmpeg(命令行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在我的程序中加入子进程调用.我对其他命令的子进程调用没有问题,但在获取命令行输入时遇到问题
I have been incorporating subprocess calls in my program. I have had no issues with subprocess calls for other commands, but I am having trouble getting the command line input
ffmpeg -r 10 -i frame%03d.png -r ntsc movie.mpg
在 subprocess.call() 中工作
To work inside a subprocess.call()
我尝试了以下方法但没有成功:
I tried the following with no success:
subprocess.call('ffmpeg -r 10 -i %s frame%03.d.png - r ntsc movie.mpg')
有什么想法吗?我是否分离出不同的命令,是否使用 %s
、%d
指定字符串、整数等?
Any thoughts? Do I separate out different commands, do I specify string, integer etc. with %s
, %d
?
推荐答案
我发现这个替代方案也很简单,也很有效.
I found this alternative, simple, answer to also work.
subprocess.call('ffmpeg -r 10 -i frame%03d.png -r ntsc '+str(out_movie), shell=True)
这篇关于子进程调用 ffmpeg(命令行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文