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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -