VideoSilenceCutter is a Python tool designed to automatically trim silent segments from video files, streamlining the video editing process. This project utilizes FFmpeg for audio processing, making it efficient and effective for content creators who spend excessive time manually editing videos.
- Detects silent parts of a video based on a configurable noise threshold and minimum silence duration.
- Trims the video automatically, outputting a new file without the silent segments.
- User-friendly, with clear instructions and customizable parameters.
- Python 3.x
- FFmpeg
moviepylibrary
-
Clone this repository:
git clone https://github.com/aathigk/VideoSilenceCutter.git cd VideoSilenceCutter -
Install the required dependencies:
pip install -r requirements.txt
-
Download and extract FFmpeg:
- Download FFmpeg from https://ffmpeg.org/download.html
- Extract the folder and rename it to
ffmpeg-n6.1-latest-win64-gpl-6.1(or update the path in VideoSilenceCutter.py) - Place it in the project root directory
- Place your input video files in the
input/folder. - Run the script:
python VideoSilenceCutter.py
- The output video will be saved in the
output/folder.
The project is organized as follows:
VideoSilenceCutter/
│
├── input/ # Folder for input video files
│ └── TestIP.mp4 # Example input video
│
├── output/ # Folder for output video files
│
├── ffmpeg-n6.1-latest-win64-gpl-6.1/ # FFmpeg installation folder
│ └── bin/
│ └── ffmpeg.exe # FFmpeg executable
│
├── VideoSilenceCutter.py # The main Python script
├── requirements.txt # List of Python dependencies
├── README.md # Project documentation
└── VideoSilenceCutter.iml # IDE configuration file
You can adjust the noise_threshold and min_silence_duration variables in the VideoSilenceCutter.py script to customize the silence detection criteria.
- noise_threshold: The audio level below which is considered silence (in dBFS)
- min_silence_duration: The minimum duration (in seconds) of silence required to trim
If you get an error saying ffmpeg.exe not found:
- Verify you've downloaded and extracted FFmpeg to the project directory
- Check the folder path matches:
ffmpeg-n6.1-latest-win64-gpl-6.1/bin/ffmpeg.exe - Alternatively, update the
ffmpeg_pathinVideoSilenceCutter.pyto point to your FFmpeg installation
If you're seeing .gitignore file and wondering where FFmpeg is:
- This is intentional! FFmpeg is excluded from git to keep the repository size small
- You must download it separately as instructed in the Installation section
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue for suggestions and improvements.
Special thanks to FFmpeg for providing powerful multimedia processing capabilities.