
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
🎬 一个基于 FFmpeg 的轻量级视频批量压缩命令行工具,支持 MP4 视频文件的高效压缩。
# 全局安装(推荐)
npm install -g vzip
# 或者本地安装
npm install vzip
⚠️ 重要提示: 建议使用 npm 安装,不推荐使用 pnpm。
npm install -g vzippnpm add -g vzip (可能导致 FFmpeg 路径问题)如果您已经用 pnpm 安装了,请先卸载再用 npm 重新安装:
pnpm remove -g vzip
npm install -g vzip
vzip <directory> [options]
<directory>: 必需 - 包含要压缩的视频文件的目录路径--fps <fps>: 设置帧率(默认 30fps)--quality <level>: 设置视频质量等级(可选值:high, medium, low,默认 medium)--target-size-mb <size>: 设置目标文件大小(MB),工具会自动调整参数直到达到目标--clear-temp: 在使用目标大小压缩时清理中间临时文件(默认关闭)--faststart: 启用 faststart,将 moov 原子移到文件开头以优化网络播放# 基本用法:压缩指定目录下的所有 MP4 文件
vzip ./videos
# 使用高质量压缩
vzip ./videos --quality high
# 设置目标文件大小为 10MB(智能压缩)
vzip ./videos --target-size-mb 10
# 设置自定义帧率
vzip ./videos --fps 24
# 启用 faststart 优化
vzip ./videos --faststart
# 组合使用多个选项
vzip ./videos --quality high --fps 30 --faststart
# 智能压缩到指定大小,并优化播放
vzip ./videos --target-size-mb 5 --faststart
# 智能压缩 + 自动清理中间文件
vzip ./videos --target-size-mb 8 --clear-temp
| 质量等级 | CRF 值 | 描述 | 适用场景 |
|---|---|---|---|
high | 18 | 高质量,文件较大 | 专业用途,质量要求高 |
medium | 23 | 中等质量,平衡大小和质量 | 日常使用,推荐设置 |
low | 28 | 低质量,文件较小 | 快速分享,对质量要求不高 |
当使用 --target-size-mb 参数时,工具会自动调整压缩参数直到达到目标文件大小:
--clear-temp 自动清理中间产生的文件压缩后的文件将保存在原目录中,文件名格式为:原文件名-compressed.mp4
例如:video.mp4 → video-compressed.mp4
$ vzip ./my-videos --faststart
Found 3 video(s) to compress.
Compressing: video1.mp4...
Compressed: ./my-videos/video1-compressed.mp4 - Size: 15.23 MB
Successfully compressed: video1.mp4
Compressing: video2.mp4...
Compressed: ./my-videos/video2-compressed.mp4 - Size: 8.76 MB
Successfully compressed: video2.mp4
Compressing: video3.mp4...
Compressed: ./my-videos/video3-compressed.mp4 - Size: 12.45 MB
Successfully compressed: video3.mp4
$ vzip ./my-videos --target-size-mb 6 --clear-temp
Found 1 video(s) to compress.
Compressing: large-video.mp4...
Compressed: ./my-videos/large-video-compressed.mp4 - Size: 25.34 MB
Target size not reached! Current size: 25.34 MB
Recompressing: large-video-compressed.mp4...
Compressed: ./my-videos/large-video-compressed-compressed.mp4 - Size: 8.67 MB
Target size not reached! Current size: 8.67 MB
Recompressing: large-video-compressed-compressed.mp4...
Compressed: ./my-videos/large-video-compressed-compressed-compressed.mp4 - Size: 5.45 MB
Cleaning up temporary files...
Deleted: large-video-compressed.mp4
Deleted: large-video-compressed-compressed.mp4
Temporary files cleaned up!
Successfully compressed: large-video.mp4
Q: 为什么没有找到视频文件?
A: 请确保目录中包含 .mp4 格式的文件,且文件扩展名为小写。
Q: 压缩后文件变大了? A: 对于已经高度压缩的视频,再次压缩可能会增加文件大小。建议先测试一个文件。
Q: 支持其他视频格式吗? A: 目前仅支持 MP4 格式,后续版本将添加更多格式支持。
Q: 智能压缩需要多长时间? A: 取决于目标大小和原始文件大小,可能需要多次迭代压缩,请耐心等待。
Q: 为什么无法达到目标文件大小? A: 极小的目标大小可能无法实现,工具会尽力压缩但不保证一定能达到。
Q: pnpm 安装后报错 "No such file or directory"?
A: 这是 pnpm 与 FFmpeg 的兼容性问题。请使用 npm 安装:pnpm remove -g vzip && npm install -g vzip
ISC
欢迎提交 Issue 和 Pull Request!
如果这个工具对你有帮助,请给个 ⭐ Star!
FAQs
A lightweight batch video compression tool based on FFmpeg for MP4 files
We found that vzip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.