The code for my Raspberry Pi photo booth.
The code for my Raspberry Pi Photo Booth (Version 2)
Build a photo booth (see below)
Connect your Pi and PiCamera
Connect a button to the Pi's GPIO21 and Ground pins.
Install git & pip & pillow (which replaces PIL)
apt update && apt install git python-pip python-imaging
Clone the code:
git clone https://github.com/jibbius/raspberry_pi_photo_booth.git
Install dependencies:
pip install -r requirements.txt
(Or, if you are using python3: python3 -m pip install -r requirements.txt
)
sudo raspi-config
You must have camera connected to avoid the error:
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM) mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1) Traceback (most recent call last): File "./camera.py", line 45, in <module> camera = picamera.PiCamera() File "/usr/local/lib/python2.7/dist-packages/picamera/camera.py", line 431, in __init__ self._init_camera(camera_num, stereo_mode, stereo_decimate) File "/usr/local/lib/python2.7/dist-packages/picamera/camera.py", line 460, in _init_camera "Camera is not enabled. Try running 'sudo raspi-config' " picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
Run:
python ./camera.py
Photos will get saved to photos directory where you can elect to publish them later.
More detailed instructions available on the blog:
jackbarker.com.au/photo-booth/
I am happy for anyone to submit issues and pull requests.
A special thank you to all those who have submitted issues, and pull requests.
camera-config.yaml
, in anticipation of new functionality ("coming soon").This code is free to be used and modified in any manner that you would like.
Attribution is encouraged, but not required.