ob_start();
passthru(\"ffmpeg -i $file 2>&1\");
$duration = ob_get_contents();
ob_end_clean();
$search=\'/Duration: (.*?),/\';
$duration=preg_match($search, $duration, $matches, PREG_OFFSET_CAPTURE, 2);
$time = $matches[1][0];
$time = explode(\'.\',$time);
$time = $time[0];
$VideoDuration = sprintf(\"%0\".\"$time\",\"\");
echo $VideoDuration;