| name | remove-video-silences |
| version | 2.0.0 |
| description | Remove silent sections from videos using Voice Activity Detection (VAD). Processes video in chunks, detects speech with Silero VAD, and stitches together speech segments while preserving natural flow. Use when asked to remove silence, dead air, or trim pauses from videos. |
| tags | ["video","audio","silence","vad","ffmpeg","editing","remsi"] |
| author | Agent Zero |
Remove Video Silences
Remove silent sections from video files using the elegant Remsi approach.
Based on Remsi - uses ffmpeg's silencedetect filter combined with select/aselect filters for clean, efficient processing.
Features
- Simple & elegant: Single ffmpeg command with select filters
- No dependencies: Only requires ffmpeg (no Python ML libraries)
- Preserves quality: Uses select filters, not re-encoding segments
- Configurable: Adjust silence threshold and minimum duration
Usage
python /a0/usr/skills/remove-video-silences/scripts/remove_silences.py INPUT OUTPUT [OPTIONS]
Options
-n, --noise: Silence threshold in dB (default: -50)
-d, --duration: Minimum silence duration in seconds (default: 0.9)
--dry-run: Show ffmpeg command without executing
Examples
python scripts/remove_silences.py video.mp4 video_trimmed.mp4
python scripts/remove_silences.py video.mp4 video_trimmed.mp4 -n -25 -d 0.3
python scripts/remove_silences.py video.mp4 video_trimmed.mp4 --dry-run
How It Works
- Detect silences: Uses ffmpeg's
silencedetect filter to find silent sections
- Build filter: Creates
select='between(t,start,end)+...' expression for speech sections
- Apply filter: Runs ffmpeg with matching video (
select) and audio (aselect) filters
- Fix timestamps: Uses
setpts=N/FRAME_RATE/TB and asetpts=N/SR/TB to correct timing
Output Example
Processing: video.mp4
Parameters: noise=-30.0dB, min_silence=0.5s
Video duration: 54.00s
Silent sections found: 6
Total silence: 6.19s (11.5%)
Processing video...
==================================================
COMPLETE
==================================================
Input: 54.00s
Output: 47.83s
Removed: 6.17s (11.4%)
File: video_trimmed.mp4
Threshold Guidelines
Default settings are conservative to avoid cutting voice. Adjust based on your needs:
| Content Type | Recommended Threshold | Min Duration |
|---|
| Clean studio audio | -50 dB | 0.9s |
| Normalized speech | -45 dB | 0.7s |
| Noisy recording | -40 dB | 0.5s |
| Aggressive cutting | -30 dB | 0.3s |
Credits
Based on the Remsi approach by bambax.