I recommend using the split_scenes.py file from the LTX-Video-Trainer repo for this purpose.
It is a Python utility for automatically detecting and splitting videos into individual scenes based on visual content changes.
A Python utility that analyzes MP4 files by frame count and organizes them into appropriate buckets.
- Analyzes MP4 files to determine their exact frame count using OpenCV
- Organizes videos into user-defined frame count buckets (e.g., 30, 60, 120 frames)
- Creates only the bucket folders that will actually contain files
- Places each video in the bucket with the closest smaller-or-equal frame count
- Provides detailed progress feedback and summary statistics
- Python 3.6+
- OpenCV (pip install opencv-python)
python bucketeer.py /path/to/videos --buckets 30,60,120,300
A simple Python script to change the FPS (frames per second) of all videos in a folder.
- This tool changes the frame rate but keeps the same video duration
- It processes all videos in the input folder and saves them to the output folder
- Original videos are left untouched
- Audio is preserved without re-encoding
- Python 3.6 or higher
- FFmpeg (must be installed separately and available in your PATH)
python fps-changer.py --input /path/to/videos --output /path/to/output --fps 16
A simple Python script to analyze video files and display their resolution, aspect ratio, frame count, and FPS information.
Analyzes all video files in a folder and displays comprehensive information Shows resolution, aspect ratio, total frame count, and FPS for each video Supports recursive scanning of subdirectories Works with a wide range of video formats (MP4, AVI, MKV, MOV, and many more) Fast processing using FFprobe Debug mode for troubleshooting file detection issues
- Python 3.6 or higher
- FFmpeg with FFprobe (must be installed separately and available in your PATH)
Install FFmpeg:
- Windows: Download from https://ffmpeg.org/download.html
- macOS: brew install ffmpeg
- Linux: sudo apt install ffmpeg (Ubuntu/Debian) or sudo yum install ffmpeg (CentOS/RHEL)
Verify FFprobe is working:
ffprobe -version
Basic usage:
python video_res_fps_analyzer.py /path/to/videos
folder- Input folder path (required)-r, --recursive- Search recursively in subdirectories--no-duration- Skip frame count and FPS information for faster processing--debug- Enable debug output to troubleshoot file detection issues-h, --help- Show help message
A Python utility that normalizes video aspect ratios using intelligent cropping while preserving maximum quality.
- Normalizes all videos in a folder to a target aspect ratio (default 16:9)
- Uses intelligent cropping to maintain content without black bars or distortion
- Preserves original quality when videos already have the correct aspect ratio (simple copy)
- Maintains highest possible quality for processed videos (CRF 18, audio copy)
- Automatically calculates optimal output dimensions based on input video resolution
- Supports all common video formats (MP4, MOV, AVI, MKV, M4V, WMV, FLV, WebM)
- Python 3.6+
- FFmpeg (must be installed and available in PATH)
- FFprobe (usually included with FFmpeg)
Basic usage (16:9 aspect ratio):
python ar_normalizer.py /path/to/input /path/to/outputCustom aspect ratio:
python ar_normalizer.py /path/to/input /path/to/output --aspect-ratio 1.33Fixed width or height:
# All videos will have 1920px width, height calculated from aspect ratio
python ar_normalizer.py /path/to/input /path/to/output --aspect-ratio 1.78 --width 1920
# All videos will have 1080px height, width calculated from aspect ratio
python ar_normalizer.py /path/to/input /path/to/output --aspect-ratio 1.78 --height 1080Smart Processing:
- Videos with correct aspect ratio (±0.01 tolerance) are simply copied without re-encoding
- Videos needing correction are cropped from the center and scaled to target dimensions
- Audio is always preserved without re-encoding to maintain quality
Cropping Logic:
- Square videos (1:1) → 16:9: Crops top and bottom, maintains width
- Portrait videos (9:16) → 16:9: Crops top and bottom significantly
- Wide videos (2:1) → 16:9: Crops left and right sides
- Always crops from the center to preserve the most important content
- 1.78 (16:9) - Standard widescreen, YouTube, most displays
- 1.33 (4:3) - Classic TV, older content
- 1.0 (1:1) - Square format, Instagram posts
- 0.56 (9:16) - Vertical format, TikTok, Instagram Stories
- 2.35 (21:9) - Cinematic widescreen