Skip to main content

Prerequisites

Before running the application, ensure you have the following installed on your system:
  • Python (version 3.x)
  • OpenCV library (cv2)

Setup

Clone the OpenCV Guides repository and open the folder for this guide:

Example Code

You can use the following main.py script to connect to the camera and view the video feed. A critical step when configuring the camera is that the MJPG pixel format must be set before setting the resolution.

Further Information

For additional details, examples in other languages like C++, or troubleshooting, please refer to our GitHub repository.

OpenCV Quickstart Repository

Basic Video Capture, Software Frame Sampling, C++ Code, etc.