Jump to content

[SOLVED] convert seconds to minutes


rondog

Recommended Posts

I have a series of videos and I am pulling the duration of the FLVs using FFMPEG. The problem is, it outputs it in seconds, so rather than 1:12 it says 72. Can I get help making a function to convert seconds to minutes? This is what I am doing to get the duration:

function getDur($src) {
$mov = new ffmpeg_movie($src,false);
$duration = $mov->getDuration();
$duration = round($duration);
return $duration;
}

while($row = mysql_fetch_array($videoquery)) {
$file = $row['filename'];
$duration = getDur("videos/".$file);
array_push($viddur,$duration);
array_push($vids,$file);
}

 

then my $viddur array contains the video file durations in seconds. thanks!

Link to comment
https://forums.phpfreaks.com/topic/103921-solved-convert-seconds-to-minutes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.