yolov3workflow icon indicating copy to clipboard operation
yolov3workflow copied to clipboard

AssertionError: Cannot capture source

Open brightbirdapp opened this issue 7 years ago • 3 comments

The webcam and external cam connection demo works well, but I'm getting the follwing error when playing a video (python3 video_demo.py --video gws.mp4)

File "video_demo.py", line 119, in assert cap.isOpened(), 'Cannot capture source' AssertionError: Cannot capture source

Thanks for the series on YT --well done!

brightbirdapp avatar Nov 14 '18 20:11 brightbirdapp

I have the same problem as you. Can you tell me the solution?

silversl avatar Jan 25 '19 04:01 silversl

This is a classic openCV error on "VideoCapture" when it does not found the source (gws.mp4). check if gws.mp4 is in the same folder as video_demoñ.py. You can also look for VideoCapture line and debug what it is getting as source (print value on console). As alternative, you can write your own path in the VideoCapture line and ignore args parameter:

cap = cv2.VideoCapture("birds.mp4")

Hope this helps. Regards

DiegoMartinezGlez avatar Mar 05 '19 12:03 DiegoMartinezGlez

This is a classic openCV error on "VideoCapture" when it does not found the source (gws.mp4). check if gws.mp4 is in the same folder as video_demoñ.py. You can also look for VideoCapture line and debug what it is getting as source (print value on console). As alternative, you can write your own path in the VideoCapture line and ignore args parameter:

cap = cv2.VideoCapture("birds.mp4")

Hope this helps. Regards

Hi, I got the same error when I use the video-file I tried your solution by writing my own path as cap = cv2.VideoCapture("video.mp4") I still got the same error.

bvarmamuppala avatar May 06 '19 00:05 bvarmamuppala