Automated Profanity & Content Censorship Tool β Powered by Whisper ASR
An AI-powered command-line tool that automatically detects and censors profanity, abusive, violent, and confidential content from audio and video files. Built using OpenAI's Whisper for speech-to-text transcription with word-level timestamps for precise, frame-accurate censorship.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INPUT (Video/Audio) β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 1: Audio Extraction β
β βββββββββββββββ β
β β pydub/FFmpeg β β Extract audio β Convert to WAV (16kHz)β
β βββββββββββββββ β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 2: Speech Transcription β
β βββββββββββββββ β
β β Whisper β β Word-level timestamps β
β β (ASR Model) β β [{word, start, end}, ...] β
β βββββββββββββββ β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 3: Content Classification β
β ββββββββββββββββββββ βββββββββββββββββββββ β
β β Keyword Matching β β Contextual Analysisβ β
β β (Profanity List) β β (Regex Patterns) β β
β ββββββββββ¬ββββββββββ ββββββββββ¬βββββββββββ β
β ββββββββββββ¬βββββββββββ β
β βΌ β
β Flagged Segments [{word, start, end, category}] β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 4: Censorship Engine β
β ββββββββββββ ββββββββββββ β
β β BLEEP β β MUTE β β
β β(1kHz tone)β β(Silence) β β
β ββββββββββββ ββββββββββββ β
β β β
β Merge censored audio with video (FFmpeg) β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OUTPUT (Censored Video/Audio + Report) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- π€ Whisper-Powered ASR β Accurate transcription with word-level timestamps
- π Two-Tier Detection β Keyword matching + contextual pattern analysis
- π Bleep or Mute β Choose between tone overlay or silent censoring
- π Detection Report β JSON report with all flagged content & timestamps
- π¬ Video Support β Process video files (extracts audio, censors, reassembles)
- ποΈ Sensitivity Levels β Low / Medium / High detection sensitivity
- π Custom Word Lists β Add your own profanity/banned words
- π₯οΈ Rich CLI β Beautiful terminal output with progress bars and tables
- π Modular Design β Each component is independent and extensible
- Python 3.8+
- FFmpeg (required for video files and non-WAV audio formats)
- Windows:
choco install ffmpegor download from ffmpeg.org - macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg
- Windows:
# Clone the repository
git clone https://github.com/yourusername/ai-audio-video-censor.git
cd ai-audio-video-censor
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Basic usage β bleep profanity in an audio file
python -m src.main -i input.wav
# Mute mode with high sensitivity
python -m src.main -i podcast.mp3 --mode mute --sensitivity high
# Process a video file with report generation
python -m src.main -i video.mp4 -o clean_video.mp4 --report
# Use a larger Whisper model for better accuracy
python -m src.main -i audio.wav --model small --mode bleep
# Use a custom word list
python -m src.main -i input.wav --wordlist my_words.txt| Option | Default | Description |
|---|---|---|
-i, --input |
required | Input audio/video file path |
-o, --output |
auto | Output file path |
--mode |
bleep |
Censorship mode: bleep or mute |
--model |
base |
Whisper model: tiny, base, small, medium, large |
--sensitivity |
medium |
Detection level: low, medium, high |
--wordlist |
built-in | Path to custom word list file |
--report |
off | Generate JSON detection report |
--bleep-freq |
1000 |
Bleep tone frequency (Hz) |
| Level | Keyword Match | Partial Match | Contextual Analysis |
|---|---|---|---|
| Low | β | β | β |
| Medium | β | β | β |
| High | β | β | β |
ai-audio-video-censor/
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup
βββ LICENSE # MIT License
βββ .gitignore # Git ignored files
βββ config/
β βββ config.py # Centralized settings
β βββ profanity_words.txt # Default word list (categorized)
βββ src/
β βββ __init__.py # Package init
β βββ main.py # CLI entry point
β βββ audio_extractor.py # Audio extraction from video/audio
β βββ transcriber.py # Whisper transcription engine
β βββ content_classifier.py # Content detection & classification
β βββ censor_engine.py # Bleep/mute audio processing
β βββ pipeline.py # Pipeline orchestrator
β βββ utils.py # Logging & helper utilities
βββ output/ # Default output directory
βββ samples/ # Sample files directory
.wav, .mp3, .flac, .aac, .ogg, .wma, .m4a
.mp4, .mkv, .avi, .mov, .webm, .flv, .wmv
π AI Audio/Video Censor
Automated Profanity & Content Censorship Tool
Powered by Whisper ASR | Built for OpenVINO GSoC
Mode: bleep
Model: base
Sensitivity: medium
Word List: profanity_words.txt
ββββββββββββββββ Pipeline Starting ββββββββββββββββ
Input: D:\samples\interview.wav
Output: D:\pipeline\output\interview_censored.wav
β Whisper model 'base' loaded successfully
β Transcription complete: 342 words detected, language: en
β Content classification complete: 7 flagged segments found
ββββββββββββββββ Pipeline Complete ββββββββββββββββ
π Censorship Report
ββββββββββββββββββββ¬ββββββββββ
β Metric β Value β
ββββββββββββββββββββΌββββββββββ€
β Total Words β 342 β
β Flagged Segments β 7 β
β Censor Mode β BLEEP β
β Processing Time β 12.4s β
β Language β en β
ββββββββββββββββββββ΄ββββββββββ
β
Output saved: output/interview_censored.wav
This project serves as a proof-of-concept for the OpenVINO GSoC Project #39. Future enhancements planned:
- OpenVINO Model Optimization β Convert Whisper to OpenVINO IR format for accelerated inference on Intel hardware
- VLM Visual Understanding β Use Vision Language Models (via OpenVINO GenAI) to detect violent visual content in video frames
- DL Streamer Integration β Build a GStreamer-based real-time processing pipeline using Intel DL Streamer
- LLM-Based Classification β Replace keyword matching with an OpenVINO-optimized LLM for context-aware content understanding
- Microservices Architecture β Deploy as containerized microservices for scalable production use
- Fine-Tuning Support β Fine-tune content detection models on domain-specific data
| Component | Technology |
|---|---|
| ASR Engine | OpenAI Whisper |
| Audio Processing | pydub, FFmpeg |
| Content Detection | Keyword matching, Regex patterns |
| CLI Interface | argparse, Rich |
| Language | Python 3.8+ |
This project is licensed under the MIT License β see the LICENSE file for details.
- OpenAI Whisper β Speech recognition model
- OpenVINO Toolkit β AI inference optimization
- pydub β Audio manipulation library
- Rich β Terminal formatting library
Built with β€οΈ