on-internet
← Community

lag while playing video while using opencv?

Stack Overflow ·

so i am using opencv for motion detection, when i use webcam for motion detection the program runs flawlessly but when i use some other video by giving path in Videocapture() function the output lags too much. I know that waitkey() is somewhat responsible for framerate but it doesn't seem to be the case this time .what should i do to solve this issue? this is my code: import cv2 import time import os import time video = cv2.VideoCapture("videofile.mp4") _,frame0 = video.read() frame0 = cv2.cvtColor(frame0,cv2.COLOR_BGR2GRAY) frame0 = cv2.GaussianBlur(frame0,(3,3),1) while video.isOpened(): che

Comments

Sign in or sign up to comment and upvote.

No comments yet.