Skip to content

Open-Bodycam/recorder-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Bodycam Recorder-Python

Overview

Build for Transparency, for Everyone.

A lightweight, open-source wearable video recorder designed for the OSS bodycam system - Open Bodycam, optimized for constrained hardware.

This repository contains the core recording software used in the Open Bodycam — focused on reliability, simplicity, hackability and the most important, transparency.

Important notice, before continue reading, please make sure you have a Raspberry Pi connected to a working camera module

Installation

Requirements

Following packages are required for the minium OS installations for you to install Open Bodycam recorder.

  • git
  • vim
  • python (3.13 recommended)

Quick install

Run the install.sh to use the quick install.

$ chmod +x ./install.sh
$ ./install.sh

This script will install dependencies and create a virtual environment.

Do you want to install and enable system service (systemd)? [y/N]:

You will also be asked to install and enable system service (optional) with this installation, so the service can be started once the system is booted.

It's a one stop shop for everything.

Manual install

You can also install it manually, so you can have control on everything.

Install required dependencies

Install following headers and build dependencies

  • ffmpeg
  • libcamera-dev
  • python3-libcamera
  • python3-opencv
  • python3-dev
  • python3-kms++
  • libcap-dev

Install libcamera for python

Since it's not available on pypi, we have to install it via apt.

$ sudo apt install python3-libcamera

Install required python packages

Install following python packages

  • click=8.3.1
  • numpy=2.2.6
  • opencv-python=4.12.0.88
  • picamera2=0.3.33

Place the recorder executable

You can place the executable anywhere you want, the default location is /opt/open-bodycam/

$ sudo rsync -av --exclude ".git" . /opt/open-bodycam/

Configure systemd

There's an existing systemd service file under ./install/open-bodycam.service you can edit it as you need.

And copy it to /etc/systemd/system/.

$ sudo cp ./install/open-bodycam.service /etc/systemd/system/

Reload systemd, enable and start the service.

$ sudo systemctl daemon-reexec
$ sudo systemctl daemon-reload
$ sudo systemctl enable open-bodycam.service
$ sudo systemctl start open-bodycam.service

Usage

Usage: python -m obc [OPTIONS]

Options:
  --clip-length INTEGER     Length of each clip's length. Defaults 30.
  --clip-count INTEGER      Maximum stored clips before rotating. Defaults 60.
  --loop-output-dir TEXT    Recording save path. Defaults
                            "./recordings/loops".
  --capture-width INTEGER   Capture (sensor) resolution - width. Defaults
                            2304.
  --capture-height INTEGER  Capture (sensor) resolution - height. Defaults
                            1296.
  --width INTEGER           Process (output) resolution - width. Defaults
                            1280.
  --height INTEGER          Process (output) resolution - height. Defaults 20.
  --fps FLOAT               Frames per second. Defaults 30.0.
  --bitrate INTEGER         Recording bitrate. Defaults 10000000
  --capture-format TEXT     Capture (sensor) format. Defaults "RGB888".
  --help                    Show this message and exit.

Hardware

You can access the Open Bodycam's outer case on our GitHub, the current version is OBC A1

For more hardware information, visit Open Bodycam's official site for the build guide.

About

The recorder software for Open Bodycam

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors