Add duration metadata into flv movie
By default an flv movie doesn't contain the duration metadata. Using the flvtool2 program it is injected like this into the movie file.
cat mymovie.flv | flvtool2 -U stdin mymovie.flv
By default an flv movie doesn't contain the duration metadata. Using the flvtool2 program it is injected like this into the movie file.
cat mymovie.flv | flvtool2 -U stdin mymovie.flv
A very sophisticated algorithm that will display the length of, for example, a video as 12:01:30.
function duration($seconds_count)
{
$delimiter = ':';
$seconds = $seconds_count % 60;
$minutes = floor($seconds_count/60);
$hours = floor($seconds_count/3600);
$seconds = str_pad($seconds, 2, "0", STR_PAD_LEFT);
$minutes = str_pad($minutes, 2, "0", STR_PAD_LEFT).$delimiter;
if($hours > 0)
{
$hours = str_pad($hours, 2, "0", STR_PAD_LEFT).$delimiter;
}
else
{
$hours = '';
}
return "$hours$minutes$seconds";
}