Skip to content

Python script designed to split longer videos into shorter clips for Social Media.

License

Notifications You must be signed in to change notification settings

fgutep/Video-Clip-Divider-4-Social-Media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Video Clip Divider - Reels & Tiktok

Overview

The Video Clip Divider is a Python script designed to split longer videos into shorter clips that are perfect for platforms that only allow limited time lenghts like Instagram Reels and TikTok. The script allows users to specify the duration of each clip (part) and handles the division process efficiently, making it easy to create multiple segments from a single edited video.

Features

  • Divides a long video into multiple shorter clips.
  • Allows configuration persistence through a JSON file (userConfig.json).
  • Option to save and load user configuration for clip duration, warning messages, and naming conventions.
  • Provides warnings if the video duration is not evenly divisible by the clip duration.
  • Colored terminal output for better readability of messages and warnings.

Requirements

  • Python 3.x
  • ffmpeg-python library
  • ffmpeg installed on your system
  • Installation

  1. Ensure you have Python 3.x installed.
  2. Install the required library: $ pip install ffmpeg-python
  3. Ensure ffmpeg is installed and accessible from the command line.

Usage

  1. Run the script:
$ python video_clip_divider.py
  1. Follow the on-screen prompts to provide the path to the video file, clip duration, and configuration options.

Example

  1. Provide the path to the video file to divide:
PATH to video file to divide > /path/to/video.mp4
  1. Specify the clip duration (in seconds):
Clip duration? (Seconds) > 30
  1. Choose whether to load the default user configuration:
Load default user configuration Y/N ? > N
  1. Set the persistence option:
Should sacrifice start/end clips if the video can not be exactly cropped Y/N ? > Y
  1. Set the warning option:
Should it raise warnings about duration Y/N ? > Y
  1. Set the naming convention for output files:
Output files will be named <NAME>
# Give <NAME> or leave empty for single numeration: 
  1. Choose whether to save the configuration as default:
Save persistence/warn/naming as default? Y/N ? > Y

Configuration

The script creates a userConfig.json file to store user preferences for persistence, warnings, and naming conventions. This file is automatically loaded if it exists, and the user has the option to overwrite it.

Note

To change the default configuration, delete the userConfig.json file manually.

Credits

The Trim version is a modified version of the trim method shown on: https://github.com/CodingWith-Adam/trim-videos-with-ffmpeg-python That @CodingWith-Adam does a great job explaining in his youtube channel.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Python script designed to split longer videos into shorter clips for Social Media.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages