1

I have 10 different IP cameras that I need to access in a FLASK server. I would like to know the best way to do that.

Currently, I have a dictionary that uses an ID to map to a VideoCapture object. A client sends the cam ID to the server and the server accesses the video capture object and returns a captured frame via the read function.

So technically I have 10 different objects of VideoCapture. Another method that I have used is, that upon getting camera ID, if the current cam ID is different from the received cam ID, then the video cap object is replaced with a new one.

My question is that is opening 10 video captures at one time fine? My server should be time sensitive. Does opening 10 captures congest the network? If yes then should I stick to the one object approach that always creates a new object on ID change or is there any better way to do this? Thank you.

1 Answer 1

2

The first way you used is OK. For every camera, you should keep one capture object. It will work faster than replacing one capture object with multiple connections. If you open RTSP connection, then it will not congest the network until you start reading frames. So you can go with the first way.

Opening and then releasing one capture object for multiple connections will slow down the speed because in every new connection it needs time to access the camera.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.