Video Types¶
types
¶
Video streaming types and data structures.
StreamState
¶
Bases: IntEnum
Video stream connection state.
StreamConfig
dataclass
¶
Video stream configuration.
drone_ip
class-attribute
instance-attribute
¶
timeout
class-attribute
instance-attribute
¶
buffer_size
class-attribute
instance-attribute
¶
generate_sdp
¶
Generate SDP content for RTP stream.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local_ip
|
str
|
Local IP address to receive stream on (default 0.0.0.0 for any) |
'0.0.0.0'
|
Returns:
| Type | Description |
|---|---|
str
|
SDP file content string |
Note
Format based on C# Unity app's SDP generation, with required SDP header fields for FFmpeg/PyAV compatibility.
BoundingBox
dataclass
¶
Bounding box for detected object.
Detection
dataclass
¶
Single object detection result.
Frame
dataclass
¶
Video frame with optional detections and metadata.
The frame flows through the callback pipeline, allowing each callback to add detections or modify the image.
detections
class-attribute
instance-attribute
¶
detections: list[Detection] = field(default_factory=list)
draw_detections
¶
Draw detection boxes and labels on a copy of the image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thickness
|
int
|
Line thickness for boxes |
2
|
font_scale
|
float
|
Font scale for labels |
0.6
|
Returns:
| Type | Description |
|---|---|
NDArray[uint8]
|
Annotated image copy |
to_jpeg
¶
Encode frame as JPEG bytes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quality
|
int
|
JPEG quality (0-100) |
85
|
Returns:
| Type | Description |
|---|---|
bytes
|
JPEG encoded bytes |