Configuration Guide for QPyCam
QPyCam supports configuration files in .ini format, allowing users to define camera settings, inference parameters, RTSP streaming, output file paths, and MQTT communication. Using a configuration file helps streamline command execution by reducing the need to specify multiple command-line options.
Configuration Structure
A typical configuration file consists of the following sections:
[capture] - Camera Input Settings
Defines the camera source and video properties.
[inference] - AI Model Settings (Required for AI-based Detection)
Defines the AI model parameters used for object detection, classification, segmentation, and pose estimation.
[inference]
model = /opt/hrnet_pose_quantized.tflite
labels = /opt/hrnet_pose.labels
detect_type = pose
module = hrnet
threshold = 30
results = 1
delegate = gpu
constants = hrnet,q-offsets=<8.0>,q-scales=<0.0040499246679246426>;
Note
AI-based detection requires specifying key parameters like model, labels, and detect_type.
For quantized models, constants must be provided.
[rtsp] - RTSP Streaming Settings
Defines the RTSP server configuration for streaming video.
[output] - Video Output Settings
Defines the file path for saving recorded videos.
[mqtt] - MQTT Communication Settings
Defines MQTT broker settings for publishing AI detection results.
Usage
To use a configuration file with qpycam commands, specify it with the -c or --config option:
This method works for qpycam-hello, qpycam-record, qpycam-rtsp, and qpycam-detect, allowing for a consistent setup across different functionalities.