Currently Dolphin 7 sets the duration of a video the first time it is played by the Dolphin video player.
I want to replace the default player with the JW player so I need another way to set video durations in the database.
It would be best to set the video duration when the video is being encoded. This information is available from ffmpeg.
This is example code to get the duration using php and ffmpeg.
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)));
}
I just need someone to make this work with Dolphin 7 and update the database entry.