Skip to content

Instantly share code, notes, and snippets.

@mjmare
mjmare / gist:8503306
Created January 19, 2014 11:00
Slightly modified example to simulate motion detection and incrementing video file names
import io
import picamera
def detect_motion(camera):
stream = io.BytesIO()
camera.capture(stream, format='jpeg', use_video_port=True)
# Detect motion in the captured image. Presumably one would need a prior
# image here to compare to ... this is left as an exercise for the reader!
from random import randint