Skip to content

CamGear API

CamGear Functional Block Diagram
CamGear API's generalized workflow

Overview

CamGear supports a diverse range of video streams which can handle/control video stream almost any IP/USB Cameras, multimedia video file format (upto 4k tested), any network stream URL such as http(s), rtp, rtsp, rtmp, mms, etc. In addition to this, it also supports Gstreamer's RAW pipelines and various live video streaming sites like YouTube, Twitch, Dailymotion etc.

CamGear API provides a flexible, high-level multi-threaded wrapper around OpenCV's VideoCapture API with direct access to almost all of its available parameters. It relies on Threaded Queue mode for threaded, error-free and synchronized frame handling.

CamGear internally implements yt_dlp backend class for seamlessly pipelining live video-frames and metadata from various streaming services like YouTube, Twitch, and many more ➶

Helpful Tips

  • If you're already familar with OpenCV library, then see Switching from OpenCV ➶

  • It is advised to enable logging(logging = True) on the first run for easily identifying any runtime errors.

  • You can use framerate class variable to retrieve framerate of the input source. Its usage example can be found here ➶

Usage Examples

After going through CamGear Usage Examples, Checkout more of its advanced configurations here ➶

Parameters

References

FAQs