A powerful Python CLI tool for splitting video files into multiple frame-separated streams with customizable frame distribution patterns.
Perfect for video feedback artists, experimental filmmakers, and anyone working with temporal video manipulation techniques. Handles iPhone slow-motion videos, preserves original quality, and supports all modern video formats.
- π― Smart Frame Distribution: Split videos into 2, 3, or 4 separate files
- β‘ High Performance: Fast frame extraction (3000+ FPS) with beautiful progress bars
- π Intelligent FPS Handling: Automatically adjusts frame rates and preserves existing FPS metadata
- π― FPS Override Support: Override detected FPS with original shooting rate (perfect for iPhone slow-motion)
- π¬ Quality Preservation: Maintains original codec, bitrate, and video settings (no degradation)
- π Smart File Validation: Automatically detects and skips non-video files (like HEIC images)
- π Organized Output: Clean folder structure with automatic file management
- π Comprehensive Logging: Detailed processing logs with timestamps and metadata
- π¨ Beautiful CLI Interface: Colorful ASCII art and intuitive user prompts
- π Audio Preservation: Maintains original audio in the first output file
- π‘οΈ Error Handling: Robust fallback mechanisms for various video formats
- Python: 3.7 or higher
- Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
- Memory: 4GB RAM minimum (8GB recommended for 4K videos)
- Storage: 2x the size of your largest video file
# Clone and install in one command
git clone https://github.com/videofeedback/frame-reshuffler.git && cd frame-reshuffler && pip install -r requirements.txt-
Clone the repository:
git clone https://github.com/videofeedback/frame-reshuffler.git cd frame-reshuffler -
Install Python dependencies:
pip install -r requirements.txt
-
Make script executable (macOS/Linux):
chmod +x frame_reshuffler.py
# Clone repository
git clone https://github.com/videofeedback/frame-reshuffler.git
cd frame-reshuffler
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\\Scripts\\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt| Package | Purpose | Version |
|---|---|---|
opencv-python |
Video frame extraction and processing | 4.9.0.80 |
moviepy |
Advanced video operations and codec handling | 1.0.3 |
tqdm |
Progress bars and processing feedback | 4.66.1 |
colorama |
Cross-platform colored terminal output | 0.4.6 |
numpy |
Efficient array operations | 1.24.3 |
# Try pip3 instead
pip3 install -r requirements.txt
# Or install pip
python -m pip install -r requirements.txt# Use user installation
pip install --user -r requirements.txt
# Or use sudo (not recommended)
sudo pip install -r requirements.txt# Try alternative OpenCV package
pip install opencv-python-headless
# Or use conda
conda install opencv# Install ffmpeg separately
# macOS with Homebrew:
brew install ffmpeg
# Ubuntu/Debian:
sudo apt update && sudo apt install ffmpeg
# Windows: Download from https://ffmpeg.org/download.html- Solution: Process videos in smaller chunks or upgrade RAM
- Alternative: Use lower resolution videos for testing
- Place your video files in the
Input/folder - Run the script:
python3 frame_reshuffler.py
- Choose your split option (2, 3, or 4-way)
- Optional: Enter original shooting FPS if known (e.g., iPhone 120fps β 30fps)
- Find processed videos in
Processed/[video_name]/ - Original files are moved to
Done/folder
# When you have iPhone 120fps videos slowed to 30fps:
python3 frame_reshuffler.py
# Select: 2 splits
# FPS Override: 120
# Result: 2x 60fps videos (correct speed)# Place multiple videos in Input/ folder
python3 frame_reshuffler.py
# The tool will process all videos in sequence# You can copy the script to any folder and run it there
cp frame_reshuffler.py /path/to/your/project/
cd /path/to/your/project/
python3 frame_reshuffler.py- File A: Even frames (0, 2, 4, 6, ...)
- File B: Odd frames (1, 3, 5, 7, ...)
- New FPS: Original FPS Γ· 2
- File A: Frames 0, 3, 6, 9, ...
- File B: Frames 1, 4, 7, 10, ...
- File C: Frames 2, 5, 8, 11, ...
- New FPS: Original FPS Γ· 3
- File A: Frames 0, 4, 8, 12, ...
- File B: Frames 1, 5, 9, 13, ...
- File C: Frames 2, 6, 10, 14, ...
- File D: Frames 3, 7, 11, 15, ...
- New FPS: Original FPS Γ· 4
Perfect for handling slow-motion videos that have been processed by cameras:
iPhone Slow Motion Example:
- Original shooting: 120 FPS
- iPhone slows to: 30 FPS (4x slower)
- Frame Reshuffler detects: 30 FPS
- Your input: 120 FPS override
- Result: Split videos at 60 FPS each (maintaining original timing)
Without Override: 2x 15 FPS videos (too slow) With Override: 2x 60 FPS videos (correct speed)
frame-reshuffler/
βββ frame_reshuffler.py # Main application script
βββ requirements.txt # Python dependencies
βββ README.md # This documentation
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # MIT license
βββ .gitignore # Git ignore rules
βββ Input/ # Place your videos here
β βββ .gitkeep # Keeps folder in git
βββ Processed/ # Split videos output
β βββ processing_log.txt # Detailed processing logs
β βββ [video_name]/ # Individual video results
βββ Done/ # Processed originals with FPS metadata
βββ .gitkeep # Keeps folder in git
Original: my_video.mp4 (30 FPS)
After 2-way split:
- Processed folder:
my_video_A_Frame_FPS_15.mp4my_video_B_Frame_FPS_15.mp4
- Done folder:
my_video_FPS_30.mp4
========================================
Timestamp: 2025-09-23 00:21:11
Original File: iphone_slowmo.MOV
Detected FPS: 30.00
FPS Override: 120.00 (user specified original shooting rate)
Effective FPS: 120.00
Original Frames: 1800
Processing Duration: 15.00 seconds
Resolution: 1920x1080
Split Type: 2-way
Output Files:
- iphone_slowmo_A_Frame_FPS_60.mp4 (900 frames, 15.00s)
- iphone_slowmo_B_Frame_FPS_60.mp4 (900 frames, 15.00s)
Processing Time: 12.3 seconds
Status: Success
========================================
The tool features a beautiful ASCII art interface with:
- π¨ Colorful banner and prompts with cross-platform support
- π Real-time progress bars for frame extraction and video creation
- β Success/error indicators with clear messaging
- π Processing statistics and timing information
- π File validation with skip notifications
Input: .mp4, .avi, .mov, .mkv, .flv, .wmv, .webm, .heic*, .hevc, .h265, .m4v
*Note: HEIC files are typically images, but the tool will attempt to process them if they contain video data
Output: .mp4 (preserves original codec: H.264, H.265/HEVC, MPEG-4, etc.)
- Frame Extraction: 3,000-4,000 FPS (depending on video resolution)
- Video Writing: 80-100 FPS with OpenCV fallback
- Memory Usage: Efficient frame-by-frame processing
- Quality: Zero degradation with original codec preservation
- OpenCV (
opencv-python): High-performance video frame extraction and writing - MoviePy (
moviepy): Advanced video processing, codec detection, and audio handling - tqdm: Beautiful progress bars with detailed timing information
- colorama: Cross-platform colored terminal output (Windows, macOS, Linux)
- NumPy: Efficient array operations for frame data
- Original Codec Preservation: Automatically detects and maintains H.264, H.265/HEVC, MPEG-4, and other codecs
- Bitrate Preservation: Maintains original video bitrate to prevent quality loss
- High-Quality Encoding: Uses CRF 18 (visually lossless) when re-encoding is necessary
- No Transcoding When Possible: Preserves original encoding parameters
- Automatically detects existing FPS metadata in filenames
- FPS Override Feature: Enter original shooting rate when video has been slowed down
- Perfect for iPhone slow-motion: 120fps β 30fps, 240fps β 60fps videos
- Preserves correct FPS information without duplication
- Validates filename FPS against actual video properties
- Maintains original audio track in the first output file (A_Frame)
- Preserves original audio codec and quality
- Handles audio duration synchronization automatically
- Graceful fallback when audio processing fails
- Automatic Detection: Validates files before processing to ensure they contain video data
- Smart Skipping: Gracefully skips image files (HEIC, JPG, PNG) with clear user feedback
- Format Recognition: Identifies and handles various video container formats correctly
- OpenCV fallback when MoviePy encounters compatibility issues
- Comprehensive error logging for troubleshooting
- Automatic cleanup of temporary files
- Detailed error messages with suggested solutions
Create alternative views for live previsualization. Perfect for creating temporal offsets and frame-rate variations.
Generate alternating temporal sequences for artistic video manipulation and non-linear storytelling. Create unique visual effects through frame redistribution.
Split high-speed footage into separate streams for detailed frame-by-frame analysis. Ideal for motion studies and scientific video analysis.
Create multi-angle effects by processing the same source material with different temporal offsets. Perfect for social media content and video art.
Handle iPhone slow-motion videos correctly by specifying the original shooting rate, ensuring proper frame timing in output videos.
# Check Python version
python3 --version
# Should be 3.7 or higher
# If not, install Python 3.7+- Ensure videos are in the
Input/folder - Check supported formats: MP4, AVI, MOV, MKV, etc.
- Verify files aren't corrupted
- Close other applications
- Process smaller videos first
- Consider upgrading RAM
- Normal for 4K videos
- Close other applications
- Use SSD storage for better performance
- Use FPS override for slow-motion videos
- Ensure original video has proper audio
# Make script executable
chmod +x frame_reshuffler.py
# Or run with python3
python3 frame_reshuffler.py- Check the processing log in
Processed/processing_log.txt - Review error messages for specific solutions
- Try with a smaller test video first
- Check system requirements and dependencies
We welcome contributions from the video art and open source communities!
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with proper comments and documentation
- Test thoroughly with various video formats
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
# Clone your fork
git clone https://github.com/your-username/frame-reshuffler.git
cd frame-reshuffler
# Create development environment
python -m venv dev-env
source dev-env/bin/activate # or dev-env\Scripts\activate on Windows
# Install in development mode
pip install -e .
pip install -r requirements.txt
# Run tests
python -m pytest tests/High Priority:
- Additional video format support
- Performance optimizations
- Cross-platform testing
- GUI interface development
Documentation:
- Video tutorials and examples
- Performance benchmarks
- Use case documentation
For detailed contribution guidelines, see CONTRIBUTING.md.
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use - Use in commercial projects
- β Modification - Modify and distribute
- β Distribution - Share with others
- β Private use - Use for personal projects
- β Liability - No warranty provided
- β Trademark use - No trademark rights
- Built with β€οΈ for the Virtual Production Community and experimental film Community
- Special thanks to the OpenCV and MoviePy communities
- Created for artists, filmmakers, and video enthusiasts worldwide
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π Documentation: This README and inline code comments
- π Help: Check the troubleshooting section above
- π¬ Virtual Production Artists: Share your creations!
- π Experimental Filmmakers: Document your techniques
- π¨βπ» Developers: Contribute improvements and new features
- π¨ Digital Artists: Explore new temporal manipulation techniques
Made for VP artists and experimental filmmakers worldwide πβ¨
Frame Reshuffler - Where temporal art meets technical precision