A versatile program that uses the raspberry pi camera and provides it as a service

Related tags

Hardware PiCameleon
Overview

PiCameleon

Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

Motivation

The RaspberryPi Camera can only be used by one process at a time. This can be very limiting when you need a camera feed from the camera to be used by many other programs or want to take pictures while some other program is using it.

However the camera has 4 ports that can be used simultaneously by the same process, this feature is exposed by the picamera library.

The feature is leveraged in this project to allow communication with the camera that would be difficult without it such as:

  • requesting multiple streams at multiple qualities
  • send video streams to multiple clients for processing
  • requesting videos to be recorded or pictures to be taken while streaming
  • detect motion continuosly and trigger camera features like snapshot and recording to file or even sending pictures to other services over http

Quick Usage Walkthrough

The program runs according to a configuration.

The configuration is seperated into 3 sections: camera_initialization_options, modes and trigger_responses

The camera_initialization_options is where you can specify the arguments to be passed to the PiCamera object from the picamera library, these are passed directly to the contructor.

The modes is where you can specify the operation modes in which the camera should run. These modes can be found modes folder. One can run the same mode with multiple configurations. The modes also run according to a certain schedule defined by a start and stop cron condition. These schedules can be found in the schedules folder, but you can write your own. The modes also have their own parameters that you can specify in the modes_config section for each instance.

Some modes (such as the motion_detection) can trigger. This means an action can be configured in response to it. The responses can be found in the trigger_responses folder. These have their own configuration section as they can have their own parameters. Some examples from these are record_to_file, snapshot and also triggering external services over http.

Example configurations can be found in the configs folder.

Deployment

Launcing the daemon in a docker container is supported and also recommended. There are two Dockerfiles which only differ in their base image to support the RaspberryPi Zero and all the other versions of the Pi.

For the container to be able to access the camera however it has to run with these special flags: --privileged -v /opt/vc:/opt/vc --env LD_LIBRARY_PATH=/opt/vc/lib.

Full Example:

docker run -d --name picameleon --privileged -v /opt/vc:/opt/vc --env LD_LIBRARY_PATH=/opt/vc/lib -e CONFIG_FILE=stream_server_config.json picameleon:latest

You might also like...
Monorepo for my Raspberry Pi dashboard and GPS satellite listener.
Monorepo for my Raspberry Pi dashboard and GPS satellite listener.

🥧 pi dashboard My blog post: Listening to Satellites with my Raspberry Pi This is the monorepo for my Raspberry Pi dashboard!

KIRI - Keyboard Interception, Remapping, and Injection using Raspberry Pi as an HID Proxy.

KIRI - Keyboard Interception, Remapping and Injection using Raspberry Pi as a HID Proxy. Near limitless abilities for a keyboard warrior. Features Sim

Using a raspberry pi, we listen to the coffee machine and count the number of coffee consumption
Using a raspberry pi, we listen to the coffee machine and count the number of coffee consumption

A typical datarootsian consumes high-quality fresh coffee in their office environment. The board of dataroots had a very critical decision by the end of 2021-Q2 regarding coffee consumption.

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero
E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

E-Ink Magic Calendar that automatically syncs to Google Calendar and runs off a battery powered Raspberry Pi Zero

Automate gate/garage door opening via 433.92MHz emitter with Raspberry Pi, Home Assistant and Homekit.
Automate gate/garage door opening via 433.92MHz emitter with Raspberry Pi, Home Assistant and Homekit.

Automate opening your garage door / gate Summary This project sums up how I automated opening my garage door using a Raspberry PI, a 433Mhz emitter, H

🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7
🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7

rpi-backlight A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display. Note: This GIF was created using the

Home solar infrastructure (with Peimar Inverter) monitoring based on Raspberry Pi 3 B+ using Grafana, InfluxDB, Custom Python Collector and Shelly EM.
Home solar infrastructure (with Peimar Inverter) monitoring based on Raspberry Pi 3 B+ using Grafana, InfluxDB, Custom Python Collector and Shelly EM.

raspberry-solar-mon Home solar infrastructure (with Peimar Inverter) monitoring based on Raspberry Pi 3 B+ using Grafana, InfluxDB, Custom Python Coll

A install script for installing qtile and my configs on Raspberry Pi OS
A install script for installing qtile and my configs on Raspberry Pi OS

QPI OS - Qtile + Raspberry PI OS Qtile + Raspberry Pi OS :) Installation Run this command in the terminal

An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi.
An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi.

An embedded application for toy-car controlling based on Raspberry Pi 3 Model B and AlphaBot2-Pi. This is the source codes of my programming assignmen

Comments
  • test_all.sh result in FAILED messages - related to requested image's platform (linux/amd64) not matching the detected host platform (linux/arm/v7)?

    test_all.sh result in FAILED messages - related to requested image's platform (linux/amd64) not matching the detected host platform (linux/arm/v7)?

    I ran test_all.sh to do a test run of the PiCameleon, but got a ton of ERROR and FAILED messages.

    Camera is already activated and docker file was built using the included Dockerfile.

    Any chance that the errors are caused by requested image's platform (linux/amd64) not matching the detected host platform (linux/arm/v7)? I received the following warning whenever I run test_all.sh WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested

    opened by kyutums 18
  • Streaming access by external browser

    Streaming access by external browser

    Dear friend,

    I have properly installed the docker on PiZero and tested it. However I'm not able to access the mjpg or h264 Picamera streaming output. I'm wondering if it is because I need to map container ports to the external world (and which ones?)

    What is the right procedure to access the server by a browser in order to see the camera streaming in mjpg or rtsp by external application like VLC or equivalent?

    Thx

    question 
    opened by gabeale 10
  • Missing docker file picameleon

    Missing docker file picameleon

    Hi, I have tried to install PiCameleon through docker following the installation guidelines (ref. https://github.com/Esser50K/PiCameleon ) but docker file is not available. Can you please have a look? Thx

    opened by gabeale 4
  • Web streaming along with video capture

    Web streaming along with video capture

    Dear Esser, thank you very much for the example you have provided (30cf7bf). I'm very happy to say that I got it working inside a container! Now I'm trying to add the video recording feature using the "trigger_video_capture.py" example. At the moment I'm not understanding a couple of things as follows:

    1. json_config file is not available in the container: shall I add it?
    2. If so, can I take the example configuration?
    3. "stream_id" in python is set to "stream1" but i don't see if it is recalled somewhere else in the code.
    4. shall I add one instance to picameleon or it is sufficient to concatenate the web_streaming.py with trigger_video_capture.py codes?

    thx in advance for your support. cheers

    question 
    opened by gabeale 11
Releases(picameleon-client-v0.0.2)
Owner
André Esser
I try to code a little bit of everything. The I like to show it off on youtube: https://www.youtube.com/channel/UCBxzOQd2v9wWfiMDrf_RQ7A
André Esser
A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost.

distance sensor cube timer A rubiks cube timer using a distance sensor and a raspberry pi 4, and possibly the pi pico to reduce size and cost. How to

null 3 Feb 21, 2022
This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

This repository hosts the code for Stanford Pupper and Stanford Woofer, Raspberry Pi-based quadruped robots that can trot, walk, and jump.

Stanford Student Robotics 1.2k Dec 25, 2022
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022
Designed a system that can efficiently sort recyclables and transfer them to corresponding bins using Python, a Raspberry Pi, and Quanser Labs.

System for Sorting and Recycling Containers - Project 3 Table of contents Overview The challenge Screenshot My process Built with Code snippets What I

Mit Patel 2 Dec 2, 2022
Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment

Code and build instructions for Snap, a simple Raspberry Pi and LED machine to show you how expensive the electricyty is at the moment. On row of LEDs shows the cost of the hour, the other row the cost of the day.

Johan Jonk Stenström 3 Sep 8, 2022
Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi

Clean Dashboard for Pi-Hole Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi.

Alessio Santoru 104 Dec 14, 2022
A global contest to grow and monitor your own food with Raspberry Pi

growlab A global contest to grow and monitor your own food with Raspberry Pi A capture from phototimer of my seed tray with a wide-angle camera positi

Alex Ellis 442 Dec 23, 2022
A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.

Env-MCRO A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler. (btw this image is a bit outdated, some of the silkscreen

EnviousData 68 Oct 14, 2022
Raspberry Pi Pico and LoRaWAN from CircuitPython

Raspberry Pi Pico and LoRaWAN from CircuitPython Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040-based board using CircuitPython

Alasdair Allan 15 Oct 8, 2022
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

Derek Caelin 59 Oct 24, 2022