Skip to main content

Photobooth app written in Python supporting DSLR, picamera2, webcameras

Project description

Photobooth App

python versions supported 3.9, 3.10, 3.11 rpi, linux and windows platform supported ruff pytest codecov

The photobooth app is written in Python 🐍 and coming along with a modern Vue frontend.

Features - Supported Cameras - Installation - Documentation

😍 Features

  • 📹 camera live preview with shortest delay as possible, permanent video live view in background
  • ⚡️ optimized for speed, live stream hardware accelerated on rpi, cpu load < 20%
  • 🫶 several camera backends supported for high quality stills and livestream
  • 💡 WLED support signaling photo countdown and feedback to the user when the photo is actually taken
  • 🤝 Linux 🐧, Raspberry Pi 🍓 and Windows 🪟 platforms supported

📷 Supported Cameras

The photobooth app's Python backend allows to use different camera types on Linux and Windows platforms:

  • Raspberry Pi Camera Module 1/2/3 (with or without autofocus)
  • Arducam cameras (with or without autofocus)
  • DSLR camera via
    • gphoto2, Linux
    • digicamcontrol, Windows (not yet implemented)
  • webcams (via opencv2 or v4l)

The app controls camera's autofocus, handles led signaling when a photo is taken and streams live video to photobooth.

The booth is made from 3d printed parts, see the documentation ✍ over here. The camera support is mostly ready to use, the frontend is not production ready yet. Use photobooth project as frontend.

💅 Screenshots

frontpage gallery list gallery detail admin center page dashboard admin center page config tab backends admin center page config tab userinterface admin center page status

🔧 Installation

Prerequisites

  • Python 3.9 or later
  • Camera, can be one or two (first camera for stills, second camera for live view)
    • DSLR: gphoto2 on Linux
    • Picamera2: installed and working (test with libcamera-hello)
    • Webcamera: no additional prerequisites, ensure camera is working using native system apps
  • Raspberry Pi Bullseye for Picamera2 or any other linux/windows system
  • Turbojpeg (via apt on linux, manually install on windows)
  • works probably best with 3d printed photobooth and parts listed in the BOM

The photobooth app can be used standalone but is not feature complete yet. Anyway, it integrates well with the fully blown photobooth project, see description below how to achieve integration.

Install via pip

On a fresh Raspberry Pi OS 64bit, run following commands:

sudo apt-get update
sudo apt-get upgrade # system should be up to date

# install some system dependencies
sudo apt-get -y install libturbojpeg0 python3-pip libgl1 python3-picamera2 libgphoto2-dev

# add user to input group for keyboard events
usermod --append --groups tty,input {USERNAME}

# install app
pip install photobooth-app

# create data folder
mkdir ~/photobooth-data
cd ~/photobooth-data

# start app
photobooth

Browse to http://localhost:8000 and see if the app is working properly.

Photobooth command not found

If there is a warning as following during pip installation and photobooth can't start check the PATH variable

WARNING: The script photobooth is installed in '/home/pi/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

See following is fine, might just need a restart after installation because the path .local/bin did not exist before.

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

Install development versions

Stable releases are published at pypi registry. To test the latest development version install directly from git:

pip install git+https://github.com/mgrl/photobooth-app.git@dev

Integrate Photobooth-Project and this Photobooth-App

Following commands have to be set in photobooth project to use this app as streamingserver. Replace http://photobooth by the actual hostname or localhost if on same server.

take_picture_cmd: curl -o "%s" localhost:8000/aquisition/still | echo Done
take_picture_msg: Done
pre_photo_cmd: curl http://photobooth:8000/aquisition/mode/capture
post_photo_cmd: curl http://photobooth:8000/aquisition/mode/preview
preview_url: url("http://photobooth:8000/aquisition/stream.mjpg")
background_defaults: url("http://photobooth:8000/aquisition/stream.mjpg")

📣 Changelog

see separate file: https://github.com/mgrl/photobooth-app/blob/main/LICENSE.md

©️ License

The software is licensed under the MIT license.

🎉 Donation

If you like my work and like to keep me motivated you can buy me a coconut water:

Donate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photobooth_app-0.1.0b4.tar.gz (8.4 MB view hashes)

Uploaded Source

Built Distribution

photobooth_app-0.1.0b4-py3-none-any.whl (8.4 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page