Overview
RTSP Human Capture provides a comprehensive CLI with support for single and multiple streams, configurable detection thresholds, and flexible display options.Basic Usage
Input Source Arguments
Specify one of the following input sources:Single RTSP stream URL to process.Example:
Multiple RTSP stream URLs (space-separated). Each stream is processed in a separate thread with auto-numbered IDs (1, 2, 3, …).Example:
Path to a file containing RTSP URLs, one per line. Lines starting with File format:
# are treated as comments and ignored.Example:Path to an image file for testing the detector. Runs detection on a single image and saves an annotated result with filename Note: This mode does not require an RTSP stream.
test_result_<timestamp>.jpg.Example:Configuration Arguments
Path to configuration file. If not specified, looks for
config.cfg in the current working directory.Example:Detection Parameters
These parameters override values from the config file when specified:Confidence threshold for person detection (0.0 to 1.0). Overrides the
confidence_threshold value from the config file.Higher values = fewer false positives, but may miss some detections.Example:Minimum person bounding box area in pixels. Overrides the
person_area_threshold value from the config file.Filters out very small detections (distant persons or false positives).Example:Process every Nth frame. Overrides the
frame_skip value from the config file.Higher values = faster processing but may miss brief appearances. For a 30 fps stream, --frame-skip 15 means ~2 detections per second.Example:Output Arguments
Required. Save mode for captured person detections.Values:Output location: Files are saved to the directory specified in
image- Save JPEG snapshots when a person enters the framevideo- Record MP4 video clips from entry until exit
config.cfg under [paths] output_dir.Display Arguments
Disable the video display window in single-stream mode (useful for headless servers or recording-only operation).Example:Note: Only applicable when using
--rtsp (single stream).Enable grid display window for multiple streams. Shows all streams in a resizable grid layout.Example:Note: Only applicable when using
--rtsp-list or --rtsp-file (multiple streams).Complete Examples
Single Stream with Display
Single Stream Headless (No Display)
Multiple Streams with Grid Display
Multiple Streams from File
Test with Static Image
Override All Config Values
Exit Codes
| Code | Description |
|---|---|
0 | Success |
1 | Configuration file not found or invalid |
Error Handling
Configuration Errors
If the config file is not found:Input Errors
If no input source is specified:RTSP Connection Errors
If unable to connect to an RTSP stream:Interactive Controls
Single Stream Display
- Press
q- Quit the application
Multiple Stream Grid Display
- Press
q- Stop all streams and quit - Ctrl+C - Gracefully stop all streams
Implementation Reference
The CLI argument parsing is implemented inmain.py:47-76 using Python’s argparse module. Configuration loading happens at main.py:80-94.