ProgrammingHero1 / security_cam

232 stars 109 forks source link

[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp #2

Open rems02 opened 3 years ago

rems02 commented 3 years ago

If you have this error:

[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

You must replace line 3 cam = cv2.VideoCapture(1) with cam = cv2.VideoCapture(0, cv2.CAP_DSHOW)

ghost commented 3 years ago

Thanks a lot @rems02 Appreciate it!

ElectroCoderEC commented 2 years ago

Yay!. It works perfectly with opencv 4.5.4

MustafaLotfi commented 2 years ago

Thank you but FPS decreases in this way.

Shiro951216 commented 2 years ago

Thank you , i struggle a lot with that error

bcb2020 commented 2 years ago

Thanks for the solution

21dczhang commented 1 year ago

如果你有这个错误:

[WARN:0] 全局 C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB 终止异步回调

您必须将第 3 行替换 cam = cv2.VideoCapture(1)cam = cv2.VideoCapture(0, cv2.CAP_DSHOW)

thanks,this is very useful

AtharvaTaras commented 1 year ago

You do not need cv2.CAP_DSHOW OpenCV will give the async callback warning when you pass a camera into VideoCapture that doesn't exist or is not connected to your computer. cv2.VideoCapture(0) will always use the default camera of your system.

xpshaggy commented 1 year ago

pls I do not know anything about python.. how do you go about changing this cam = cv2.VideoCapture(1) with cam = cv2.VideoCapture(0, cv2.CAP_DSHOW)? can comebody pls help me out here?