php获取视频时长?获取音轨信息?获取媒体文件的详细信息?
php-mediainfo了解一下
准备工作
个人博客地址为:https://dangbowen.com,欢迎加入收藏夹
本机或者服务器必须有medainfo
linux
$ sudo apt-get install mediainfo
mac
$ brew install mediainfo
测试软件是否可用,可以在mplayer提供的各种媒体文件用来测试
$ mediainfo 'http://samples.mplayerhq.hu/FLV/Enigma_Principles_of_Lust-part.flv'
General
Complete name : http://samples.mplayerhq.hu/FLV/Enigma_Principles_of_Lust-part.flv
Format : Flash Video
File size : 500 KiB
Duration : 11 s 711 ms
Overall bit rate : 350 kb/s
Tagged date : UTC 2011-02-27 11:00:33
Tagging application : inlet media FLVTool2 v1.0.6 - http://www.inlet-media.de/flvtool2
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L2.1
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : 7
Duration : 11 s 711 ms
Width : 426 pixels
Height : 240 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 FPS
Original frame rate : 29.970 (29970/1000) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Audio
Format : AAC
Format/Info : Advanced Audio Codec