Skip to content

Quick start


10 3


In this illustrator, the different colors of the jumper wires are just to make it easier to distinguish themFor example: from each other.
The order of those colors varies from item to item, so it may not match the one on your hand.
Therefore, instead of its color, you should rely on the position of the wire to correctly connect the jumpers.


Find your corresponding camera in the following two links, and then execute the following command

Software Configuration for Raspberry Pi Native camera


If you can not find your camera, please contact us directly.(

Run PTZ Cameras in Bullseye System

Step 1. Install the OpenCV

sudo apt-get install python3-opencv

Step 2. Download the source code

git clone

Step 3. Run the demo

cd PTZ-Camera-Controller/pyCode


Run PTZ Cameras in Ubuntu

Step 1. Installing dependencies

sudo apt-get update && sudo apt-get upgrade
sudo apt install -y cmake
sudo apt install libyaml-dev
sudo apt install libpng-dev
sudo apt install -y libcamera-dev libepoxy-dev libjpeg-dev libtiff5-dev
sudo apt install -y python3-pip git
sudo pip3 install jinja2
sudo apt install -y libboost-dev
sudo apt install -y libgnutls28-dev openssl libtiff5-dev
sudo apt install -y qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
sudo apt install -y meson
sudo pip3 install pyyaml ply
sudo pip3 install --upgrade meson
sudo apt install -y libglib2.0-dev libgstreamer-plugins-base1.0-dev    
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev
sudo apt-get install python-opencv
sudo apt-get install python3-smbus

Step 2. Compiling libcamera

git clone git://
cd libcamera
meson build --buildtype=release -Dpipelines=raspberrypi -Dipas=raspberrypi -Dv4l2=true -Dgstreamer=enabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=enabled -Ddocumentation=disabled -Dpycamera=enabled
ninja -C build   # use -j 2 on Raspberry Pi 3 or earlier devices
sudo ninja -C build install
#Adding dynamic link libraries to __int_py will not copy successfully
sudo cp -r ~/libcamera/build/src/py/libcamera/ /usr/local/lib/python3.10/dist-packages/
sudo rm /usr/local/lib/python3.10/dist-packages/libcamera/
sudo bash -c 'cat /home/#your account name#/libcamera/build/src/py/libcamera/ >> /usr/local/lib/python3.10/dist-packages/libcamera/'

Step 3. Compiling libcamera-apps

git clone
cd libcamera-apps
mkdir build
cd build
make -j4  # use -j1 on Raspberry Pi 3 or earlier devices
sudo make install
sudo ldconfig # this is only necessary on the first build

Step 4. Compiling python-kms++

git clone
cd kmsxx
git submodule update --init
meson build
sudo ninja -C build install 
sudo cp -r ~/kmsxx/build/py/pykms/ /usr/local/lib/python3.10/dist-packages/
sudo ldconfig

Step 5. picamera2

sudo apt install -y python3-pyqt5 python3-prctl libatlas-base-dev ffmpeg python3-pip
pip3 install numpy --upgrade
pip3 install picamera2

Step 6. Modify configuration file

sudo vi /boot/firmware/config.txt

Find the line where camera_auto_detect is and change it to camera_auto_detect=0

add dtoverlay= at the end of the line

For example:


Step 7. Allow accessing /dev/dma_heap on Ubuntu

# add rule in /etc/udev/rules.d/raspberrypi.rules and add rule
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
# Add user to video group Then reboot
sudo usermod -a -G video $USER 

Step 8. Run project

git clone
cd PTZ-Camera-Controller
sudo python3

Troubleshooting - Lens Shading Calibration