title: ffmpeg not detecting video file duration
body: <p>Am using the following code to detect video duration before uploading using ffmpeg, but it doesn't seem to work:</p>
  
  <pre><code>&lt;?php
    $file=sample.avi;
    $time = exec("$ffmpeg -i /path/".$file." 2&gt;&amp;1 | 
    grep Duration | cut -d ' ' -f 4 | sed s/,//");
    echo $time;
  ?&gt;
  </code></pre>
  
  <p>I need to echo video duration as text input to sql before uploading file to server.</p>