前言:
做音视频领域相关开发或者二次开发,绕不开的几个工具,ffmpeg,mediainfo巴拉巴拉。
当然都支持跨平台,并且很多很好的媒体软件都能看到他们的影子。
mediaInfo官方地址:https://mediaarea.net/en/MediaInfo/Download/CentOS
库地址: https://mediaarea.net/download/binary/
话不多说,开始安装步骤(这里以centos7为例):
1.查看系统版本
cat /etc/redhat-release
2.下载所需依赖
wget https://mediaarea.net/download/binary/mediainfo/21.03/mediainfo-21.03.x86_64.CentOS_7.rpm
wget https://mediaarea.net/download/binary/libmediainfo0/21.03/libmediainfo-debuginfo-21.03.x86_64.RHEL_7.rpm
wget https://mediaarea.net/download/binary/libzen0/0.4.39/libzen-0.4.39.x86_64.CentOS_7.rpm
3.依次安装
rpm -ivh libzen-0.4.39.x86_64.CentOS_7.rpm
rpm -ivh libmediainfo-21.03.x86_64.CentOS_7.rpm
rpm -ivh mediainfo-21.03.x86_64.CentOS_7.rpm
4.验证
mediainfo -i adiao.flac --OUTPUT=XML > test.xml
<?xml version="1.0" encoding="UTF-8"?>
<MediaInfo xmlns="https://mediaarea.net/mediainfo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://mediaarea.net/mediainfo https://mediaarea.net/mediainfo/mediainfo_2_0.xsd" version="2.0">
<creatingLibrary version="21.03" url="https://mediaarea.net/MediaInfo">MediaInfoLib</creatingLibrary>
<media/>
<media ref="adiao.flac">
<track type="General">
<AudioCount>1</AudioCount>
<FileExtension>flac</FileExtension>
<Format>FLAC</Format>
<FileSize>67966343</FileSize>
<Duration>321.369</Duration>
<OverallBitRate_Mode>VBR</OverallBitRate_Mode>
<OverallBitRate>1691920</OverallBitRate>
<StreamSize>0</StreamSize>
<Recorded_Date>2018-01-1</Recorded_Date>
<File_Modified_Date>UTC 2021-06-16 09:32:06</File_Modified_Date>
<File_Modified_Date_Local>2021-06-16 17:32:06</File_Modified_Date_Local>
<Encoded_Application>Lavf57.41.100</Encoded_Application>
<extra>
<encoded_by>Pro Tools</encoded_by>
<originator_reference>YD!2nAnHFhcaaaGk</originator_reference>
<time_reference>287854400</time_reference>
</extra>
</track>
<track type="Audio">
<Format>FLAC</Format>
<Duration>321.369</Duration>
<BitRate_Mode>VBR</BitRate_Mode>
<BitRate>1691711</BitRate>
<Channels>2</Channels>
<ChannelPositions>Front: L R</ChannelPositions>
<ChannelLayout>L R</ChannelLayout>
<SamplingRate>48000</SamplingRate>
<SamplingCount>15425712</SamplingCount>
<BitDepth>24</BitDepth>
<Compression_Mode>Lossless</Compression_Mode>
<StreamSize>67957944</StreamSize>
<StreamSize_Proportion>0.99988</StreamSize_Proportion>
<Encoded_Library>Lavf57.41.100</Encoded_Library>
</track>
</media>
</MediaInfo>