Class UDPVideoStream â
Methods: â
__init__ â
python
def __init__(
host: str,
port: int,
chunk_size: int = 1324,
timeout: int = 2,
debug=False
)Initializes the UDP video stream.
Params: â
- host: str - The IP address of the UDP server.
- port: int - The port of the UDP server.
- chunk_size: int = 1324 - The size of each UDP packet.
- timeout: int = 2 - The timeout for the socket in seconds.
- debug: Any = False
get_fps â
python
def get_fps()Returns the current FPS of the stream.
Returns: â
python
Optional[float]The FPS as a float, or None if not available.
isOpened â
python
def isOpened()Checks if the stream is open.
Returns: â
python
NoneTrue if the stream is open, False otherwise.
open â
python
def open(
frame_size: robeex_ai_drone_api.video_api.FrameSize = <FrameSize.SIZE_640x480: 8>,
jpeg_quality: int = 45
)Opens the UDP socket and starts the stream.
Params: â
- frame_size:
FrameSize= FrameSize.SIZE_640x480 - The frame size as a FrameSize enum value. - jpeg_quality: int = 45 - The JPEG compression quality (0 to 100).
Returns: â
python
Literal[True]True if the stream is open, Throws otherwise.
read â
python
def read()Reads a frame from the UDP stream.
Returns: â
python
Union[Tuple[Literal[False], Literal[None]], Tuple[Literal[True], Literal[cv2.Mat]]]A tuple (success, frame), where success is a boolean indicating
release â
python
def release()Releases the UDP socket and stops the stream.