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
Code reimplementation of some papers published in SAIL-Lab

SAIL SAIL-Lab统一代码库 Motivation 创建这个项目的动机最早来源于实验室组内成员相互Debug代码的时候遇到的麻烦。

Jianwen Chen 8 Nov 15, 2022
Samples for robotics, node, python, and bash

RaspberryPi Robot Project Technologies: Render: intent Currently designed to act as programmable sentry.

Martin George 1 May 31, 2022
Isaac Gym Environments for Legged Robots

Isaac Gym Environments for Legged Robots This repository provides the environment used to train ANYmal (and other robots) to walk on rough terrain usi

Robotic Systems Lab - Legged Robotics at ETH Zürich 372 Jan 08, 2023
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 co

Johan Jonk Stenström 3 Sep 08, 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 Home Assistant sensor that tells you what holiday is next

Next Holiday Sensor This sensor tells you what holiday is coming up next. You can use it to set holiday light colors or other scenes. The state of the

Nick Touran 20 Dec 04, 2022
This is a Virtual Keyboard which is simple yet effective to use.

Virtual-Keyboard This is a Virtual KeyBoard which can track finger movements and lets you type anywhere ranging from notepad to even web browsers. It

Jehan Patel 3 Oct 01, 2021
The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments.

The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments. ABR Control provides API's for the Mujoco, CoppeliaSim (formerly known

Applied Brain Research 277 Jan 05, 2023
Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands

Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands ⚠️ This documentation is unofficial and is not

James 106 Dec 31, 2022
ArduinoWaterHeaterIOT - IoT Probe of a solar PV water heating system - Arduino, Python, MQTT, MySQL

ArduinoWaterHeaterIOT IoT Probe of a solar PV water heating system - Arduino, Raspberry Pi, Python, MQTT, MySQL The Arduino sends the AC and DC watts

Jacques Fourie 1 Jan 11, 2022
Home assiatant Custom component: Camera Archiver

Camera archiver Archive your ftp camera meadia files on other ftp with files renaming and event creation. Event can be used for send information to el

1 Jan 06, 2022
A 3rd party Moonraker component to create timelapse of 3D prints.

A 3rd party Moonraker component to create timelapse of 3D prints.

Mainsail-Crew 166 Dec 26, 2022
Play music on Raspberry Pi Pico Without CPU involvement

MicroPython_PIO_Music_DMA Play music on Raspberry Pi Pico Without CPU involvement This is based on PIOBeep (https://github.com/benevpi/pico_pio_buzz)

3 Nov 27, 2022
A simple Picobot project implemented in Python

Python-Picobot A simple Picobot project implemented in Python About Explanation This is my first programming project. Picobot use rules.txt file which

Shayan Shiravani 0 Apr 03, 2022
A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

Jérôme W. 75 Jan 07, 2023
A raspberrypi tools for python

raspberrypi-tools how to install: first clone this project: git clone https://github.com/Ardumine/rpi-tools.git then go to the folder cd rpi-tools and

1 Jan 04, 2022
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Olivér Falvai 61 Dec 29, 2022
This is a python script to grab data from Zyxel NSA310 NAS and display in Home Asisstant as sensors.

Home-Assistant Python Scripts Python Scripts for Home-Assistant (http://www.home-assistant.io) Zyxel-NSA310-Home-Assistant Monitoring This is a python

6 Oct 31, 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
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