Raspberry Pi utility scripts — camera tools, GUI control, and other Pi utilities.
pi-scripts/
├── camera/
│ ├── camera.sh # Main camera control (photo, video, stream, motion, timelapse)
│ ├── camera_motion.py # Motion detection with OpenCV + optional web stream
│ └── camera_web_stream.py # MJPEG HTTP stream server
└── gui_control.sh # Start/stop/status for the GUI (lightdm) via VNC
Full-featured camera control script for Raspberry Pi Camera Module v2 (IMX219).
bash camera/camera.sh photo # Quick photo
bash camera/camera.sh photo-hd # Full resolution (3280x2464)
bash camera/camera.sh video 30 # Record 30s
bash camera/camera.sh stream # TCP stream for VLC (port 8554)
bash camera/camera.sh web # HTTP stream for browser (port 8080)
bash camera/camera.sh motion # Motion detection (saves photos)
bash camera/camera.sh motion --web # Motion + live view in browser
bash camera/camera.sh timelapse 10 50 # 50 photos, 10s apart
bash camera/camera.sh list # List captured filesFiles saved in: ~/camera/{photos,videos,timelapse,motion}
Standalone motion detection using OpenCV and picamera2.
python3 camera/camera_motion.py # Default settings
python3 camera/camera_motion.py --web 8080 # With live web stream
python3 camera/camera_motion.py --sensitivity 15 # More sensitive
python3 camera/camera_motion.py --no-save --web # Stream onlySimple MJPEG HTTP stream server. Used internally by camera.sh web.
python3 camera/camera_web_stream.py # Port 8080
python3 camera/camera_web_stream.py 9090 # Custom portControl the graphical environment (lightdm) for VNC access.
bash gui_control.sh on # Start GUI
bash gui_control.sh off # Stop GUI
bash gui_control.sh status # Check if active- Raspberry Pi OS (Bookworm or later)
rpicam-still,rpicam-vid,rpicam-hello(included in rpicam-apps)- Python:
picamera2,opencv-python,numpy lightdm(for gui_control.sh)