yair
b9d664ad23
scripts: make append_signals.py memory-efficient using ffmpeg streaming
...
Rewrite to use ffmpeg's tile and loop filters instead of Pillow stitching.
This eliminates the need to load entire panorama into memory.
Changes:
- Remove Pillow dependency
- Use ffmpeg's tile filter to create horizontal panorama
- Use loop filter to repeat the tiled frame
- Apply scrolling crop filter for animation
- No intermediate stitched image file created
- Memory usage stays constant regardless of image count
Benefits for large datasets (e.g., 1379 frames):
- Old approach: ~2.6GB in RAM (2.6M x 1005 pixels)
- New approach: Constant low memory (streams through ffmpeg)
Tested with 5 frames: creates 10s video, 304 frames, 2.61MB
2025-11-22 17:12:07 +02:00
yair
bfc8756a2a
scripts: rewrite append_signals.py for linescan scrolling video
...
Complete rewrite to properly handle linescan image sequences:
- Stitches linescan images horizontally into wide panorama
- Creates scrolling video that pans left-to-right
- Configurable scroll speed based on capture rate (750 lines/sec)
- Output saved one folder up from image source
- Uses Pillow for image stitching, ffmpeg for video creation
Features:
- --scroll-speed: multiplier for playback speed (1.0 = real-time)
- --lines-per-second: linescan capture rate (default: 750)
- --max-frames: limit frames for testing
- --fps: output video framerate (default: 30)
- --width: viewport width (default: 1920)
- Automatic cleanup of temporary stitched image
Example usage:
# Real-time playback
uv run scripts\append_signals.py results\20251122\bumpy-filter
# 2x speed
uv run scripts\append_signals.py results\20251122\bumpy-filter --scroll-speed 2.0
# Test with 10 frames
uv run scripts\append_signals.py results\20251122\bumpy-filter --max-frames 10
2025-11-22 16:59:41 +02:00
yair
11b279cb08
scripts: rewrite append_signals.py for linescan scrolling video
...
Complete rewrite to properly handle linescan image sequences:
- Stitches linescan images horizontally into wide panorama
- Creates scrolling video that pans left-to-right
- Configurable scroll speed based on capture rate (750 lines/sec)
- Output saved one folder up from image source
- Uses Pillow for image stitching, ffmpeg for video creation
Features:
- --scroll-speed: multiplier for playback speed (1.0 = real-time)
- --lines-per-second: linescan capture rate (default: 750)
- --max-frames: limit frames for testing
- --fps: output video framerate (default: 30)
- --width: viewport width (default: 1920)
- Automatic cleanup of temporary stitched image
Example usage:
# Real-time playback
uv run scripts\append_signals.py results\20251122\bumpy-filter
# 2x speed
uv run scripts\append_signals.py results\20251122\bumpy-filter --scroll-speed 2.0
# Test with 10 frames
uv run scripts\append_signals.py results\20251122\bumpy-filter --max-frames 10
2025-11-22 16:59:26 +02:00
yair
411310e4f1
scripts: add append_signals.py for frame sequence to video conversion
...
Add Python script to concatenate frame sequences into videos using ffmpeg.
Features:
- Handles non-sequential frames with gaps in numbering
- Automatic output naming: {folder_name}_{unix_timestamp}.mp4
- Configurable FPS, width, quality (CRF), and frame limit
- Uses uv inline dependencies for easy execution
- Supports .jpeg, .jpg, and .png files
Example usage:
uv run scripts\append_signals.py results\20251122\bumpy-filter
uv run scripts\append_signals.py results\20251122\bumpy-filter --max-frames 100 --fps 60
2025-11-22 16:50:09 +02:00