This Python script efficiently trims multiple video files to a specific duration using the moviepy library. It is particularly useful for content creators, social media managers, or anyone needing to extract short clips from longer videos quickly.
- Batch Processing: Automatically trims multiple video files in a loop.
- Customizable Duration: By default, extracts the first 15 seconds of each video (can be adjusted in the script).
- Simple & Lightweight: Uses
moviepy'sffmpeg_extract_subclipfor fast processing without excessive dependencies. - Automated File Naming: Saves the trimmed videos with a
trimmed_prefix to prevent overwriting original files.
Make sure you have Python installed along with the required library:
pip install moviepy- Place the script in the same directory as your video files.
- Modify the
video_fileslist with the names of the videos you want to trim. - Adjust
start_timeandend_timeif needed. - Run the script:
python videotrimer.py- Modify
start_timeandend_timeto change the duration of the trimmed clips. - Add more filenames to
video_filesfor bulk processing. - Enhance the script with user input for dynamic trimming durations.
This project is open-source under the MIT License.
This script simplifies video trimming tasks, making it an excellent tool for quick edits. Feel free to improve and extend its functionality!