Skip to main content

devcam

PyPI Python License: MIT

Easy local camera feeds for development and testing. Expose a webcam as HTTP MJPEG or RTSP, with an optional built-in YOLO human detection overlay — all from one command.

Install

pip install devcam

To enable human detection (YOLOv8), install with the vision extra:

# quote the brackets in zsh
pip install 'devcam[vision]'

Quick Start

devcam http            # web UI + MJPEG stream on http://localhost:1080
devcam rtsp            # RTSP stream on rtsp://localhost:8554/cam

Open http://localhost:1080/ to view the live stream, switch cameras, change resolution/FPS, mirror the view, and toggle human detection. Detection is lazy-loaded: the YOLO model only loads when you first enable it.

Usage

devcam {http,rtsp} [--port PORT] [--camera INDEX] [--resolution WxH] [--fps FPS] [--backend {auto,cv2,zed}]
Flag Default Description
protocol (required) http or rtsp
--port 1080 / 8554 Stream port
--camera 0 Camera index
--resolution auto WxH e.g. 1280x720
--fps 30 Capture and stream frame rate
--backend auto auto (ZED first, then OpenCV), cv2 (V4L2/USB), zed (ZED SDK)

HTTP Endpoints

Endpoint Method Description
/ GET Web UI with live viewer and controls
/stream GET Raw MJPEG stream
/snapshot GET Single JPEG frame
/api/status GET Camera state and backend info
/api/cameras GET Available cameras
/api/modes GET Supported resolutions and FPS
/api/config POST Start, stop, mirror, or reconfigure capture

Human Detection Endpoints

Requires devcam[vision]. Without it, streaming works normally and detection endpoints return available: false.

Endpoint Method Description
/api/detection/status GET Detection state, confidence, interval, model loaded
/api/detection/config POST Enable/disable detection and update settings
/api/detection/run GET/POST Run detection on the latest frame

Example:

curl -X POST http://localhost:1080/api/detection/config \
  -H 'Content-Type: application/json' \
  -d '{"enabled":true,"confidence":0.55,"interval_ms":50}'

Detection response:

{
  "human_detected": true,
  "confidence": 0.87,
  "count": 1,
  "latency_ms": 42.1,
  "detections": [
    {"confidence": 0.87, "bbox": [420.0, 160.0, 780.0, 940.0]}
  ]
}

Camera Backends

Backend Description
cv2 OpenCV V4L2 for USB webcams
zed ZED SDK for ZED X / ZED X Mini on Jetson (requires pyzed)
auto (default) Tries ZED first, falls back to OpenCV

Jetson / ZED X Notes

  • If ZED cameras show as "NOT AVAILABLE": sudo systemctl restart zed_x_daemon
  • Resolution opens at the camera's native mode; --resolution downscales in software
  • --fps 5 or --fps 15 recommended for low-bandwidth use cases

RTSP Setup

RTSP requires ffmpeg and mediamtx. One-time setup:

# macOS
brew install ffmpeg && bash setup_mediamtx.sh

# Linux
sudo apt install ffmpeg && bash setup_mediamtx.sh

Then each time:

./mediamtx &             # media server in the background
devcam rtsp

Development

git clone https://github.com/GitAashishG/devcam.git
cd devcam
pip install -e '.[dev,vision]'
python -m pytest tests/ -v

Releases happen automatically when the version in pyproject.toml is bumped and merged to main.

macOS Notes

  • Camera permission: System Settings → Privacy & Security → Camera → Terminal
  • All ports are unprivileged (≥ 1024) — no sudo needed

License

MIT

Metadata

Release files for devcam 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devcam 0.2.1
File Size Uploaded Provenance Actions
devcam-0.2.1.tar.gz 24.6 kB With provenance Details for devcam-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devcam 0.2.1
File Interpreter ABI Platform Actions
devcam-0.2.1-py3-none-any.whl Python 3 none any Details for devcam-0.2.1-py3-none-any.whl

Total release size: 46.2 kB

Release files / devcam-0.2.1.tar.gz

Download URL devcam-0.2.1.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5cbca656f663d03d0205ec66f170d4bf15d19a4823f795838cd09b204f999f50
BLAKE2b-256 checksum
How to use checksums
83bb751fd6c3666b05f26179c3bbd34805a9b7959ba98624560523ef35d604f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.

Transparency log

Release files / devcam-0.2.1-py3-none-any.whl

Download URL devcam-0.2.1-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ea785b33e9585830579ca8f95529da8b3ab4b6ac77627443168bfc2151e5d1b
BLAKE2b-256 checksum
How to use checksums
7059c86da3483d64c7c3ef579670c8a188190e85f55610e5100059dbbfd908d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.

Transparency log

Security for devcam 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for devcam-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page