A simple command-line tool to create multiple clips from a video file using timestamps. Perfect for creating highlights or segments from long videos.
- Create multiple clips from a single video file
- Simple JSON configuration for clip timestamps
- Progress tracking for batch processing
- Preserves original video quality using stream copy
- Lightweight and easy to use
- Python 3.6+
- FFmpeg installed on your system
- Clone the repository:
git clone https://github.com/erikthiart/VideoClipper.git
cd VideoClipper
- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
- Install dependencies:
pip install tqdm ffmpeg-python
- Install FFmpeg:
- macOS:
brew install ffmpeg
- Ubuntu/Debian:
sudo apt-get install ffmpeg
- Windows: Download from FFmpeg website
- Create a JSON file with your clip timestamps (e.g.,
timestamps.json
):
[
{
"start": "00:00:00",
"end": "00:01:00"
},
{
"start": "00:02:00",
"end": "00:03:00"
}
]
- Run the script:
python video_clipper.py --input path/to/video.mp4 --timestamps timestamps.json --output-dir clips
--input
: Path to the input video file (required)--timestamps
: Path to JSON file containing clip timestamps (required)--output-dir
: Directory where clips will be saved (default: 'clips')
# Create clips directory
mkdir clips
# Run the script
python video_clipper.py --input my_video.mp4 --timestamps timestamps.json --output-dir clips
This will create numbered clips (clip_1.mp4, clip_2.mp4, etc.) in the specified output directory.
video-clipper/
├── video_clipper.py # Main script
├── timestamps.json # Example timestamps file
├── requirements.txt # Project dependencies
└── README.md # This file
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the unLicense - see the LICENSE file for details.
- FFmpeg for video processing
- tqdm for progress bars
- ffmpeg-python for FFmpeg integration