360 Secure SkillHub
360 安全技能中心

media-info

该 Skill 指导在无 root 权限环境下下载并本地编译 MediaInfo,生成 CLI 二进制,用于查看媒体容器与编码元数据、提取宽高/时长/码率,并按 Rotation 判定横竖屏,适合处理 ffprobe 无法解析但容器信息仍存在的文件;附带安装与验证脚本。

karlzhu-zxc
karlzhu-zxc
热度 80.88
最近更新 2026-05-11 17:34:40
分类:数据依赖:代码执行 / 读写文件应用场景:数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add media-info
Metadata
name
media-info
description
Analyze media files with MediaInfo CLI and compare behavior with ffprobe. Use when inspecting container/codec metadata, extracting width/height/duration/bitrate, troubleshooting files that ffprobe cannot parse, or classifying media by orientation (landscape/portrait).

media-info

Install and run MediaInfo CLI in non-root environments.

Quick start

  1. Install MediaInfo locally:
    • bash scripts/install_mediainfo_local.sh
  2. Verify installation:
    • bash scripts/test_mediainfo.sh
  3. Inspect files:
    • ./vendor/mediainfo/MediaInfo/Project/GNU/CLI/mediainfo <file>
    • ./vendor/mediainfo/MediaInfo/Project/GNU/CLI/mediainfo --Output=JSON <file>

Workflow

Install

Run scripts/install_mediainfo_local.sh.

  • Download MediaInfo source archive
  • Build CLI locally
  • Place binary at vendor/mediainfo/MediaInfo/Project/GNU/CLI/mediainfo

Extract metadata

Use plain output for human reading and JSON output for automation.

Classify orientation

Use Width/Height (and Rotation when present):

  • landscape: effective width >= effective height
  • portrait: effective width < effective height

When Rotation is 90/270, swap width and height before classification.

Notes

  • Do not require sudo.
  • Prefer MediaInfo for files where ffprobe fails but container data still exists.