darcyai.input.camera_stream
CameraStream Objects
class CameraStream(InputStream)
An input stream that gets frames from camera.
Arguments
- use_pi_camera (
bool
): Whether or not to use the Raspberry Pi camera. Defaults toFalse
. - video_device (
str
): The video device to use. Defaults toNone
. - video_width (
int
): The width of the video frames. Defaults to640
. - video_height (
int
): The height of the video frames. Defaults to480
. - flip_frames (
bool
): Whether or not to flip the video frames. Defaults toFalse
. - fps (
int
): The frames per second to stream. Defaults to30
.
Examples
>>> from darcyai.input.camera_stream import CameraStream
>>> pi_camera = CameraStream(use_pi_camera=True)
>>> usb_camera = CameraStream(video_device="/dev/video0")
stop
def stop() -> None
Stops the video stream.
Examples
>>> from darcyai.input.camera_stream import CameraStream
>>> usb_camera = CameraStream(video_device="/dev/video0")
>>> usb_camera.stop()
stream
def stream() -> Iterable[VideoStreamData]
Streams the video frames.
Returns
An iterable of VideoStreamData objects.
Examples
>>> from darcyai.input.camera_stream import CameraStream
>>> usb_camera = CameraStream(video_device="/dev/video0")
>>> usb_camera.stream()
get_video_inputs
@staticmethod
def get_video_inputs()
Gets the available video inputs.
Returns
int[]
: A list of strings.
Examples
>>> from darcyai.input.camera_stream import CameraStream
>>> CameraStream.get_video_inputs()