我使用python的subprocess.popen来获取视频文件的信息。为什么subprocess.popen返回空字符串
output = Popen('ffmpeg -i "'+avifile+'" -dframes 0 -vframes 0',
executable="/bin/bash", stdout=PIPE, stderr=STDOUT,
shell=True).communicate()[0]
事情是每当我运行它的输出变量是一个空字符串,当我知道应该有东西。我可以手动运行ffmpeg。
我在想也许它是一个管道问题,我重新定向。想知道是否有人能解决这个问题。
'output = Popen(...)。communicate()'给你什么?也许你得到一个错误 –
有没有错误,只是没有。 – incognito2
传递参数序列而不是字符串,您将避免引用问题 –