Skip to main content

Python driver for USB endoscopes using the supercamera/useeplus protocol (Oasis, Depstech, etc.)

Project description

supercamera

Python driver for USB endoscopes that use the supercamera / useeplus protocol — the cheap endoscopes sold under brands like Oasis, Depstech, and others that only work with the "UseeePlus" mobile app.

These devices don't implement standard UVC, so they won't show up as webcams. This package talks to them directly over USB and gives you JPEG frames or numpy arrays.

Supported devices

USB ID Device name Chip
2ce3:3828 supercamera (Geek szitman) Common
0329:2022 supercamera (variant) Common

Check yours with lsusb (Linux) or system_profiler SPUSBDataType (macOS).

Install

pip install supercamera

For OpenCV/numpy support (.read() returns numpy arrays):

pip install supercamera[opencv]

Usage

Python API

from supercamera import Camera

# Like cv2.VideoCapture
with Camera() as cam:
    ret, frame = cam.read()  # numpy array (BGR), requires opencv
    # or
    jpeg_bytes = cam.read_jpeg()  # raw JPEG, no extra deps

Multiple cameras

from supercamera import Camera, list_devices

list_devices()       # returns list of CameraInfo with bus/address
Camera(index=0)      # first camera
Camera(index=1)      # second camera

Note: these devices often share the same serial number, so use index or bus/address to distinguish them.

CLI

supercamera --list       # list connected cameras
supercamera              # capture one frame
supercamera -n 10        # capture 10 frames
supercamera -i 1         # use second camera
supercamera --show       # live view (requires opencv-python)

Frame validation

from supercamera import is_valid_jpeg
is_valid_jpeg(jpeg_bytes)  # True/False (uses Pillow full decode if available)

OpenCV pipeline example

import cv2
from supercamera import Camera

cam = Camera()
while True:
    ret, frame = cam.read()
    if not ret:
        continue
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    cv2.imshow("endoscope", gray)
    if cv2.waitKey(1) & 0xFF == ord("q"):
        break
cam.release()

How it works

These endoscopes use a proprietary USB protocol (com.useeplus.protocol) instead of UVC. The driver:

  1. Claims USB interfaces, sends magic init (ff 55 ff 55 ee 10) and connect command (bb aa 05 00 00)
  2. Reads bulk USB packets containing JPEG-encoded 640x480 frames
  3. Properly resets the device on disconnect so it's ready for the next session

Resolution is 640x480 regardless of what the product listing claims.

Testing

Plug in one or both cameras, then:

python test_camera.py

Runs: device listing, single capture, 3x reconnect (no replug), OpenCV read, and two-camera simultaneous capture (if two connected).

Platform notes

  • macOS: Works out of the box. No kernel extensions needed.
  • Linux: Works. You may need a udev rule for non-root access:
    echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2ce3", ATTR{idProduct}=="3828", MODE="0666"' | \
      sudo tee /etc/udev/rules.d/99-supercamera.rules
    sudo udevadm control --reload-rules
    
  • Windows: Should work with libusb + Zadig driver. Untested.

Credits

Protocol reverse-engineered by:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supercamera-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supercamera-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file supercamera-0.1.0.tar.gz.

File metadata

  • Download URL: supercamera-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supercamera-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e916a78d0bc29737084a7703aa8bb545353e4f2512c08b584a17647604c18f4d
MD5 8aeb7a561cfcb0cfeb8ccf27c6c73578
BLAKE2b-256 627045de538bf8458629843c82a6e9831137b133cf3be946dfa2ea4ef50a88b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for supercamera-0.1.0.tar.gz:

Publisher: publish.yml on Revise-Robotics/supercamera-endoscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file supercamera-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: supercamera-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supercamera-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21156ede0db786f01f7bbf681732b36b74421a91e659641eee5219f8396cf4a0
MD5 a1cd8926ade85b2ed6b9156c6b4c69e3
BLAKE2b-256 6cd94cd86d3f52d1645717ebd478c88c8f472ac14f24f8c8c7f46eaccab235a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for supercamera-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Revise-Robotics/supercamera-endoscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page