title: Running command with pipe in Golang exec
body: <p>I am trying to get the example from <a href="http://mindthecode.com/recording-a-website-with-phantomjs-and-ffmpeg/" rel="nofollow">here</a> working to record a webpage with phantomjs and pipe the stdout, which are images, to the ffmpeg command to create the video. The command stated that you need to run is:</p>
  
  <pre><code>phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 25 -t 10  -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart dragon.mp4
  </code></pre>
  
  <p>If I run a similar version of that command directly in the terminal, I can get it working just fine. The issue is that I need to run the above command through the Golang <a href="https://golang.org/pkg/os/exec/" rel="nofollow">os/exec</a> package. With the:</p>
  
  <pre><code>cmd := exec.Command(parts[0], parts[1:]...)
  </code></pre>
  
  <p>method, the first parameter is the base executable of the command being executed and it is not honoring the pipe. I would like to get this working in one command so I don't have to write all the images to files and then run a second ffmpeg command to read from all of those images. Any suggestions? </p>