// alternatives / mp4box-gpac
MP4Box(GPAC)替代方案
如果只是想知道一个 MP4 的内部结构,MP4Box 是最正统的免费答案之一。 但要先说清楚一件事:MP4Box 的强项不只是「看」,它还能改。 这一页说明哪些事只有它做得到,哪些事用鼠标点比敲命令快。
一、MP4Box 是什么
MP4Box 是开源多媒体框架 GPAC 的命令行工具,以操作 ISO 基础媒体文件(MP4、3GP 等) 著称:封装、拆分、混流、加密、元数据编辑,且不重新编码。 GPAC 采用 LGPL v2.1 或更新版本(大部分也可购买商业授权), 官方提供 Windows、Linux、macOS、Android、iOS 的安装包,2026 年仍在活跃发布。
如果你想核对官方文档,跟「看」有关的选项主要是这些:
- MP4Box -info file.mp4——打印文件的整体信息;
- MP4Box -info <TrackID> / -infon N / -infox——单条轨道或全部轨道的详细信息;
- -diso(等价 -dmp4)——把 ISO 媒体 Box 结构导出为 XML;
- -disox——同上,但去掉样本表,输出小很多;
- -dxml——Box 结构加已知轨道的样本信息;
- -dts——逐样本打印解码时间、大小与文件位置;
- -dnal <TrackID>——打印 NAL 样本信息;
- -dump-udta [tkID:]4cc——导出用户数据(如封面、章节);
- -std / -stdb——输出到标准输出,便于接管道。
二、它比本工具强的地方
| 能力 | 说明 |
|---|---|
| XML 结构导出 | -diso 的结果可以 diff、可以入库、可以进 CI,本工具没有导出 |
| 可脚本化 | 纯命令行,能跑在无桌面环境与服务器上 |
| 能改文件 | 混流、拆轨、编辑元数据、加密——本工具只读,绝不修改你的文件 |
| 逐样本时间轴 | -dts 给出每个样本的解码时间、大小与偏移 |
| 覆盖所有 ISOBMFF | 包括 HEIF 图像等非视频场景 |
要导出、要批量、要真正修改文件——用 MP4Box,本工具不参与这些。
三、本工具相对它的差别
- 能用鼠标展开。-diso 给你几千行 XML; 本工具给你一棵能点击、能折叠、点一下就跳到对应 Hex 的树。 要的是「这个 moov 到底在哪、里面塞了什么」时,点比读快。
- 免安装。MP4Box 要装 GPAC 或自己编译;本工具是一个网址,在受限机器上也能用。
- 顺带看得懂编码数据。MP4Box 看容器,不看编码层级; 本工具在同一个界面里给出 QP 热力图与运动矢量——这是 MP4Box 完全不做的方向。
- 只读,不改。本工具不会写回你的文件,也不会产生中间产物。
另外提一句:社区里有 MP4Box.js,是同一套 Box 解析能力的浏览器端实现, 适合在网页里看结构。它只做容器,不涉及块级 QP 或运动矢量, 和本工具不是同一类东西。
四、对照表
| 能力 | MP4Box (GPAC) | MP4 Analyzer |
|---|---|---|
| 形态 | 命令行(另有 GUI 前端) | 网页,零安装 |
| Box 结构 | 有,可导出 XML | 有,交互树 + Hex |
| XML / 数据导出 | 有 | 无 |
| 逐样本时间轴 | 有(-dts) | 有(帧列表视图) |
| 块级 QP / 运动矢量 | 无 | 有 |
| 修改 / 混流 / 拆轨 | 有 | 无(只读) |
| 脚本 / CI | 有 | 无 |
| 价格 | 免费开源(LGPL) | 免费,免注册 |
五、怎么选
| 你的情况 | 选 |
|---|---|
| 要在脚本里 diff 两个文件的 Box 结构 | MP4Box |
| 要拆轨、混流、改元数据 | MP4Box |
| 要逐样本的时间与偏移表 | MP4Box |
| 只想展开看看这棵树长什么样 | 本工具 |
| 不能装软件 / 只想点一下看 Hex | 本工具 |
| 还想看这块为什么糊(QP / MV) | 本工具 |
一句话:要机器可读的产物,或者要改文件,用 MP4Box;要人眼快速看懂一棵树,用本工具。 更完整的横向对比见 同类工具对比。
// alternatives / mp4box-gpac
MP4Box (GPAC) alternative
If all you want is to see inside an MP4, MP4Box is one of the most legitimate free answers. But be clear on one thing first: MP4Box is not only a viewer — it can also change the file. This page separates what only it can do from what is faster to click.
1. What MP4Box is
MP4Box is the command-line tool of the open-source multimedia framework GPAC, known for operating on ISO base media files (MP4, 3GP and friends): packaging, splitting, multiplexing, encryption and metadata editing, all without re-encoding. GPAC is distributed under LGPL v2.1 or later (with most of it also available under a commercial license), ships installers for Windows, Linux, macOS, Android and iOS, and was still actively released in 2026.
The options that matter for inspection, per the official documentation:
- MP4Box -info file.mp4 — prints overall file information;
- MP4Box -info <TrackID> / -infon N / -infox — extended info for one or all tracks;
- -diso (alias -dmp4) — dumps the ISO media box structure as XML;
- -disox — same, but without the sample tables, so the output is far smaller;
- -dxml — boxes plus known track samples;
- -dts — per-sample decoding time, size and file position;
- -dnal <TrackID> — NAL sample info for a track;
- -dump-udta [tkID:]4cc — extract user data such as cover art or chapters;
- -std / -stdb — write to stdout so it pipes.
2. Where it beats this tool
| Capability | Detail |
|---|---|
| XML structure export | -diso output can be diffed, stored and run in CI — this tool exports nothing |
| Scriptable | Pure command line; runs headless and on servers |
| It can modify files | Mux, split tracks, edit metadata, encrypt — this tool is read-only and never writes to your file |
| Per-sample timeline | -dts gives decoding time, size and offset for every sample |
| All of ISOBMFF | Includes non-video uses such as HEIF images |
Export, batch, or genuinely modify a file — use MP4Box. This tool is not in that business.
3. Where this tool differs
- You can click it open. -diso hands you thousands of lines of XML; this tool hands you a tree you can expand, collapse and click through to the matching hex. When the question is "where is moov and what is in it", clicking beats reading.
- No install. MP4Box means installing GPAC or building it; this tool is a URL that works on a restricted machine too.
- It also reads the coded data. MP4Box looks at the container, not the coding layer; this tool shows a QP heatmap and motion vectors in the same interface — a direction MP4Box does not address at all.
- Read-only, no side effects. Nothing is written back and no intermediate file is produced.
Worth knowing: MP4Box.js exists as a browser-side implementation of the same box parsing. It is good for viewing structure in a web page, and it is container-only — no block-level QP or motion vectors. It is a different category of thing from this tool.
4. Side by side
| Capability | MP4Box (GPAC) | MP4 Analyzer |
|---|---|---|
| Form | Command line (GUI front-ends exist) | Web page, zero install |
| Box structure | Yes, exportable as XML | Yes, interactive tree + hex |
| XML / data export | Yes | No |
| Per-sample timeline | Yes (-dts) | Yes (frame list view) |
| Block-level QP / motion vectors | No | Yes |
| Modify / mux / split | Yes | No (read-only) |
| Scripting / CI | Yes | No |
| Price | Free, open source (LGPL) | Free, no account |
5. Which to pick
| Your situation | Pick |
|---|---|
| Diff two files' box structure from a script | MP4Box |
| Split tracks, mux, or edit metadata | MP4Box |
| You need a per-sample timing and offset table | MP4Box |
| You just want to expand the tree and look | This tool |
| You cannot install software, or want to click into the hex | This tool |
| You also want to know why a block looks bad (QP / MV) | This tool |
In one line: for machine-readable output, or for changing the file, use MP4Box; for reading a tree with your eyes, use this tool. For the wider picture, see the full comparison.