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

Related tags

HardwarePiCameleon
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
Hotplugger: Real USB Port Passthrough for VFIO/QEMU!

Hotplugger: Real USB Port Passthrough for VFIO/QEMU! Welcome to Hotplugger! This app, as the name might tell you, is a combination of some scripts (py

DARKGuy (Alemar) 66 Nov 24, 2022
Raspberry Pi Pico as a Rubber Ducky

Raspberry-Pi-Pico-as-a-Rubber-Ducky Kurulum Raspberry Pi Pico cihazınız için CircuitPython'u indirin. Boot düğmesine basılı tutarken cihazı bir USB ba

Furkan Enes POLATOĞLU 6 Dec 13, 2022
A script for performing OTA update over BLE on ESP32

A script for performing OTA update over BLE on ESP32

Felix Biego 18 Dec 15, 2022
Make your MacOS keyboard brightness fade in and out

Make your MacOS keyboard brightness fade in and out. (It's working depends on the Kbrightness file, which only works for 2015 Macs, so this will only work on 2015 Macs.)

1 Dec 16, 2021
Bucatini: a soft PIPE PHY for FPGA SerDes

Bucatini: a soft PIPE PHY for FPGA SerDes Bucatini is a noodly gateware layer capable of transforming an FPGA SerDes into a PIPE PHY, allowing you to

Great Scott Gadgets 28 Dec 02, 2022
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

5 Apr 27, 2022
Simple Python script to decode and verify an European Health Certificate QR-code

A simple Python script to decode and verify an European Health Certificate QR-code.

Mathias Panzenböck 61 Oct 05, 2022
Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Niklas Ekman 15 Dec 22, 2022
Get the AltAz coordinates for a given object using astropy and output on a OLED screen.

Star Coordinates Get the AltAz coordinates for a given object using astropy and output on a OLED screen. As a very very newcomer to the astronomy scen

Craig Cmehil 1 Jan 31, 2022
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

2.8k Dec 30, 2022
Workshop for student hackathons focused on IoT dev

Scenario: The Mutt Matcher (IoT version) According to the World Health Organization there are more than 200 million stray dogs worldwide. The American

Microsoft 15 Aug 10, 2022
A versatile program that uses the raspberry pi camera and provides it as a service

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

André Esser 52 Oct 16, 2022
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 05, 2022
This OctoPrint plugin will make the initial connection to 3D Hub a breeze

3D Hub Connector This OctoPrint plugin will make the initial connection to 3D Hub a breeze. In future it will help in setting up a tunnel connection a

3D Hub 2 Aug 03, 2022
Huawei Solar sensors for Home Assistant

Huawei Solar Sensors This integration splits out the various values that are fetched from your Huawei Solar inverter into separate HomeAssistant senso

Thijs Walcarius 151 Dec 31, 2022
Various programs in Atari BASIC for #FujiNet for Atari 8-bit

FujiNet Various programs in Atari BASIC for #FujiNet for Atari 8-bit FujiNet-3D Tic Tac Toe In 1978, Scott Adams wrote a 3-D Tic Tac Toe game, for pla

Kay Savetz 2 Jan 01, 2022
The robot is an autonomous small scale racing car using NVIDIA Jetson Nano.

The robot is an autonomous small scale racing car using NVIDIA Jetson Nano. This project utilizes deep learning neural network framework Keras/Tensorflow, together with computer vision library OpenCV

1 Dec 08, 2021
Micropython automatic watering

micropython-automatic-watering micropython automatic watering his code was developed to be used with nodemcu esp8266, but can be modified to work with

1 Nov 24, 2021
🎃 Some spooky code samples to hack yourself a pumpkin 👻

🎃 Tech Or Treat 👻 It's spooky season for those who celebrate Halloween, and to get in the spirit (spirit - get it? 👻 ) we thought it would be fun t

Jim Bennett 5 Feb 07, 2022
🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023