A Raspberry-Pi powered photobooth using gPhoto 2.
Python application to build your own photobooth using a Raspberry Pi, gPhoto2 and pygame.
Code started life as https://github.com/reuterbal/photobooth however this fork is an almost complete rewrite with additional features:
- Greatly Improved GUI
- Support for Google Photos Upload
- Support for CUPS Printer
- Support for Light Up Arcade Buttons
- Support for Webcam for improved preview.
The following is required for running this photobooth application. I used the versions given in brackets, others might work just as well.
- Python (2.7.3)
- Pygame (1.9.1)
- Pillow (2.8.1)
- gPhoto (2.5.6 or later) or OpenCV
- Optional: RPi.GPIO (0.5.11)
- Optional: gphoto2-cffi or Piggyphoto
- Optional: Google Drive API - " pip install --upgrade google-api-python-client"
RPi.GPIO is necessary to use external buttons as a trigger but it works just fine without. Triggering is then only possible using 'g' & 'r' key (Context Related).
- Raspberry Pi (Due to improved GUI needs to be raspberry pi 2 or newer)
- Camera supported by gPhoto. I've used a Canon EOS 550D.
- Optional: GPIO PIN TODO
Simply download main.py
or clone the repository and run it.
It opens the GUI, prints the features of the connected camera, e.g.,
$ ./main.py
Abilities for camera : Canon EOS 500D
Serial port support : no
USB support : yes
Capture choices :
: Image
: Preview
Configuration support : yes
Delete selected files on camera : yes
Delete all files on camera : no
File preview (thumbnail) support : yes
File upload support : yes
Available actions:
- Press
q
: Exit the application - Press
g
or GPIO**: does green action (context sensitive) normally an yes/accept/proceed action. - Press
r
or GPIO**: does red action (context sensitive) normally an no/decline/cancel action. - Press GPIO**: Hidden button to disable printer.
- Press GPIO**: Hidden button to disable upload.
All pictures taken are stored in a subfolder of the current working directory, named YYYY-mm-dd
after the current date. Existing files are not overwritten.
A brief description on how to set-up a Raspberry Pi to use this photobooth software.
-
Download latest Raspbian image and set-up an SD-card. You can follow these instruction.
-
Insert the SD-card into your Raspberry Pi and fire it up. Use the
raspi-config
tool that is shown automatically on the first boot to configure your system (e.g., expand partition, change hostname, password, enable SSH, configure to boot into GUI, etc.). -
Reboot and open a terminal. Type
sudo rpi-update
to install the latest software versions. Reboot. -
Run
sudo apt-get update
andsudo apt-get upgrade
to upgrade all installed software. -
Install any additionally required software:
-
Pillow:
sudo apt-get install python-dev python-pip libjpeg8-dev sudo pip install Pillow
-
gPhoto2: Unfortunately, the version in the repositories is too old to work (some USB-bugs), hence one must use Gonzalos installer script
git clone https://github.com/gonzalo/gphoto2-updater sudo gphoto2-updater/gphoto2-updater.sh
To ensure the camera can be controlled properly via USB, remove some files:
sudo rm /usr/share/dbus-1/services/org.gtk.Private.GPhoto2VolumeMonitor.service sudo rm /usr/share/gvfs/mounts/gphoto2.mount sudo rm /usr/share/gvfs/remote-volume-monitors/gphoto2.monitor sudo rm /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
-
Reboot.
-
Clone the Photobooth repository
git clone https://github.com/mattlokes/photobooth
and run
main.py
-
Optional but highly recommended, as it improves performance significantly: install some Python bindings for gPhoto2. gphoto2-cffi can be used.
8.1 Installing gphoto2-cffi: Install cffi
sudo apt-get install libffi6 libffi-dev python-cffi
Download and install gphoto2-cffi for gPhoto2
git clone https://github.com/jbaiter/gphoto2-cffi.git cd gphoto2-cffi python setup.py build sudo python setup.py install