ffprobe 获取视频各项属性源信息
目录
ffprobe -v error -show_format -show_streams -show_programs -show_chapters -show_private_data -print_format json your-video.mp4
简化输出一些常用的信息:
ffprobe -v error -select_streams v:0 -show_format -show_entries stream=height,width -of csv=s=x:p=0 -print_format json your-video.mp4
将结果输出到文件,在命令后添加 > meta.json
输出示例:
{
"programs": [
],
"streams": [
{
"width": 1920,
"height": 1080
}
],
"format": {
"filename": "xxx",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "22.173605",
"size": "4011572",
"bit_rate": "1447332",
"probe_score": 100,
"tags": {
"major_brand": "mp42",
"minor_version": "0",
"compatible_brands": "mp42mp41iso4",
"creation_time": "2023-02-18T01:50:29.000000Z"
}
}
}
参考: