# GetID3库 **Repository Path**: laoqianjunzi/GetID3 ## Basic Information - **Project Name**: GetID3库 - **Description**: GetID3是一个PHP库,用于解析音频和视频文件的元数据。它能够读取音频格式、视频格式以及容器格式的元数据,如MP3、FLAC、AVI、MPEG等等 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-09-20 - **Last Updated**: 2023-11-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: 元数据, 音频, 视频 ## README GetId3 Useful links ------------ * [Main site](http://www.getid3.org) * [Support](http://support.getid3.org) License ------- For license info please read [Resources/doc/license.txt](https://github.com/phansys/GetId3/tree/master/Resources/doc/license.txt) For commercial license read [Resources/doc/license.commercial.txt](https://github.com/phansys/GetId3/tree/master/Resources/doc/license.commercial.txt) ## Installation via [composer](http://getcomposer.org/) ##### Run composer to install the library: ``` bash $ composer require "laoqianjunzi/getid3: ~2.1" ``` Quick use example reading audio properties ------------------------------------------ ``` php setOptionMD5Data(true) ->setOptionMD5DataSource(true) ->setEncoding('UTF-8') ->analyze($mp3File) ; if (isset($audio['error'])) { throw new \RuntimeException(sprintf('Error at reading audio properties from "%s" with GetId3: %s.', $mp3File, $audio['error'])); } $this->setLength(isset($audio['playtime_seconds']) ? $audio['playtime_seconds'] : ''); // var_dump($audio); } } ```