-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcam.py
More file actions
28 lines (22 loc) · 785 Bytes
/
cam.py
File metadata and controls
28 lines (22 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from picamera import PiCamera
from time import sleep
camera = PiCamera()
# camera.rotation = 180
# Uncomment that^ if the image is upside down
camera.start_preview()
sleep(10)
# Sleep take arg is seconds, so that's 10 seconds
camera.stop_preview()
# camera.start_preview()
# for i in range(5):
# sleep(5)
# camera.capture('/home/pi/Desktop/image%s.jpg' % i)
# camera.stop_preview()
# Take 5 pictures (one every 5 seconds)^
# camera.start_preview()
# camera.start_recording('/home/pi/video.h264')
# sleep(10)
# camera.stop_recording()
# camera.stop_preview()
# Then playback the video with the terminal icon on pi editor interface and enter 'omxplayer video.h264'
# Camera has a ton of other methods too like resolution, framerate, and annotate_text (there's filters too)