title: Using FFMPEG with Powershell
body: <p>I am using Windows Server Edition 2012 and am very new to using Powershell. Basically, I am trying to convert a bunch of video files that are in a directory to .flv. The code I am using is this:</p>
  <pre><code>$inProcessPath = &quot;E:\Random Videos\In Process\$env:username\&quot;
  
  $oldVideos = Get-ChildItem -Include @(&quot;*.mp4&quot;, &quot;*.avi&quot;, &quot;*.divx&quot;, &quot;*.mov&quot;, &quot;*.mpg&quot;, &quot;*.wmv&quot;, &quot;*.mkv&quot;) -Path $inProcessPath -Recurse #gets all of the videos
  
  cd &quot;E:\FFMPEG\bin\&quot;
  
  foreach ($oldVideo in $oldVideos) {
      $newVideo = [io.path]::ChangeExtension($oldSong.FullName, '.flv')
      .\ffmpeg.exe -i $oldVideo -y -async 1 -b 2000k -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast $newVideo 
  }
  </code></pre>
  <p>Whenever I run this I don't get any error messages but ffmpeg doesn't run either. I'm sure I'm overlooking something but have no idea what that could be. I've searched the website and compared code to others and still have no idea.</p>