Skip to main content

IMX Camera Toolkit

NVIDIA Jetson Orin JetPack 6.2.3 Python 3.10–3.12 MIT License

IMX Camera Toolkit is a Python library for working with CSI-connected IMX cameras on NVIDIA Jetson. It uses Argus and GStreamer for capture, and can deliver frames to your own processing code or stream them to a browser.

There are two capture paths:

  • Camera returns BGR images for OpenCV and other CPU-side code.
  • GpuCamera exposes NV12/NVMM buffers for CUDA and TensorRT pipelines without converting frames to NumPy images.

Both use latest-frame delivery: if processing falls behind, old frames are skipped instead of piling up in a queue. The library also includes camera controls, diagnostics, and optional MJPEG, WebRTC, and HLS previews. It doesn't bundle inference models or tracking logic.

Hardware and requirements

The current compatibility target is an IMX219-77 on Jetson Orin Nano, using JetPack 6.2.3 at 30 FPS. The documented configurations include BGR/CPU capture with 1080p input and 720p output, and NV12/NVMM GPU capture at 720p or 1080p. GPU support for IMX477 is planned, not yet supported.

You'll need:

  • A compatible Jetson and CSI camera, with NVIDIA Argus and nvarguscamerasrc available
  • Python 3.10–3.12 and uv
  • JetPack's system OpenCV (python3-opencv) with GStreamer support

Keep the system OpenCV build. Installing OpenCV from PyPI in its place can break Jetson camera capture. The virtual environment must have access to system packages.

See camera support and sensor modes for the full compatibility details and hardware validation procedure.

Installation

The package isn't on PyPI yet. In your Jetson project, create an environment that can use the system OpenCV build, then install the pinned release:

uv venv --system-site-packages
uv add "imx-camera-toolkit @ git+https://github.com/bi3lu/imx-camera-toolkit.git@v0.8.0"

For the browser preview, install the preview extra instead:

uv add "imx-camera-toolkit[preview] @ git+https://github.com/bi3lu/imx-camera-toolkit.git@v0.8.0"

WebRTC and HLS use the separate production-preview extra. On Orin Nano, H.264 encoding uses the system GStreamer x264 plugin because NVENC isn't available; H.265 requires a Jetson with NVENC support. The preview documentation covers that setup.

Reading frames

CPU: OpenCV / NumPy

Use Camera when the next step needs a regular BGR image:

from imx_camera_toolkit import Camera, CameraConfig

with Camera(CameraConfig(enable_preview=False)) as camera:
    frame = camera.read(timeout=1.0)

    if frame is not None:
        print(frame.image.shape)

read() gives you the latest available frame, or None if nothing new arrives before the timeout. Passing copy=False avoids an extra CPU copy; it does not make the image a GPU buffer.

GPU: NV12 / NVMM

Use GpuCamera when you want to work with the captured buffer on the GPU:

from imx_camera_toolkit import GpuCamera

with GpuCamera() as camera:
    frame = camera.read(timeout=1.0)

    if frame is not None:
        buffer = frame.payload()  # Use before the next read

These buffers are borrowed from the capture pipeline, so don't keep one after a newer frame arrives. For work on another thread, use subscribe_latest() and release each subscribed GPU frame after processing. Buffer ownership is explained in the CPU/GPU guide.

Preview and diagnostics

With the preview extra installed, you can check the camera and start an MJPEG preview:

uv run imx-camera diagnose --hardware
uv run imx-camera test --backend gpu --frames 30 --timeout 5
uv run imx-camera preview --backend gpu --port 8000

Then open http://localhost:8000/ on the Jetson. The development server binds to 127.0.0.1 by default.

The preview is intended for local use. For remote or production access, use field mode with authentication and TLS; see the deployment guide. Don't expose the unauthenticated development server to the internet.

How it works

A camera instance owns the Argus/GStreamer capture pipeline. CPU and GPU consumers work with the most recent frame rather than a growing queue, so a slow model or browser client won't block capture. Preview encoding runs separately from the raw-frame processing path.

The library handles capture, camera settings, and transport. Your application remains responsible for its models, preprocessing, results, and any higher-level vision logic.

Documentation

Small usage examples are in examples/.

Development

To work on the library itself:

git clone https://github.com/bi3lu/imx-camera-toolkit.git
cd imx-camera-toolkit
uv venv --system-site-packages
uv sync --extra preview --group dev

Run formatting, static checks, and tests with:

uv run black --check .
uv run ruff check .
uv run mypy imx_camera_toolkit tests
uv run pytest tests/unit tests/integration -m "not hardware and not benchmark"

Hardware tests and benchmarks are separate from the regular test suite.

License

MIT © 2026 Jakub Bielecki.

Metadata

Release files for imx-camera-toolkit 0.8.0

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

Source distribution (sdist)

Source distribution for imx-camera-toolkit 0.8.0
File Size Uploaded
imx_camera_toolkit-0.8.0.tar.gz 319.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imx-camera-toolkit 0.8.0
File Interpreter ABI Platform
imx_camera_toolkit-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 575.9 kB

Release files / imx_camera_toolkit-0.8.0.tar.gz

Download URL imx_camera_toolkit-0.8.0.tar.gz
Size 319.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7ca1fc998e051a1c252988d8afe17681c9fa6bf7856aa6d53298dc970c6d5b41
BLAKE2b-256 checksum
How to use checksums
a747677ba1111dab2485f54d01bef0a71104cd6c462288d6fae0c94c20b022dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imx_camera_toolkit-0.8.0-py3-none-any.whl

Download URL imx_camera_toolkit-0.8.0-py3-none-any.whl
Size 256.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6f998d98e0efc0087ceb8734ad82d9b488dd9caf970d9439b5c7969b7cf645f
BLAKE2b-256 checksum
How to use checksums
d3dd780fe520fa2739e7ca4eef59bac3553a9f856ebfe8fdabf375fe2a2da6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.8.2

2 release files

0.8.1

2 release files

This release

0.8.0 This release

2 release files

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