quietshrink — Agent 技能
您可以访问 cli-anything-quietshrink,这是一个用于在 macOS Apple Silicon 上压缩视频文件的 CLI 工具。它使用 Media Engine(硬件 HEVC 编码器),而非 CPU,因此编码快速且静音。
何时使用
- 用户想要压缩屏幕录制、截屏或任何 .mov/.mp4 文件
- 文件过大,无法分享(聊天、邮件、GitHub)
- 需要较小的文件,但不能容忍可见的质量损失
- Apple Silicon Mac(M1/M2/M3/M4)——效果最佳
不要 将此工具用于非屏幕内容(摄像头拍摄的视频、vlog)——因为没有可丢弃的重复帧,压缩率会小得多。
命令
# 使用默认的透明质量进行压缩
cli-anything-quietshrink compress <input> [output]
# 使用特定预设进行压缩
cli-anything-quietshrink compress -q tiny <input> # 最小化
cli-anything-quietshrink compress -q transparent <input> # 默认,视觉无损
cli-anything-quietshrink compress -q pristine <input> # 接近原始质量
# 在压缩前检查文件
cli-anything-quietshrink probe <input>
# 列出质量预设
cli-anything-quietshrink presets
# 验证环境
cli-anything-quietshrink doctor
所有命令都支持 --json 参数以输出机器可读的结果。
质量预设
| Preset | q | 典型压缩率 | SSIM | 使用场景 |
|---|---|---|---|---|
tiny | 50 | ~90% | ~0.95 | 聊天/邮件——可接受少量伪影 |
balanced | 55 | ~88% | ~0.99 | 文档/分享——高质量 |
transparent(默认) | 60 | ~87% | ~0.99+ | 任何重要内容——视觉无损 |
pristine | 70 | ~84% | ~0.997 | 归档——接近原始质量 |
JSON 输出格式
compress 返回:
{
"input": "/path/to/input.mov",
"output": "/path/to/output.mov",
"input_size": 105952129,
"output_size": 12345678,
"saved_bytes": 93606451,
"saved_percent": 88.3,
"duration_seconds": 193.3,
"elapsed_seconds": 87,
"encoding_speed": "2.2x",
"quality_preset": "transparent",
"q_value": 60,
"gop": 600
}
probe 返回:
{
"path": "...",
"size_bytes": 105952129,
"size_mb": 101.04,
"codec": "h264",
"width": 3024,
"height": 1964,
"framerate": "120/1",
"duration_seconds": 193.31
}
Agent 决策流程
用户想要分享录制内容
├─ 是否在 Apple Silicon Mac 上?→ 使用 quietshrink
│ ├─ 用于聊天/邮件/快速分享 → -q tiny
│ ├─ 用于文档/重要分享 → -q transparent(默认)
│ └─ 用于归档/编辑 → -q pristine
└─ 不在 Mac 上?→ 回退到软件编码,效率较低
在处理之前,请运行 doctor 验证环境。
对于不熟悉的文件,请运行 probe 了解分辨率、编码器和时长。
错误与恢复
ffmpeg not found→brew install ffmpeghevc_videotoolbox not available→brew reinstall ffmpegcompression_failed→ 检查输入文件是否损坏;尝试使用--verbose模式查看 ffmpeg 错误信息
来源
- 主仓库:https://github.com/achiya-automation/quietshrink
- Bash CLI:
quietshrink命令(通过安装脚本) - 为何此方法有效:参见 WHY.md