Reputation: 277
I am working with PHP. I want to find a way to upload a maximum of 30 second video clips on upload. How to check that the uploaded video duration is only 30 seconds long?
Also, I want to find a way with PHP to convert a video in other formats such as MP4.
Please suggest us.
Upvotes: 0
Views: 2202
Reputation: 3386
You can get the ID3 information of the file and probably do a check later:
$getID3 = new getID3;
$file = $getID3->analyze($filename);
// Access duration and dimensions
$duration = $file['playtime_string'];
$dimensions = $file['filesize'];
If you want to convert it in other formats there is this package PHP-FFMpeg.
Also check these resources:
Similar question: How to get video duration, dimension and size in PHP?
Upvotes: 2