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
Sleep Functionality for Adafruit MacroPad RP2040

Adafruit-MacroPad-RP2040 Sleep Functionality for Adafruit MacroPad RP2040 Details This is a modification of AdaFruit project bundle found here specifi

9 Dec 18, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 03, 2023
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
A Raspberry Pi Pico plant sensor hub coded in Micropython

plantsensor A Raspberry Pi Pico plant sensor hub coded in Micropython I used: 1x Raspberry Pi Pico - microcontroller 1x Waveshare Pico OLED 1.3 - scre

78 Sep 20, 2022
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

1.9k Jan 02, 2023
Terkin is a flexible data logger application for MicroPython and CPython environments.

Terkin Data logging for humans, written in MicroPython. Documentation: https://terkin.org/ Source Code: https://github.com/hiveeyes/terkin-datalogger

hiveeyes 45 Dec 15, 2022
Parametric open source reconstructions of Voron printed parts

The Parametric Voron This repository contains Fusion 360 reconstructions of various printed parts from the Voron printers

Matthew Lloyd 26 Dec 19, 2022
Adafruit IO connected smart thermostat based on CircuitPython.

Adafruit IO Thermostat Adafruit IO connected smart thermostat based on CircuitPython. Background and Motivation I have a 24 V Heat-only system with a

Shubham Chaudhary 1 Jan 18, 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
Automatic Watering System using Soil Moisture Sensor and RTC Timer with Arduino

Automatic-Watering-System - Technical Answers to Real-World Problems. Evolution of Watering Manually to Watering Automatically.

Vaishnavi Pothugunta 4 Dec 31, 2021
a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico

pico_ws2812b a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico You'll first need to save the ws2812b.py file to your device (for

76 Nov 25, 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
Custom component for interacting with Octopus Energy

Home Assistant Octopus Energy ** WARNING: This component is currently a work in progress ** Custom component built from the ground up to bring your Oc

David Kendall 116 Jan 02, 2023
FERM: A Framework for Efficient Robotic Manipulation

Framework for Efficient Robotic Manipulation FERM is a framework that enables robots to learn tasks within an hour of real time training.

Ruihan (Philip) Zhao 111 Dec 31, 2022
A DUCO (Duino-Coin) miner for GigaDevice ARM boards.

GD32 Duino-Coin Miner Description Contains the firmware and miner software for mining DUCO (Duino-Coin) on GigaDevice GD32 chips. Supported boards GD3

Maximilian Gerhardt 2 Feb 20, 2022
This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC

About This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC, issue #56 and f

Philippe Teuwen 28 Nov 21, 2022
This is an incredible led matrix simulation using the ultimate mosaik co-simulation framework.

This project uses the mosaik co-simulation framework, developed by the brilliant developers at the high-ranked Offis institue for computer science, Oldenburg, Germany, to simulate multidimensional LE

Felix 1 Jan 28, 2022
MicroPython driver for 74HC595 shift registers

MicroPython 74HC595 A MicroPython library for 74HC595 8-bit shift registers. There's both an SPI version and a bit-bang version, each with a slightly

Mike Causer 17 Nov 29, 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
Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)

TMorse Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;) Compatible with python3.9+. No third-party library is required

Mahyar 2 Jul 11, 2022