title: c# using pipes to get output stream
body: <p>I am trying to pipe youtube-dl output to ffmpeg as input, but cannot seem to get the piping part to work. In normal cmd, I can do something like</p>
  
  <pre><code> C:\YT\youtube-dl.exe -o - https://www.youtube.com/watch?v=L4aLQ0ki9Tk | ffmpeg -i pipe:0 -f asf pipe:1 
  </code></pre>
  
  <p>but in c# this doesn't work. Currently, I have c# create 2 processes: </p>
  
  <p>one for youtube-dl </p>
  
  <pre><code>C:\YT\youtube-dl.exe -o - https://www.youtube.com/watch?v=L4aLQ0ki9Tk
  </code></pre>
  
  <p>and another for ffmpeg</p>
  
  <pre><code>ffmpeg  -i {yt.StandardOutput} -f s16le -ar 48000 -ac 2 pipe:1
  </code></pre>
  
  <p>The problem is with the <code>{yt.StandardOutput}</code> (where yt is the process name of the youtube-dl process and <code>-i</code> specifies the input file/stream). Using pipe:0 doesn't work either and I am not sure how to link the piped output of the first to the input of the second.</p>