什么是 auto-editor 链接到标题
auto-editor 是一个命令行视频自动编辑工具,通过检测音频响度或画面运动来自动识别"死区"(dead space)并进行处理。
核心功能:
- 自动检测静音/低音量片段
- 支持多种编辑动作:删除、加速、变速、调音量
- 纯命令行操作,适合批量处理和集成到工作流
为什么口播视频需要粗剪 链接到标题
录制口播视频时,难免会有:
- 停顿、思考
- 重复、重录
- 口头禅、碎语
这些"死区"手动删除枯燥耗时,尤其当视频长达 15-30 分钟时。粗剪工具可以快速定位并处理这些片段,后续再导入专业软件精剪。
环境搭建 链接到标题
auto-editor 提供预编译二进制,但需要较新的 glibc 版本(Ubuntu 24.04+)。下面是一个精简的 Docker 镜像:
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
&& apt-get update && apt-get install -y libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
RUN curl -L https://github.com/WyattBlue/auto-editor/releases/download/30.2.4/auto-editor-linux-x86_64 \
-o /usr/local/bin/auto-editor \
&& chmod +x /usr/local/bin/auto-editor
ENTRYPOINT ["auto-editor"]
注意:预编译版本依赖 GLIBCXX_3.4.32,Ubuntu 24.04 之前的系统需要额外升级 libstdc++ 或自行编译。
其他安装方式:
# 直接下载预编译包
curl -L https://github.com/WyattBlue/auto-editor/releases/download/30.2.4/auto-editor-linux-x86_64 -o auto-editor
chmod +x auto-editor
不要用 pip 安装:auto-editor 已于 2024 年从 Python 迁移到 Rust,PyPI 上的版本停留在旧版且不再更新。pip 安装的版本功能落后且存在兼容性问题。
基本使用 链接到标题
最简命令:
auto-editor my.mov --output my_ALTERED.mov
这实际上是以下参数的简写:
| 参数 | 默认值 | 含义 |
|---|---|---|
--edit |
audio |
基于音频响度检测 |
--when-silent |
cut |
静音片段删除 |
--when-normal |
nil |
有声片段保持原样 |
--margin |
0.2s |
边缘填充 0.2 秒 |
即:自动删除静音片段,保留有声片段,非常适合口播视频的粗剪需求。
粗剪策略详解 链接到标题
检测方法(--edit)
链接到标题
| 方法 | 说明 |
|---|---|
audio(默认) |
基于音频响度,低于阈值视为静音 |
audio:0.05 |
指定音频阈值(0-1,越低越敏感) |
motion |
基于画面运动变化检测 |
subtitle:正则 |
匹配字幕模式,适用有字幕的视频 |
编辑动作(--when-silent / --when-normal)
链接到标题
| 动作 | 说明 |
|---|---|
cut |
删除片段 |
nil |
保持原样 |
speed:N |
加速(保持音调),如 speed:8 |
varispeed:N |
变速(改变音调),如 varispeed:1.25 |
volume:N |
调整音量,1.0=原始,0.5=减半 |
常用参数 链接到标题
| 参数 | 说明 |
|---|---|
--margin LENGTH |
边缘填充,让剪切更自然(默认 0.2s) |
--smooth MINCUT,MINCLIP |
平滑剪切,避免过短片段(默认 0.2s,0.1s) |
--set-action ACTION,start,end |
指定时间范围的编辑动作 |
实用命令示例 链接到标题
# 删除静音片段(等效于默认)
auto-editor video.mp4 --when-silent cut
# 静音片段加速到 8x
auto-editor video.mp4 --when-silent speed:8
# 播客风格:删静音 + 有声部分加速 15%
auto-editor podcast.mp3 --when-silent cut --when-normal speed:1.15
# 静音部分降低音量而非删除
auto-editor video.mp4 --when-silent volume:0.2
# 结合音频和运动检测
auto-editor video.mp4 --edit "or(audio motion)"
# 只处理前 5 分钟
auto-editor video.mp4 --set-action cut,0,5min
其他选择 链接到标题
| 工具 | 特点 |
|---|---|
| ffmpeg silenceremove | 原生无需安装,功能单一,适合简单场景 |
| AutoCutVideo | Windows GUI,国产,适合新手 |
| 手动剪辑 | Final Cut / Premiere / DaVinci Resolve,灵活但耗时 |
auto-editor 在命令行工具中功能最为完善,支持多种检测方法和编辑动作组合,适合集成到自动化工作流中。