How to read information from .3gp and .mp4 using ffmpeg-php?

故事扮演 提交于 2019-12-06 09:52:45

You could also use a pure php approach using PHP media reader

While installing ffmpeg plugin on server, Mostly we will be having "ffprobe" library with it. By using ffprobe, we can get details/metadata about videos.

$ffprobe_path="ffprobe"; //path to installation of ffprobe
$video_file="/home/testsite/public_html/videos/mytest_video.mp4"; //path to the specific video file

$ffprobe_cmd=$ffprobe_path." -v quiet -print_format json -show_format -show_streams ".$video_file;  
$outputprobe = shell_exec($ffprobe_cmd);  
$result_video_meta = json_decode($outputprobe);
echo "<pre>";
print_r($result_video_meta);
echo "</pre>";
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!