python - why is subprocess.popen returning an empty string -
i'm using python's subprocess.popen fetch info of video file.
output = popen('ffmpeg -i "'+avifile+'" -dframes 0 -vframes 0', executable="/bin/bash", stdout=pipe, stderr=stdout, shell=true).communicate()[0] the thing whenever run output variable empty string when know there should something. can manually run ffmpeg fine.
i'm thinking maybe problem pipes , redirecting do. wondering if fix up.
to read combined stdout/stderr string , exception on non-zero return status:
from subprocess import stdout, check_output qx output = qx(['ffmpeg', '-i', avifile] + '-dframes 0 -vframes 0'.split(), stderr=stdout) don't use shell=true unless need it.
Comments
Post a Comment