ffprobe的输出格式:json、csv和xml

ffprobe拥有很多信息输出格式选项,你可以在默认格式(如我们在前例中看到的)、json、csv、xml、flat和ini输出格式中选择。

选择输出格式非常简单,在命令行中使用print_format <option> 即可。下面是几个输出如何查找show_format说明符的示例。

ffprobe的json输出

ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format json -select_streams v:0 -show_format simpsons_1080p2398_clip.mp4

{
    "format": {
        "filename": "simpsons_1080p2398_clip.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.007007",
        "duration": "19.993000",
        "size": "12242914",
        "bit_rate": "4898880",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "512",
            "compatible_brands": "isomiso2avc1mp41",
            "title": "The Simpsons Movie - Trailer",
            "artist": "20th Century Fox",
            "date": "2007",
            "encoder": "Lavf58.56.100",
            "genre": "Trailer"
        }
    }
}

ffprobe的csv输出(也被称为“compact”)

ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format csv -select_streams v:0 -show_format simpsons_1080p2398_clip.mp4

format,simpsons_1080p2398_clip.mp4,2,0,"mov,mp4,m4a,3gp,3g2,mj2",QuickTime / MOV,0.007007,19.993000,12242914,4898880,100,isom,512,isomiso2avc1mp41,The Simpsons Movie - Trailer,20th Century Fox,2007,Lavf58.56.100,Trailer

ffprobe 的 XML 输出

ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format xml -select_streams v:0 -show_format simpsons_1080p2398_clip.mp4

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <format filename="simpsons_1080p2398_clip.mp4" nb_streams="2" nb_programs="0" format_name="mov,mp4,m4a,3gp,3g2,mj2" format_long_name="QuickTime / MOV" start_time="0.007007" duration="19.993000" size="12242914" bit_rate="4898880" probe_score="100">
        <tag key="major_brand" value="isom"/>
        <tag key="minor_version" value="512"/>
        <tag key="compatible_brands" value="isomiso2avc1mp41"/>
        <tag key="title" value="The Simpsons Movie - Trailer"/>
        <tag key="artist" value="20th Century Fox"/>
        <tag key="date" value="2007"/>
        <tag key="encoder" value="Lavf58.56.100"/>
        <tag key="genre" value="Trailer"/>
    </format>
</ffprobe>

ffprobe的ini输出

ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format ini -select_streams v:0 -show_format simpsons_1080p2398_clip.mp4
# ffprobe output

[format]
filename=simpsons_1080p2398_clip.mp4
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.007007
duration=19.993000
size=12242914
bit_rate=4898880
probe_score=100

[format.tags]
major_brand=isom
minor_version=512
compatible_brands=isomiso2avc1mp41
title=The Simpsons Movie - Trailer
artist=20th Century Fox
date=2007
encoder=Lavf58.56.100
genre=Trailer

ffprobe的flat输出

ffprobe -v error -hide_banner -of default=noprint_wrappers=0 -print_format flat -select_streams v:0 -show_format simpsons_1080p2398_clip.mp4
format.filename="simpsons_1080p2398_clip.mp4"
format.nb_streams=2
format.nb_programs=0
format.format_name="mov,mp4,m4a,3gp,3g2,mj2"
format.format_long_name="QuickTime / MOV"
format.start_time="0.007007"
format.duration="19.993000"
format.size="12242914"
format.bit_rate="4898880"
format.probe_score=100
format.tags.major_brand="isom"
format.tags.minor_version="512"
format.tags.compatible_brands="isomiso2avc1mp41"
format.tags.title="The Simpsons Movie - Trailer"
format.tags.artist="20th Century Fox"
format.tags.date="2007"
format.tags.encoder="Lavf58.56.100"
format.tags.genre="Trailer"

相关阅读:

ffprobe是什么(7 个ffprobe示例教程)

使用 ffprobe 提取帧数(视频中的帧数)

如何使用ffprobe提取关于流、数据包、帧和容器格式的信息?

版权声明:本文内容转自互联网,本文观点仅代表作者本人。本站仅提供信息存储空间服务,所有权归原作者所有。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至1393616908@qq.com 举报,一经查实,本站将立刻删除。

(0)

相关推荐

发表回复

登录后才能评论