Archives
function mbmGetFLVDuration($file){ /* * Determine video duration with ffmpeg * ffmpeg should be installed on your server. */ //$time = 00:00:00.000 format $time = exec(“ffmpeg -i “.$file.” 2>&1 | grep “Duration” | cut -d ‘ ‘ -f 4 | sed s/,//”); $duration = explode(“:”,$time); $duration_in_seconds = $duration[0]*3600 + $duration[1]*60+ round($duration[2]); return $duration_in_seconds; } Usage: $duration [...]
Oct 12th, 2009 | Filed under PHP
Tags: ffmpeg, video duration