Frame Splitter is a powerful, professional-grade Node.js tool that converts any video into exactly 300 evenly spaced PNG frames while preserving the original resolution and highest quality. Perfect for video analysis, machine learning datasets, animation projects, and content creation.
- Extract frames for machine learning training datasets
- Analyze video content frame by frame
- Create thumbnails and previews
- Quality control and video inspection
- Highest Quality Output: Uses FFmpeg with premium PNG settings (
-q:v 1) - Original Resolution: No quality loss, no upscaling/downscaling
- Precise Frame Selection: Mathematically calculated even spacing
- Batch Processing: Handle multiple videos efficiently
- Content Creation: Extract frames for video editing
- Animation: Create sprite sheets and animation frames
- Research: Video analysis and computer vision projects
- Quality Assurance: Frame-by-frame video inspection
- Thumbnails: Generate high-quality video previews
- Multiple Interfaces: CLI, programmatic API, and GUI
- Cross-Platform: Windows, macOS, and Linux support
- Zero Configuration: FFmpeg included, works out of the box
- Comprehensive Logging: Track progress and debug issues
- π― Precise Frame Extraction: Always extracts exactly 300 evenly spaced frames
- π Highest Quality Output: Professional-grade PNG compression
- π Original Resolution: Preserves source video dimensions perfectly
- π₯οΈ Multiple Interfaces: CLI tool, Node.js API, and Electron GUI
- π Cross-Platform: Works seamlessly on Windows, macOS, and Linux
- π Progress Tracking: Real-time progress bars and detailed logging
- π¦ Batch Processing: Convert multiple videos simultaneously
- π§ Smart Frame Selection: Intelligent timestamp calculation
- β‘ Fast Processing: Optimized FFmpeg operations
- π§ No Dependencies: FFmpeg bundled, no external installations needed
- Node.js: Version 14.0.0 or higher
- Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
- RAM: Minimum 4GB (8GB recommended for large videos)
- Storage: Sufficient space for output frames (300 PNG files per video)
- FFmpeg: Automatically included via ffmpeg-static
# Clone the repository
git clone https://github.com/kaif11ali/Frame-Splitter.git
# Navigate to the project directory
cd Frame-Splitter
# Install dependencies
npm install- Visit the GitHub Repository
- Click the green "Code" button
- Select "Download ZIP"
- Extract the ZIP file
- Open terminal/command prompt in the extracted folder
- Run
npm install
# Install globally (if available on NPM)
npm install -g video-to-frames
# Use anywhere
video-to-frames convert your-video.mp4# Check if Node.js is installed
node --version
# Test the tool
node cli.js --help
# Test with a sample video
node cli.js info your-video.mp4# Basic conversion
node cli.js convert path/to/video.mp4
# Specify output directory
node cli.js convert path/to/video.mp4 -o frames
# Custom quality (1-31, lower is better)
node cli.js convert path/to/video.mp4 -o frames -q 1node cli.js info path/to/video.mp4# Convert all videos in a directory
node cli.js batch path/to/videos/ -o output
# Specify video extensions
node cli.js batch path/to/videos/ -o output -e mp4 avi movnode cli.js --helpconst VideoToFramesConverter = require('./VideoToFramesConverter');
async function convertVideo() {
const converter = new VideoToFramesConverter();
try {
const result = await converter.convertVideo('input.mp4', 'output-frames');
console.log('Conversion completed:', result);
} catch (error) {
console.error('Conversion failed:', error.message);
}
}
convertVideo();For the graphical interface:
npm run electronThe GUI features:
- Drag & drop video files
- Browse for video files and output folders
- Real-time progress tracking
- Video information display
- One-click conversion
The tool creates PNG files with the following naming convention:
output-folder/
βββ frame_001.png
βββ frame_002.png
βββ frame_003.png
...
βββ frame_300.png
- MP4 (.mp4)
- AVI (.avi)
- MOV (.mov)
- MKV (.mkv)
- WMV (.wmv)
- FLV (.flv)
- WebM (.webm)
- Format: PNG
- Quality: Highest (
-q:v 1) - Resolution: Original video resolution (preserved)
- Frame Count: Exactly 300 frames
- Spacing: Evenly distributed across video duration
The tool uses intelligent frame selection:
- Analyze Video: Gets total frames and duration using FFprobe
- Calculate Spacing: Determines frame interval (total_frames / 300)
- Extract Frames: Selects frames at even intervals across the entire video
- Time-based Selection: Uses timestamps for precise frame extraction
- Video: 1800 frames, 60 seconds
- Interval: Every 6th frame (1800 Γ· 300 = 6)
- Timestamps: Every 0.2 seconds (60 Γ· 300 = 0.2s)
Converts a video to 300 PNG frames.
Parameters:
videoPath(string): Path to input video fileoutputDir(string, optional): Output directory (default: 'frames')
Returns: Promise resolving to conversion result object
Gets detailed video information.
Parameters:
videoPath(string): Path to video file
Returns: Promise resolving to metadata object
Converts multiple videos.
Parameters:
videoPaths(Array): Array of video file pathsbaseOutputDir(string, optional): Base output directory
Returns: Promise resolving to array of results
The tool includes comprehensive error handling for:
- Invalid video files
- Missing FFmpeg dependencies
- Insufficient disk space
- Corrupted video streams
- Permission issues
- Network-related problems (for remote files)
# Convert a sample video
node cli.js convert sample-video.mp4 -o my-frames
# Check what would be extracted
node cli.js info sample-video.mp4const VideoToFramesConverter = require('./VideoToFramesConverter');
async function advancedConversion() {
const converter = new VideoToFramesConverter();
// Get video info first
try {
const metadata = await converter.getVideoMetadata('input.mp4');
console.log(`Video has ${metadata.totalFrames} frames`);
console.log(`Will extract 300 frames (every ${Math.floor(metadata.totalFrames / 300)} frames)`);
// Convert with custom settings
const result = await converter.convertVideo('input.mp4', 'custom-output');
console.log(`β
Extracted ${result.totalFrames} frames`);
console.log(`π Saved to: ${result.outputDirectory}`);
} catch (error) {
console.error('β Error:', error.message);
}
}
advancedConversion();const VideoToFramesConverter = require('./VideoToFramesConverter');
const fs = require('fs');
const path = require('path');
async function batchProcess() {
const converter = new VideoToFramesConverter();
const videoDir = './videos';
// Find all video files
const files = fs.readdirSync(videoDir)
.filter(file => /\.(mp4|avi|mov)$/i.test(file))
.map(file => path.join(videoDir, file));
console.log(`Found ${files.length} videos to process`);
// Batch convert
const results = await converter.batchConvert(files, 'batch-output');
// Summary
const successful = results.filter(r => r.success).length;
console.log(`Successfully processed: ${successful}/${files.length} videos`);
}
batchProcess();-
"FFmpeg not found"
- Solution: The tool includes ffmpeg-static, but ensure Node.js can access it
- Try:
npm install ffmpeg-static --save
-
"Permission denied"
- Solution: Ensure write permissions for output directory
- Try: Create output directory manually first
-
"Invalid video format"
- Solution: Check if video file is corrupted
- Try:
node cli.js info your-video.mp4to verify
-
"Out of memory"
- Solution: Process shorter videos or increase Node.js memory
- Try:
node --max-old-space-size=4096 cli.js convert video.mp4
- Use SSD storage for faster frame extraction
- Close unnecessary applications during processing
- Process videos locally (avoid network drives)
- Use smaller input videos for testing
MIT License - see LICENSE file for details.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For issues, questions, or contributions, please open an issue in the repository.
Made with β€οΈ using Node.js, FFmpeg, and Electron