Skip to content

mirzafahad/realsense-multicam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi Realsense Camera Frame Capture on Jetson Orin

Stream and process frames from up to six Intel Realsense cameras in parallel on an NVIDIA Jetson Orin using Python multiprocessing and shared memory. This project is optimized for edge performance and provides a robust architecture for high-bandwidth vision tasks.

It works effectively with 2 to 6 cameras (I have not tested beyond 6 due to USB port limitations). With 2 cameras, I was able to achieve 30 fps. With 6 cameras, the frame rate dropped to around 5 fps. Your results may vary depending on your setup.

The doc goes behind the scenes.

Hardware Used

  • NVIDIA Jetson Orin.
  • Intel Realsense D405 (x6)

Key Concepts

  • Multiprocessing: Run each camera in a separate process for true parallelism.
  • Shared Memory: Transfer large amount of camera frames without memory duplication.
  • pyrealsense2 Integration: Carefully manage unpicklable objects.
  • Resource Tracker Patch: Fix Python's shared memory leak issue across processes.

Architecture

  • Each camera-frame-producer process captures frames and writes to shared memory.
  • Then pass the shared-memory-metadata to a shared queue.
  • A central consumer process reads the frames from the queue for post-processing (in this example I will simply display the frames).
  • Once a frame is processed, release/unlink the corresponding shared memory.

Setup Instructions

1. Clone the Repository

git clone https://github.com/mirzafahad/realsense-multicam.git
cd realsense-multicam

2. Install Python

You will at least need Python 3.11.8. Check the download section for all the releases.

3. Install Poetry

The project uses Poetry for dependency management. At the time of writing I am using version 1.8.5.

pipx install poetry==1.8.5
poetry --version

4. Install project

If you are already in the project directory then:

poetry install

5. Run the Application

Make sure all Realsense cameras are connected and detected before starting. Update the variable CAMERAS with the camera serial numbers in config.py.

poetry shell
python run -m multicam

References


Author

Find me on LinkedIn. If this helped, feel free to ⭐ the repo!

About

Optimizing Multiple Realsense Camera Streaming on Jetson Orin.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages