darcyai.input.video_file_stream
VideoFileStream Objects
class VideoFileStream(InputStream)
An input stream that reads frames from a video file.
Arguments
- file_name (
str
): The name of the video file to stream. - use_pi_camera (
bool
): Whether or not to use the Raspberry Pi camera. - loop (
bool
): Whether or not to loop the video. Defaults toTrue
. - process_all_frames (
bool
): Whether or not to process all frames. Defaults toTrue
.
Examples
>>> from darcyai.input.video_file_stream import VideoFileStream
>>> video_file_stream = VideoFileStream(file_name="video.mp4",
loop=True,
process_all_frames=True)
stop
def stop() -> None
Stops the video stream.
Examples
>>> from darcyai.input.video_file_stream import VideoFileStream
>>> video_file_stream = VideoFileStream(file_name="video.mp4",
loop=True,
process_all_frames=True)
>>> video_file_stream.stop()
stream
def stream() -> Iterable[VideoStreamData]
Streams the video frames.
Returns
An iterable of VideoStreamData objects.
Examples
>>> from darcyai.input.video_file_stream import VideoFileStream
>>> video_file_stream = VideoFileStream(file_name="video.mp4",
loop=True,
process_all_frames=True)
>>> video_file_stream.stream()