i would like to use PHP and FFMPEG to get the DURATION of the VIDEO so i can save into the Database.. I found some examples but could not get to work
my path to my FFMPEG is
/usr/local/bin/ffmpeg
here is the example of of snippet but it looks to be local for the ffmpeg??
so much help appreciated if you can fix the php code and fix the proper path i provided above to grab the DURATION in a php file.. thanks for any help to get this properly working as i do not want to have to use ffmpeg-php
if (isset($_GET['percent']))
{
$percent = $_GET['percent'];
ob_start();
passthru("ffmpeg-9260.exe -i \"". $videofile . "\" 2>&1");
$duration = ob_get_contents();
ob_end_clean();
preg_match('/Duration: (.*?),/', $duration, $matches);
$duration = $matches[1];
$duration_array = split(':', $duration);
$duration = $duration_array[0] * 3600 + $duration_array[1] * 60 + $duration_array[2];
$time = $duration * $percent / 100;
$time = intval($time/3600) . ":" . intval(($time-(intval($time/3600)*3600))/60) . ":" . sprintf("%01.3f", ($time-(intval($time/60)*60)));
}

First, you should change the script to:
passthru("ffmpeg -i \"{$videofile}\" 2>&1");Then try ffmpeg from the command line in the directory where the script is, to confirm that it works:
ffmpeg -i /path/path/videofile.flv