子进程调用ffmpeg(命令行) [英] subprocess call ffmpeg (command line)

查看:719
本文介绍了子进程调用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()

我试过下面没有成功:

subprocess.call('ffmpeg -r 10 -i %s frame%03.d.png - r ntsc movie.mpg')

有什么想法吗?我分离出不同的命令,我用%s %d p>

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆