Skip to main content

IMX Camera Toolkit

IMX Camera Toolkit logo

PyPI 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 is available on PyPI. In your Jetson project, create an environment that can use the system OpenCV build, then install the toolkit:

uv venv --system-site-packages
uv add imx-camera-toolkit

For a local MJPEG browser preview, install the preview extra:

uv add "imx-camera-toolkit[preview]"

For WebRTC and HLS, use production-preview instead:

uv add "imx-camera-toolkit[production-preview]"

On Orin Nano, H.264 encoding requires the system GStreamer x264 plugin because NVENC isn't available. H.265 requires a Jetson with NVENC support. See the production preview documentation for setup details.

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.3

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.3
File Size Uploaded Provenance Actions
imx_camera_toolkit-0.8.3.tar.gz 968.5 kB Without provenance Details for imx_camera_toolkit-0.8.3.tar.gz

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / imx_camera_toolkit-0.8.3.tar.gz

Download URL imx_camera_toolkit-0.8.3.tar.gz
Size 968.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bc47875bba55687d15dc48324db9c89f3d8f171d86740af868e84d760e5c4856
BLAKE2b-256 checksum
How to use checksums
f8d0e14bb2f311ef1a5380d34e2e9e1ae20a8cd9957666678f8594a4306b1163
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":"26.04","id":"resolute","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.3-py3-none-any.whl

Download URL imx_camera_toolkit-0.8.3-py3-none-any.whl
Size 242.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38c1d7756dc2c70f7f7a6cf980f8c4fc82bf414e4463c61092b086213b664163
BLAKE2b-256 checksum
How to use checksums
616bbe612e8ee1b254e5deb218bc31097c55eabb66e9366c4528212f04671f3f
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":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for imx-camera-toolkit 0.8.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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