Jaskaran Zap
Jaskaran Zap

Reputation: 277

Video upload check "Only 30 second video will upload"

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

Answers (1)

cch
cch

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:

Upvotes: 2

Related Questions