raw-video-processing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill: Raw Video Processing
Skill:原始视频处理
Post-process raw screen recordings to improve pacing — remove silent segments, then speed up the result.
Prerequisite: FFmpeg and Python 3 must be installed.
对原始屏幕录制视频进行后期处理以优化节奏——移除静音片段,然后调整播放速度。
前提条件:必须安装FFmpeg和Python 3。
When to Use
适用场景
The user has recorded a screencast and wants to clean it up before publishing. Typical issues in raw recordings:
- Long pauses / dead air while thinking or waiting for loading
- Overall pacing feels slow and could benefit from a slight speed boost
用户录制了屏幕视频,希望在发布前进行优化。原始录制视频的常见问题:
- 思考或等待加载时的长时间停顿/无声时段
- 整体节奏偏慢,小幅提升播放速度会更合适
Default Workflow
默认工作流程
When the user provides a raw video file, run both scripts in sequence by default:
当用户提供原始视频文件时,默认按顺序运行两个脚本:
Step 1: Remove Silent Segments
步骤1:移除静音片段
bash
python /path/to/skills/raw-video-processing/scripts/remove_silence.py <input.mp4>This detects and cuts out silent portions, producing .
<input>_nosilence.mp4Default parameters (good for most screencasts):
- — silence detection sensitivity
--threshold -30dB - — minimum silence length (seconds) to remove
--duration 0.8 - — seconds of breathing room kept around speech boundaries
--padding 0.2
The script prints a detailed summary: number of silent segments found, total silence removed, and all kept segments with timestamps. Review this output to confirm the result looks reasonable.
bash
python /path/to/skills/raw-video-processing/scripts/remove_silence.py <input.mp4>该脚本会检测并剪切掉静音部分,生成文件。
<input>_nosilence.mp4默认参数(适用于大多数屏幕录制视频):
- — 静音检测灵敏度
--threshold -30dB - — 需移除的最短静音时长(秒)
--duration 0.8 - — 保留语音片段前后的缓冲时长(秒)
--padding 0.2
脚本会输出详细摘要:检测到的静音片段数量、移除的总静音时长,以及所有保留片段的时间戳。可查看该输出确认处理结果是否合理。
Step 2: Speed Up the Video
步骤2:调整视频播放速度
bash
python /path/to/skills/raw-video-processing/scripts/speed_video.py <input>_nosilence.mp4This applies a speed multiplier to the silence-removed video, producing .
<input>_nosilence_1.2x.mp4Default parameters:
- — 1.2x playback speed (a subtle boost that doesn't feel rushed)
--speed 1.2
bash
python /path/to/skills/raw-video-processing/scripts/speed_video.py <input>_nosilence.mp4该脚本会为已移除静音的视频应用速度乘数,生成文件。
<input>_nosilence_1.2x.mp4默认参数:
- — 1.2倍播放速度(小幅提升,不会显得仓促)
--speed 1.2
Script Options
脚本选项
remove_silence.py
remove_silence.py
| Flag | Default | Description |
|---|---|---|
| | Custom output path |
| | Silence threshold in dB (lower = more sensitive) |
| | Minimum silence duration in seconds to remove |
| | Padding kept around non-silent segments |
| off | Only print detected segments, don't export |
| 标识 | 默认值 | 描述 |
|---|---|---|
| | 自定义输出路径 |
| | 静音阈值(单位:dB,数值越低灵敏度越高) |
| | 需移除的最短静音时长(秒) |
| | 保留在非静音片段前后的缓冲时长 |
| 关闭 | 仅输出检测到的片段,不生成文件 |
speed_video.py
speed_video.py
| Flag | Default | Description |
|---|---|---|
| | Custom output path |
| | Playback speed multiplier |
| 标识 | 默认值 | 描述 |
|---|---|---|
| | 自定义输出路径 |
| | 播放速度乘数 |
Custom Scenarios
自定义场景
- Only remove silence — run just Step 1.
- Only speed up — run just Step 2 directly on the input file.
- Aggressive cleanup — use for stricter silence removal, and
--threshold -25dB --duration 0.5for faster playback.--speed 1.5 - Preview before committing — use on remove_silence.py to see what would be cut without creating a file.
--dry-run - Custom output name — use on either script to control the output path.
-o
- 仅移除静音片段 — 仅运行步骤1。
- 仅调整播放速度 — 直接对输入文件运行步骤2。
- 深度优化 — 使用来更严格地移除静音片段,同时设置
--threshold -25dB --duration 0.5实现更快的播放速度。--speed 1.5 - 预览处理效果 — 在remove_silence.py中使用参数,查看将被剪切的内容而无需生成文件。
--dry-run - 自定义输出文件名 — 在任一脚本中使用参数指定输出路径。
-o
Important Notes
重要说明
- Always run remove_silence before speed_video. Silence detection works on the original audio; speeding up first would alter the audio characteristics and make silence detection less accurate.
- For long videos (>30 min), the silence removal step may take a few minutes as it processes each segment individually.
- Both scripts preserve video quality — remove_silence uses stream copy (no re-encoding), while speed_video re-encodes with FFmpeg defaults.
- 务必先运行remove_silence,再运行speed_video。静音检测基于原始音频;若先调整速度,会改变音频特征,降低静音检测的准确性。
- 对于长视频(超过30分钟),移除静音片段的步骤可能需要几分钟,因为脚本会逐个处理每个片段。
- 两个脚本均会保留视频质量——remove_silence采用流复制(无重新编码),而speed_video使用FFmpeg默认设置重新编码。