Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add thread name to filevideostream.py #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions imutils/video/filevideostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@


class FileVideoStream:
def __init__(self, path, transform=None, queue_size=128):
def __init__(self, path, transform=None, queue_size=128, name="FileVideoStream"):
# initialize the file video stream along with the boolean
# used to indicate if the thread should be stopped or not
self.stream = cv2.VideoCapture(path)
self.stopped = False
self.transform = transform

# initialize the thread name
self.name = name

# initialize the queue used to store frames read from
# the video file
self.Q = Queue(maxsize=queue_size)
# intialize thread
self.thread = Thread(target=self.update, args=())
self.thread = Thread(target=self.update, name=self.name, args=())
self.thread.daemon = True

def start(self):
Expand Down