Can the "sync" "server / client" feature be used with picamera2?So, once the new Pi5 gets here I'm going to be implementing stereo sync from scratch. Please correct any steps.
1. modify the config file:
camera_auto_detect=0
[ALL]
dtoverlay=imx378,camera0
dtoverlay=imx378,camera1
2. Follow instructions of Rpi-cam "synch" branch:
https://github.com/raspberrypi/libcamera/tree/sync
sudo apt install -y python3-pip git python3-jinja2
sudo apt install -y libboost-dev
sudo apt install -y libgnutls28-dev openssl libtiff-dev pybind11-dev
sudo apt install -y qtbase5-dev libqt5core5a libqt5widgets5
sudo apt install -y meson cmake
sudo apt install -y python3-yaml python3-ply
sudo apt install -y libglib2.0-dev libgstreamer-plugins-base1.0-dev
git clone https://github.com/raspberrypi/libcamera.git
cd libcamera
meson setup build --buildtype=release -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=true -Dgstreamer=enabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=disabled -Ddocumentation=disabled -Dpycamera=enabled
ninja -j 1 -C build install
3. Rebuild rpicam-apps to support the new "sync" option:
"Build libcamera and rpicam-apps"
https://www.raspberrypi.com/documentati ... tware.html
4. Run my python script with the "--sync client" and "--sync server" options added:Question: do I need to keep the git files and folders (Raspicam-apps folder, etc ) or can I delete them?Code:
def record_camera0(camera_index, output_file): libcamera_cmd = [ "libcamera-vid", "--sync client", "--exp","sport", "--vflip", "--hflip", "-b", str(bitrate), "-t", str(record_time * 1000), # Convert seconds to milliseconds "-o", output_file, "--width", str(width), "--height", str(height), "--framerate", str(fps), "--camera", str(camera_index) ] subprocess.run(libcamera_cmd)def record_camera1(camera_index, output_file): libcamera_cmd = [ "libcamera-vid", "--sync server", "--exp","sport", "--vflip", "--hflip", "-b", str(bitrate), "-t", str(record_time * 1000), # Convert seconds to milliseconds "-o", output_file, "--width", str(width), "--height", str(height), "--framerate", str(fps), "--camera", str(camera_index) ] subprocess.run(libcamera_cmd)# Record from both cameras in paralleldef record_both_cameras(): thread1 = threading.Thread(target=record_camera0, args=(0, mp4_output1)) # First camera thread2 = threading.Thread(target=record_camera1,args=(1, mp4_output2)) # Second camera
(I don't know if the Rpi-apps folder apps become the one's used by the system)
Question: where is this "rpi.sync" file located?
Statistics: Posted by MRV — Sat Oct 19, 2024 5:13 am