Forums

cv2.VideoCapture

cv2.VideoCapture not working to read video array from web2py static directory not work. my path is str(os.getcwd())+'/applications/cctv/static/videos/success.avi'

Isn't cv2.VideoCapture a library to read from a video camera on the machine where it's running? If so, that won't work on PythonAnywhere -- the server where your code runs doesn't have a camera.

If you're using some kind of clever JavaScript thing that streams stuff from a web browser back to the server, or if I've misunderstood what cv2.VideoCapture does, could you give some more details?

i read frame from video file by using cv2.VideoCapture(filepath) but it return false value to calculate video frame

I see. What happens if you log str(os.getcwd())+'/applications/cctv/static/videos/success.avi' to standard error? That will go into the server log where you can inspect it. Maybe the working directory isn't what you expect it to be?

Yes. How should i take video path?

Sorry, I don't understand.