视频上传勾选“仅上传 30 秒视频"; [英] Video upload check "Only 30 second video will upload"
本文介绍了视频上传勾选“仅上传 30 秒视频";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 PHP.我想找到一种在上传时上传最多 30 秒视频剪辑的方法.如何检查上传的视频时长是否只有 30 秒?
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?
另外,我想找到一种使用 PHP 将视频转换为其他格式(例如 MP4)的方法.
Also, I want to find a way with PHP to convert a video in other formats such as MP4.
请给我们建议.
推荐答案
你可以得到文件的ID3信息,以后可能会做一个检查:
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'];
如果你想把它转换成其他格式,有这个包PHP-FFMpeg.
If you want to convert it in other formats there is this package PHP-FFMpeg.
还要检查这些资源:
这篇关于视频上传勾选“仅上传 30 秒视频";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文