依次运行两个ffmpeg命令

2024-05-16 10:51:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要运行两个ffmpeg命令,一个接一个,也就是说,等到第一个命令完成,然后运行第二个命令。第一个命令是

ffmpeg -threads 8 -i D:\imagesequence\dpx\brn_055.%04d.dpx D:\imagesequence\dpx\test2.mov

第二个是

^{pr2}$

在Python中实现这一点的最佳方法是什么?在


Tags: 方法命令ffmpegmovtest2threadsdpxpr2
1条回答
网友
1楼 · 发布于 2024-05-16 10:51:41

您只需使用subprocesspython模块调用2次ffmpeg命令,这已经是默认行为

import subprocess

execstr1 = 'ffmpeg -x -y -z ...'
execstr2 = 'ffmpeg -a -b -c ...'

out1 = subprocess.check_output(execstr1, shell=True)

out2 = subprocess.check_output(execstr2, shell=True)

相关问题 更多 >