Skip to content

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
None

True 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.