Skip to content

Split and slice videos into pieces with fixed steps or random cuts

License

Notifications You must be signed in to change notification settings

aedev-tools/splitit-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

splitit

A fast, easy-to-use CLI tool for splitting and slicing videos into pieces.

Features

  • Fixed Step Mode: Split video into equal-length segments
  • Random Cuts Mode: Split video into N random parts
  • Interactive & CLI Modes: Choose guided experience or command-line flags
  • Smart Encoding: Uses fast copy mode by default, falls back to re-encoding when needed
  • Cross-platform: Works on macOS, Linux, and Windows

Installation

npm install -g splitit

Then install ffmpeg (required dependency):

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt-get install ffmpeg

# Other systems: https://ffmpeg.org/download.html

Usage

Interactive Mode

Simply run splitit and follow the prompts:

splitit
splitit split video.mp4

Command-Line Mode

Use flags to specify options directly:

Fixed step splitting:

splitit split video.mp4 --mode fixed --step 60
splitit split video.mp4 -m fixed -s 60

Random cuts:

splitit split video.mp4 --mode random --parts 5
splitit split video.mp4 -m random -p 5

Custom output directory:

splitit split video.mp4 -m fixed -s 60 --output ./output

Help

splitit --help
splitit split --help

Options

split command

Options:
  --mode, -m <mode>       fixed|random (interactive if not provided)
  --step, -s <seconds>    Step size in seconds or HH:MM:SS (fixed mode)
  --parts, -p <number>    Number of parts (random mode)
  --output, -o <dir>      Output directory (default: splitit_<filename>/)
  --help, -h              Show help

Examples

Split a video every 30 seconds

splitit split myvideo.mp4 --mode fixed --step 30
# Creates: splitit_myvideo/myvideo_part_001.mp4, myvideo_part_002.mp4, etc.

Split a video into 5 random parts

splitit split myvideo.mp4 --mode random --parts 5

Interactive mode

$ splitit split podcast.mp4

? Choose split mode: (Use arrow keys)
❯ Fixed steps (e.g., every 60s)
  Random cuts

? Enter step size (seconds or HH:MM:SS): 5:00

✓ Created podcast_part_001.mp4
✓ Created podcast_part_002.mp4
...
Done. Parts saved to: splitit_podcast

Output

  • Output Directory: splitit_<original_filename>/ (in same directory as input)
  • File Names: <filename>_part_001.<ext>, <filename>_part_002.<ext>, etc.
  • Format: Original codec preserved for quality

Time Format

Step size accepts multiple formats:

  • Seconds: 60, 30.5
  • MM:SS: 1:30, 5:00
  • HH:MM:SS: 01:30:00, 00:05:30

Development

git clone <repo>
cd splitit-cli
npm install
npm run build
npm run dev

License

MIT

About

Split and slice videos into pieces with fixed steps or random cuts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published