State-of-the-Art AI-Powered Silence Remover & Noise Reduction Pipeline
Remove silence, kill background noise, and produce broadcast-ready audio/video — all in one command.
Features • Installation • Usage • VAD Engines • Noise Reduction • Examples
Mortem is a production-grade Python CLI tool that automatically detects and removes silent segments from audio and video files using cutting-edge Voice Activity Detection (VAD) models, then optionally applies deep-learning-based noise reduction to produce crystal-clear output.
Whether you're a YouTuber, podcaster, video editor, or content creator — this tool saves you hours of manual editing by intelligently trimming dead air and cleaning up noisy recordings with a single command.
| Feature | Description |
|---|---|
| 3 VAD Engines | Silero VAD (neural), Whisper Semantic VAD, Energy-based VAD |
| 2 Noise Reduction Modes | DeepFilterNet3 (SOTA deep learning) & Spectral Gating |
| Video + Audio Support | Process MP4, MKV, AVI, MOV, WAV, MP3, AAC, and more |
| CUDA Acceleration | GPU-accelerated inference for blazing-fast processing |
| Scientific Visualization | Auto-generates speech segment plots (timeline chart) |
| Speech Manifest | Exports timestamped transcript of all detected speech segments |
| Zero AV-Drift Splicing | Frame-accurate trim+concat via FFmpeg filter graphs |
| Strategy Pattern Architecture | Clean, extensible OOP design — plug in your own engines |
- Python 3.10+
- FFmpeg installed and accessible (or provide the path via
--ffmpeg) - CUDA (optional, for GPU acceleration with DeepFilterNet3 and Whisper)
git clone https://github.com/fadhiilahahmadzikri/autosilenttrimmer.git
cd autosilenttrimmerpython -m venv .venvActivate the virtual environment:
-
Windows (PowerShell):
.\.venv\Scripts\Activate.ps1
-
Windows (CMD):
.\.venv\Scripts\activate.bat
-
Linux / macOS:
source .venv/bin/activate
pip install numpy soundfile torch torchaudio noisereduce tqdm matplotlib seabornFor DeepFilterNet3 noise reduction (recommended):
pip install deepfilternetFor Whisper-based VAD:
pip install faster-whisper-
Windows (Chocolatey):
choco install ffmpeg
-
Linux (apt):
sudo apt install ffmpeg
-
macOS (Homebrew):
brew install ffmpeg
python mortem.py -i <input_file> -o <output_file> [options]| Argument | Type | Default | Description |
|---|---|---|---|
-i, --input |
str |
(required) | Path to the input audio/video file |
-o, --output |
str |
(required) | Path for the output file |
-m, --method |
str |
deepfilter |
Noise reduction method: none, spectral, deepfilter |
--vad |
str |
silero |
VAD engine: none, energy, whisper, silero |
--min-silence |
float |
0.5 |
Minimum silence duration (seconds) to trigger a cut |
--pad |
float |
0.2 |
Padding (seconds) added around each speech boundary |
-f, --ffmpeg |
str |
C:\ProgramData\chocolatey\bin\ffmpeg.exe |
Path to FFmpeg executable |
Neural network-based acoustic voice activity detection. Fastest and most reliable for general use.
python mortem.py -i input.mp4 -o output.mp4 --vad sileroUses OpenAI's Whisper model to transcribe audio and extract word-level timestamps. Best for content where semantic accuracy matters (e.g., podcasts with music).
python mortem.py -i input.mp4 -o output.mp4 --vad whisperLightweight, zero-dependency VAD using signal energy thresholding. Great for clean recordings with obvious silence gaps.
python mortem.py -i input.wav -o output.wav --vad energyState-of-the-art deep neural network for real-time speech enhancement. Supports CUDA GPU acceleration with chunked processing for O(1) memory usage.
python mortem.py -i input.mp4 -o output.mp4 -m deepfilterClassic signal processing approach using noisereduce library. Lightweight and CPU-friendly.
python mortem.py -i input.wav -o output.wav -m spectralSkip noise reduction entirely — only perform silence trimming.
python mortem.py -i input.mp4 -o output.mp4 -m nonepython mortem.py -i raw_video.mp4 -o clean_video.mp4python mortem.py -i podcast.wav -o podcast_clean.wav --min-silence 0.3 --pad 0.1python mortem.py -i lecture.mp4 -o lecture_trimmed.mp4 -m none --vad sileropython mortem.py -i interview.mkv -o interview_clean.mkv -m deepfilter --vad whisperpython mortem.py -i recording.wav -o recording_clean.wav -m spectral --vad energypython mortem.py -i input.mp4 -o output.mp4 -f /usr/bin/ffmpegAfter processing, the tool generates:
| File | Description |
|---|---|
output.mp4 |
The final cleaned & trimmed media file |
output.mp4.manifest.txt |
Timestamped speech segment transcript |
output.mp4.plot.png |
Scientific visualization of speech vs silence timeline |
The project follows the Strategy Pattern with clean interface abstractions:
INoiseReductionStrategy IVoiceActivityDetector IMediaManager
├── DeepFilterNetStrategy ├── SileroBasedVAD └── FFmpegMediaManager
├── SpectralGatingStrategy ├── WhisperBasedVAD
└── EnergyBasedVAD
AudioProcessor (Orchestrator)
StrategyFactory (Builder)
| Issue | Solution |
|---|---|
WinError 127 (DLL conflict) |
Run pip uninstall torch torchaudio -y then pip install torch torchaudio |
| FFmpeg not found | Install FFmpeg or pass the correct path via --ffmpeg |
| CUDA out of memory | DeepFilterNet3 uses chunked processing — try reducing chunk size or use CPU |
| Whisper VAD is slow | Use silero VAD instead for faster processing |
This project is open source and available under the MIT License.
If this tool saved you time, please star this repository — it helps others discover it!
Built by fadhiilahahmadzikri
