$getID3 = new getID3;
$video_file = $getID3->analyze('path-to-your-video');
// Get the duration in string, e.g.: 4:37 (minutes:seconds)
$duration_string = $video_file['playtime_string'];
// Get the duration in seconds, e.g.: 277 (seconds)
$duration_seconds = $video_file['playtime_seconds'];
Thank you. I think this is helpful. But I'm getting an error when analyzing the video (could not open file, !file_exists, !file_readable). I don't remember the full error, but I believe it's related to the storage permissions, since my videos are private and not public.
So, could you please tell us what did you do so it worked on your project?