This repo contains a small PS3 Eye camera library plus a CLI tool for capture/preview. It was made based on madalintat/PS3Eye-Driver-MacOS-Silicon work. The goal was to make it compile and function on latest MacOS.
include/ps3eye_lib.h: public APIsrc/ps3eye_lib.cpp: libusb-based camera implementationsrc/ps3eye_cli.cpp: CLI wrapper (OpenCV preview, capture options)scripts/: helper scripts
- CMake 3.16+
- A C++17 compiler (clang++ or g++)
libusb-1.0(via pkg-config)- OpenCV 4 (only if building the CLI)
- Python 3 +
pybind11(only if building the Python module) - NumPy (required for
Frame.to_numpy()and OpenCV usage)
Default builds the library and the CLI:
cmake -S . -B build
cmake --build buildLibrary-only build (no OpenCV needed):
cmake -S . -B build -DBUILD_CAPTURE=OFF
cmake --build buildPython module build (requires pybind11):
python -m pip install pybind11 numpy
cmake -S . -B build -DBUILD_PYTHON=ON -DCMAKE_PREFIX_PATH="$(python -m pybind11 --cmakedir)"
# add following if using venv
# -DPython_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')"
cmake --build buildOn macOS, USB capture typically requires sudo (or a signed app with USB entitlements).
sudo ./build/ps3eye_cli --format raw--list-devices List detected PS3 Eye devices
--format <raw|debayer> Display mode (default: debayer)
--device <index> Device index (default: 0)
--size <qvga|vga> Frame size (default: qvga)
--fps <n> Frame rate hint (default: 30)
--manual Disable auto gain/exposure/white balance
--gain <0-63> Manual gain value (used with --manual)
--exposure <0-255> Manual exposure value (used with --manual)
--ui-controls Show UI sliders for gain/exposure
--no-fps-overlay Disable FPS overlay
--save-raw <dir> Save raw frames to directory
--duration <sec> Duration for --save-raw (default: 5)
--no-save-config Do not read/write saved settings
--help Show this help message
- The library uses libusb bulk transfers and outputs RAW8 or BGR24 (debayered) frames.
- The CLI is meant for testing and diagnostics; for integrations, use the library API.
- The CLI saves settings to
~/.config/ps3eye_cli.jsonon exit unless--no-save-configis set.
CLI device listing:
sudo ./build/ps3eye_cli --list-devicesCapture a single frame via Python and save to disk:
import ps3eye
import cv2
with ps3eye.Device(0) as dev:
dev.configure(width=640, height=480, fps=30, format="bgr")
dev.set_auto(True)
dev.start_stream(queue_size=2)
frame = dev.read(timeout_ms=1000)
if frame is not None:
img = frame.to_numpy(copy=False)
cv2.imwrite("ps3eye_test.png", img)
dev.stop_stream()After building, ensure the module is on PYTHONPATH (for example, run from the build/ directory or add it to PYTHONPATH).
Example using OpenCV:
import ps3eye
import numpy as np
import cv2
with ps3eye.Device(0) as dev:
dev.configure(width=640, height=480, fps=30, format="bgr")
dev.set_auto(True)
dev.start_stream(queue_size=2)
while True:
frame = dev.read(timeout_ms=1000)
if frame is None:
continue
img = frame.to_numpy(copy=False)
cv2.imshow("ps3eye", img)
if cv2.waitKey(1) & 0xFF == 27:
break
dev.stop_stream()