我试图只为ffmpeg输出打印一行,但它不起作用。这是我的代码:
cmd = 'ffmpeg -i ' + url + ' -t 00:05:00 /home/userxyz/Desktop/myfolder/test.mp4'
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,universal_newlines=True,shell=True)
for line in process.stdout:
pline = "Recording : " + line
print(pline, end="\r")
我在mint os上运行此代码。