Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

39 lines (32 sloc) 1.11 KB
# import the necessary packages
from .webcamvideostream import WebcamVideoStream
class VideoStream:
def __init__(self, src=0, usePiCamera=False, resolution=(320, 240),
# check to see if the picamera module should be used
if usePiCamera:
# only import the picamera packages unless we are
# explicity told to do so -- this helps remove the
# requirement of `picamera[array]` from desktops or
# laptops that still want to use the `imutils` package
from .pivideostream import PiVideoStream
# initialize the picamera stream and allow the camera
# sensor to warmup = PiVideoStream(resolution=resolution,
# otherwise, we are using OpenCV so initialize the webcam
# stream
else: = WebcamVideoStream(src=src)
def start(self):
# start the threaded video stream
def update(self):
# grab the next frame from the stream
def read(self):
# return the current frame
def stop(self):
# stop the thread and release any resources
You can’t perform that action at this time.