title: Python/FFMPEG command line issues
body: <p>I have a problem with running an FFMPEG command from within a Python script. When I run the following command from the terminal, I can stream video and audio from my attached webcam (Logitech C310) and output to file "out.avi" without any errors.</p>
  
  <pre><code>ffmpeg -f alsa -i default -itsoffset 00:00:00 -f video4linux2 -s 1280x720 -r 25 -i /dev/video0 out.avi
  </code></pre>
  
  <p>When I run the same command in a Python script below,</p>
  
  <pre><code>def call_command(command):
      subprocess.Popen(command.split(' '))
  
  call_command("ffmpeg -f alsa -i default -itsoffset 00:00:00 -f video4linux2 -s 1280x720 -r 25 -i /dev/video0 out.avi")
  </code></pre>
  
  <p>it gives me the error:</p>
  
  <pre><code>Input #0, alsa, from 'default':
    Duration: N/A, start: 1317762562.695397, bitrate: N/A
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
  [video4linux2 @ 0x165eb10]Cannot find a proper format for codec_id 0, pix_fmt -1.
  /dev/video0: Input/output error
  </code></pre>
  
  <p>Could anyone shed some light on what could be going on here? I've tried using os.system() as well as subprocess.call() and it gives me the same errors. I'm not sure where to start on what could be going wrong here. I tried searching for the "video4linux2 Cannot find a proper format for codec_id 0, pix_fmt -1" error, but couldn't find anything consistent.</p>
  
  <p>I've also tried putting the "ffmpeg -f..." command in a shell script "test.sh", and giving it executable permissions. I then open terminal, and run "./test.sh", and it works. When I try calling the command "./test.sh" from within my Python script, I'm left with the original error as before. This is the Python command I tried with the test.sh script: </p>
  
  <pre><code>subprocess.call(["./test.sh"])
  </code></pre>