Python tools for video change detection and chromatic motion effects.
video_change_detector.py - Detect changes between frames
video_chromatic_motion.py - Create chromatic effects on video
pip install -r requirements.txtpython video_change_detector.py input.mp4python video_chromatic_motion.py selective-color input.mp4python video_chromatic_motion.py rgb-shift input.mp4Detects what changed in video over time.
Basic:
python video_change_detector.py video.mp4With options:
python video_change_detector.py video.mp4 -t 1.0 --threshold 30 --intensity 1.0 --mode grayscaleArguments:
-t 1.0- Time offset in seconds (larger = ignore slow camera movement)--threshold 30- Sensitivity 0-255 (lower = more sensitive)--intensity 1.0- Brightness 0-2 (higher = brighter)--mode grayscale- Output mode:grayscaleorcolormap-o output.mp4- Custom output file
To reduce camera movement detection: Use larger -t value (e.g., -t 2.0 or -t 3.0)
Four modes for chromatic effects:
Basic:
python video_chromatic_motion.py selective-color video.mp4With custom RGB offsets:
python video_chromatic_motion.py selective-color video.mp4 \
--red-offset 0.3 --green-offset 0.7 --blue-offset 1.0 --threshold 25Arguments:
--red-offset 0.3- Red channel time (seconds)--green-offset 0.7- Green channel time (seconds)--blue-offset 1.0- Blue channel time (seconds)--motion-offset 2.0- Motion detection time offset (seconds, larger = ignore camera movement)--threshold 25- Motion sensitivity 0-255 (lower = more sensitive)-o output.mp4- Custom output file
To reduce camera movement detection: Add --motion-offset 2.0 or higher (e.g., --motion-offset 3.0)
python video_chromatic_motion.py rgb-shift video.mp4python video_chromatic_motion.py motion-diff video.mp4python video_chromatic_motion.py motion-color video.mp4 -t 1.0 -c cyanArguments:
-t 1.0- Time offset in seconds (larger = ignore camera movement)-c cyan- Color: red, green, blue, cyan, magenta, yellow, white, orange, purple, pink, lime, teal--threshold 30- Sensitivity--intensity 1.0- Brightness
Avoiding camera movement detection:
- Both tools detect ALL motion, including camera movement
- Use larger time offsets to ignore slow camera pans/zooms
- Example:
-t 2.0or-t 3.0for change detector - Example:
--red-offset 0.5 --green-offset 1.5 --blue-offset 2.5for chromatic
Adjusting sensitivity:
- Lower
--threshold= more sensitive (detects small changes) - Higher
--threshold= less sensitive (only major changes) - Default is 30, try 20-40 range
Subtle rainbow trails:
python video_chromatic_motion.py selective-color video.mp4 \
--red-offset 0 --green-offset 0.2 --blue-offset 0.4Dramatic chromatic (ignores camera movement):
python video_chromatic_motion.py selective-color video.mp4 \
--red-offset 0.5 --green-offset 1.5 --blue-offset 2.5 --motion-offset 2.5 --threshold 35Change detection (high contrast, ignores camera):
python video_change_detector.py video.mp4 -t 2.0 --threshold 35 --intensity 2.0- Python 3.7+
- opencv-python
- numpy
MIT