Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #3508
| From | goldtech <goldtech@worldpost.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Popen to get stdout and stderr for ffmpeg - No such file or directory ? |
| Date | 2011-04-18 16:07 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <8bb1fd96-91bf-42f6-a7ea-ab060cd22f66@a19g2000prj.googlegroups.com> (permalink) |
Hi,
Trying to learn how to run a linux command and get the stdout and
stderr. I'm trying the following:
>>> cmd3 = r'ffmpeg -i /home/giga/Desktop/Guitar1.flv'
>>> p = Popen(cmd3, stdout=PIPE, stderr=PIPE)
Traceback (most recent call last):
File "<pyshell#73>", line 1, in <module>
p = Popen(cmd3, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141, in
_execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
But:
>>> if os.path.exists(r'/home/giga/Desktop/Guitar1.flv'):
print "exist"
exist
>>>
And just running ffmpeg alone seems as expected:
>>> cmd2=r'ffmpeg'
>>> p = Popen(cmd2, stdout=PIPE, stderr=PIPE)
>>> stdout, stderr = p.communicate()
>>> stdout
'Hyper fast Audio and Video encoder\nusage: ffmpeg [options] [[infile
options] -i infile]... {[outfile options] outfile}...\n\n'
>>> stderr
"FFmpeg version git-N-29152-g0ba8485, Copyright (c) 2000-2011 the
FFmpeg developers\n built on Apr 16 2011 16:40:56 with gcc 4.4.5\n
configuration: --enable-gpl ...snip...
Also if I run the exact command (cmd3) in the terminal it works OK.
Why is it not finding the file? Thanks, help appreciated.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Popen to get stdout and stderr for ffmpeg - No such file or directory ? goldtech <goldtech@worldpost.com> - 2011-04-18 16:07 -0700
Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ? "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2011-04-19 00:35 +0100
Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ? Chris Rebert <clp2@rebertia.com> - 2011-04-18 16:36 -0700
Re: Popen to get stdout and stderr for ffmpeg - No such file or directory ? goldtech <goldtech@worldpost.com> - 2011-04-18 20:05 -0700
csiph-web