You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$fileInfo['video']['dataformat'] === 'quicktime'
for the dataformat of quicktime, the video duration here:
$duration = $fileInfo['playtime_seconds'];
is 10 times the real value in seconds. for example if the video is 3.34 seconds, the result is 33.4.
I wrote this ugly way around, but I wonder why this happens?
private function isIOSVideo($fileInfo): bool
{
// Check for iOS-specific data-type
if ($fileInfo['video']['dataformat'] === 'quicktime') {
return true; // Video is likely recorded on an iOS device
}
return false;
}
private function getVideoDuration($file)
{
// Initialize getID3 engine
$getID3 = new getID3();
$fileInfo = $getID3->analyze($file->getPathname());
if (isset($fileInfo['playtime_seconds'])) {
$duration = $fileInfo['playtime_seconds'];
// Apply correction factor for iOS videos if detected
if ($this->isIOSVideo($fileInfo)) {
$duration = $duration / 10;
}
return $duration; // Duration in seconds
}
return null; // Return null if duration cannot be extracted
}
The text was updated successfully, but these errors were encountered:
$fileInfo['video']['dataformat'] === 'quicktime'
for the dataformat of quicktime, the video duration here:
$duration = $fileInfo['playtime_seconds'];
is 10 times the real value in seconds. for example if the video is 3.34 seconds, the result is 33.4.
I wrote this ugly way around, but I wonder why this happens?
The text was updated successfully, but these errors were encountered: