centos7下mediainfo安装与使用

        MediaInfo是一款非常实用的视频参数检测工具,除了可以对视频进行编码分析查询,还可以对音频文件的编码及信息进行检测,该款工具软件是一款免费软件。

一、从官网上下载依赖包:
mediaInfo官方地址:https://mediaarea.net/en/MediaInfo/Download/CentOS
库地址: https://mediaarea.net/download/binary/149fdece537e462bb2d1ef96717e67f0.png

GUI表示图形界面版本。CLI表示命令行版本。

二、安装:

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

三、验证:

mediainfo -i test.mp4 --OUTPUT=XML > test.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="22.03" url="https://mediaarea.net/MediaInfo">MediaInfoLib</creatingLibrary>
    <media/>
    <media ref="test.mp4">
        <track type="General">
            <AudioCount>1</AudioCount>
            <FileExtension>mp4</FileExtension>
            <Format>AVC</Format>
            <FileSize>1392892</FileSize>
            <Duration>10.0</Duration>
            <OverallBitRate>554297</OverallBitRate>
            <FrameRate>25.000</FrameRate>
            <FrameCount>497</FrameCount>
            <StreamSize>83509</StreamSize>
            <File_Modified_Date>UTC 2022-09-16 09:32:06</File_Modified_Date>
            <File_Modified_Date_Local>2022-09-16 17:32:06</File_Modified_Date_Local>
            <Encoded_Application>Lavf57.41.100</Encoded_Application>
            <extra>
            </extra>
        </track>
        <track type="Video">
            <Format>AVC</Format>
            <Duration>10.0</Duration>
           <BitRate>554297</BitRate>
           <CodecID>28</CodecID>
           <Width>1920</Width>
           <Height>1080</Height>
            <FrameRate>25.000</FrameRate>
            <FrameCount>497</FrameCount>
            <ColorSpace>YUV</ColorSpace>
            <ChromaSubsampling>4:2:0</ChromaSubsampling>
        </track>
        <track type="Audio">
            <Format>AAC</Format>
            <Duration>10</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>

mediainfo -i test.jpg --OUTPUT=JSON > test.json

test.json文件内容

{
"media": {
"@ref": "/test.jpg",
"track": [
{
"@type": "General",
"ImageCount": "1",
"FileExtension": "jpg",
"Format": "JPEG",
"FileSize": "84227",
"StreamSize": "0",
"File_Modified_Date": "UTC 2022-09-16 05:36:32",
"File_Modified_Date_Local": "2022-09-16 11:06:32"
},
{
"@type": "Image",
"Format": "JPEG",
"Width": "612",
"Height": "612",
"ColorSpace": "YUV",
"ChromaSubsampling": "4:4:4",
"BitDepth": "8",
"Compression_Mode": "Lossy",
"StreamSize": "84227"
}
]
}
}

猜你喜欢

转载自blog.csdn.net/byxdaz/article/details/127083496
今日推荐