关于 cli-anything-quietshrink
用于在 macOS 上压缩视频的 CLI 技能,尤其适合屏幕录制。它使用 Apple Silicon 的硬件 HEVC 编码,并提供质量预设和机器可读结果。
主要功能
- 01按质量预设压缩视频
- 02Apple Silicon 硬件 HEVC 编码
- 03用于自动化的 JSON 输出
- 04文件探测与环境检查
适用场景
- 01压缩屏幕录制以便分享
- 02为文档选择压缩质量
- 03准备接近原始质量的归档文件
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ hkuds/ cli-anything --skill cli-anything-quietshrink安装后在 Claude Code 中输入/cli-anything-quietshrink确认已加载。
详细介绍
quietshrink — Agent 技能
你可以使用 cli-anything-quietshrink,这是一个用于在 macOS Apple Silicon 上压缩视频文件的命令行工具。它使用 Media Engine(硬件 HEVC 编码器),而非 CPU,因此编码速度快且静音。
何时使用
- 用户想要压缩屏幕录制、录屏或任何 .mov/.mp4 文件
- 文件太大,无法分享(聊天、电子邮件、GitHub)
- 需要更小的文件,但无法容忍可见的画质损失
- Apple Silicon Mac(M1/M2/M3/M4)— 效果最佳
不要对非屏幕内容(相机素材、vlog)使用此工具 — 节省空间会小得多,因为没有可丢弃的重复帧。
命令
# Compress with default transparent quality
cli-anything-quietshrink compress <input> [output]
# Compress with specific preset
cli-anything-quietshrink compress -q tiny <input> # smallest
cli-anything-quietshrink compress -q transparent <input> # default, visually lossless
cli-anything-quietshrink compress -q pristine <input> # near-source quality
# Inspect a file before compressing
cli-anything-quietshrink probe <input>
# List quality presets
cli-anything-quietshrink presets
# Verify environment
cli-anything-quietshrink doctor
所有命令都接受 --json,用于输出机器可读的结果。
质量预设
| 预设 | 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 的决策流程
User wants to share a recording
├─ Is it on Apple Silicon Mac? → use quietshrink
│ ├─ For chat/email/quick share → -q tiny
│ ├─ For docs/important sharing → -q transparent (default)
│ └─ For archival/editing → -q pristine
└─ Not on Mac? → falls back to software, less efficient
处理前,运行 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
评论
支持 Markdown