A powerful video splitter designed for Windows users running WSL2 Ubuntu
Features • Quick Start • Installation • Usage • FAQ
SplitVid for WSL2 is a Python script that splits large video files into smaller, manageable chunks. It's specifically designed for users who:
- 📁 Have large video files on Windows drives (F:, D:, etc.)
- 🐧 Run Python and FFmpeg in WSL2 Ubuntu
- ⚡ Want fast, lossless video splitting without re-encoding
- 🎓 Need to upload videos with size limits (Moodle, Google Drive, LMS platforms)
Why WSL2? WSL2 (Windows Subsystem for Linux) provides a lightweight Linux environment inside Windows. Your files stay on Windows drives, but processing happens in Linux — giving you the best of both worlds!
| Feature | Description |
|---|---|
| 🚀 Blazing Fast | Uses FFmpeg stream copy — no re-encoding, splits in seconds |
| 📏 Precise Splitting | Accurately divides videos into your specified chunk size |
| 🔄 Auto Path Conversion | Automatically converts Windows paths (F:\folder) to WSL paths (/mnt/f/folder) |
| ✅ Tool Verification | Checks for FFmpeg/FFprobe before running |
| 👀 Dry Run Mode | Preview what will happen before actual splitting |
| 📊 Progress Tracking | Real-time progress with timestamps and file sizes |
| 🎨 Beautiful Output | Colorful, emoji-rich terminal output |
| 📁 Batch Processing | Process multiple videos in one run |
.mp4 .mkv .avi .mov .flv .wmv .webm .m4v
| Requirement | How to Check | Install Command |
|---|---|---|
| WSL2 Ubuntu | Open PowerShell, type wsl |
Microsoft WSL Guide |
| Python 3 | In WSL: python3 --version |
sudo apt install python3 |
| FFmpeg | In WSL: ffmpeg -version |
sudo apt install ffmpeg -y |
Press Win + X and select "Ubuntu" or open PowerShell and type:
wsl# Navigate to your preferred directory
cd ~
# Download the script (or copy it manually)
# Save as: video_splitter.py# Basic usage - split videos in a Windows folder
python3 video_splitter.py "F:\new_course\splitsource"That's it! Your split videos will be in F:\new_course\splitsource\output\
If you don't have WSL2 installed yet, follow these steps:
Open PowerShell as Administrator and run:
wsl --installThis will:
- Enable WSL2
- Download and install Ubuntu
- Set up everything automatically
After the installation completes, restart Windows.
- Open Ubuntu from the Start menu
- Create a username and password when prompted
Open your WSL2 Ubuntu terminal and run:
# Update package lists
sudo apt update
# Install FFmpeg (includes ffprobe)
sudo apt install ffmpeg -y
# Verify installations
python3 --version
ffmpeg -versionOption A: Direct Download
Save the video_splitter.py file to any location in your WSL2 filesystem.
Option B: Clone from GitHub
git clone https://github.com/Gorachand22/splitvid.git cd splitvid
# Split all videos in a folder (default: 1.8 GB chunks)
python3 video_splitter.py "F:\new_course\splitsource"# Custom chunk size (2 GB)
python3 video_splitter.py "F:\new_course\splitsource" --size 2.0
# Preview mode - see what would happen without splitting
python3 video_splitter.py "F:\new_course\splitsource" --dry-run
# Custom output folder
python3 video_splitter.py "F:\new_course\splitsource" --output "F:\processed_videos"
# Specify custom video extensions
python3 video_splitter.py "F:\new_course\splitsource" --ext ".mp4,.mkv,.avi"| Argument | Short | Default | Description |
|---|---|---|---|
source |
- | Required | Folder containing video files |
--size |
-s |
1.8 |
Split size in GB |
--output |
-o |
source/output |
Output folder path |
--dry-run |
-n |
False |
Preview without splitting |
--ext |
-e |
.mp4,.mkv,... |
Video extensions to process |
The script accepts both Windows and WSL path formats:
| Windows Path | WSL Equivalent | Notes |
|---|---|---|
F:\videos |
/mnt/f/videos |
✅ Both work |
D:\Movies\BigFiles |
/mnt/d/Movies/BigFiles |
✅ Both work |
C:\Users\Name\Videos |
/mnt/c/Users/Name/Videos |
✅ Both work |
How WSL2 Mounts Work: Windows drives are automatically mounted under
/mnt/in WSL2. DriveF:becomes/mnt/f/, driveD:becomes/mnt/d/, etc.
| Setting | Use Case |
|---|---|
--size 1.8 |
Default, fits most upload limits (Moodle, LMS) |
--size 2.0 |
For platforms with 2GB limit |
--size 0.7 |
For CD burning (700MB) |
--size 4.7 |
For DVD burning (4.7GB) |
Original: 12 GB video
Target: 1.8 GB per file
┌─────────────────────────────────────────────────┐
│ Original Video (12 GB) │
└─────────────────────────────────────────────────┘
↓ SPLIT ↓
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Part 001 │ │ Part 002 │ │ Part 003 │ ... │ Part 007 │
│ 1.7 GB │ │ 1.7 GB │ │ 1.7 GB │ │ 1.7 GB │
└──────────┘ └──────────┘ └──────────┘ └──────────┘
The script:
- Calculates the number of parts needed:
ceil(12GB ÷ 1.8GB) = 7 parts - Divides the total duration equally among parts
- Splits using FFmpeg stream copy (fast, lossless)
splitvid-wsl2/
│
├── video_splitter.py # Main script
├── README.md # This documentation
└── LICENSE # MIT License
🔴 Do I need to copy videos to WSL2?
No! Your videos stay on your Windows drives. The script reads and writes directly to Windows paths via WSL2's /mnt/ mounts. This saves disk space since WSL2's virtual disk would grow if you copied files into it.
🔴 Will splitting reduce video quality?
No! The script uses FFmpeg's -c copy option, which copies the video/audio streams without re-encoding. It's like cutting a rope — the pieces are made of the same material.
🔴 How long does splitting take?
Very fast! Since there's no re-encoding, a 12GB video typically splits in 1-2 minutes. The speed depends mainly on your disk read/write speed.
🔴 Can I split other file types?
The script is designed for video files. However, since it uses FFmpeg stream copy, it can technically split any media file that FFmpeg supports (audio files, etc.). Add custom extensions with --ext.
🔴 "ffmpeg not found" error
Install FFmpeg in WSL2:
sudo apt update
sudo apt install ffmpeg -yVerify installation:
ffmpeg -version🔴 "Source directory does not exist" error
Make sure:
- The drive letter is correct — Check in Windows Explorer first
- The path exists — Verify the folder exists
- WSL can access the drive — Run
ls /mnt/f/in WSL
If WSL can't see a drive, try remounting:
sudo mkdir -p /mnt/f
sudo mount -t drvfs F: /mnt/f🔴 Split videos have slight size variations
This is normal. The script splits by time, not exact bytes. FFmpeg splits at keyframes to avoid corruption, which can cause small size variations. The differences are usually negligible.
🔴 Some parts won't play in my player
Try using VLC Media Player — it handles split videos better than most players. The first few seconds might be black due to keyframe alignment.
For perfect playback, consider re-encoding (slower but frame-accurate):
# Replace -c copy with re-encoding (slower)
# This is not recommended for large files- Python 3.6+ — For running the script
- FFmpeg — For video processing
- FFprobe — For video analysis (included with FFmpeg)
- Scan — Finds all video files in the source directory
- Analyze — Gets duration and file size using FFprobe
- Calculate — Determines optimal number of parts
- Split — Uses FFmpeg stream copy for fast, lossless splitting
- Verify — Checks output files exist with proper size
ffmpeg -y \
-ss [START_TIME] \ # Start position
-i [INPUT_FILE] \ # Input video
-t [DURATION] \ # Part duration
-c copy \ # Stream copy (no re-encoding)
-avoid_negative_ts 1 \ # Fix timing issues
-map 0 \ # Include all streams
[OUTPUT_FILE] # Output pathContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
If this tool saved you time, consider:
- ⭐ Starring the repository
- 🐛 Reporting bugs via Issues
- 💡 Suggesting new features
- 📢 Sharing with others who might find it useful
Made with ❤️ for the WSL2 community
Split large videos. Upload anywhere. No quality loss.