Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processing(opencv) and Streaming multiple IPCamera to the Client #60

Closed
SaddamBInSyed opened this issue Oct 28, 2019 · 6 comments
Closed
Labels
QUESTION ❓ User asked about the working/usage of VidGear APIs. SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!

Comments

@SaddamBInSyed
Copy link

Since I am new to this library, I want someone to help/advise me about How to stream and do process(e.g: detect a face, motion detection etc) the connected multiple IP cameras videos to the web client?

Your Environment

  • VidGear version: latest
  • Branch:
  • Python version: 3.6.8
  • pip version:
  • Operating System and version: rasperry pi 3 and pi4 (4gb)

Please help

@abhiTronix abhiTronix added the QUESTION ❓ User asked about the working/usage of VidGear APIs. label Oct 28, 2019
@abhiTronix
Copy link
Owner

abhiTronix commented Oct 28, 2019

@SaddamBInSyed

  1. To get things started first throughly read NetGear API Wiki which designed to transfer video frames & data synchronously (Pair & Client/Server) as well as asynchronously (Publish/Subscribe) between various interconnecting systems over the network in real-time ZMQ messaging system.
  2. Since New features are as of now haven't available through pypi, therefore, you have to clone and install latest Vidgear as follows:
git clone https://github.com/abhiTronix/vidgear.git
cd vidgear
git checkout testing
sudo pip3 install .
cd
  1. Then, You can use VidGear's exclusive Multi-Server-Mode exclusive designed for NetGear API, for robustly handling Multiple Servers at once, through exclusive Publish/Subscribe (zmq.PUB/zmq.SUB) messaging pattern, thereby providing access to seamless Live Streams across the various device in a network at the same time.

Finally, if something doesn't work for you, report me here. Good luck!

@abhiTronix
Copy link
Owner

@SaddamBInSyed Closing this issue and marked solved. Feel free to reopen if this solution doesn't work for you.

@abhiTronix abhiTronix added the SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! label Oct 29, 2019
@SaddamBInSyed
Copy link
Author

@abhiTronix ,

Thank you so much for your response.

I carefully followed your instructions and output was a success.

I am building a home surveillance security system where many IP cameras used.
So I would like your advice here to use your library in the below requirement.

image

@abhiTronix
Copy link
Owner

abhiTronix commented Oct 29, 2019

@SaddamBInSyed Are all cameras connected directly/physically(i.e. directly by wire) to your local server(i.e. your Jatson Nano) or they are connected to your nano wirelessly? Also, VidGear processes each Video stream separately and optimizes performance via multi-threading, so no problem there.

@SaddamBInSyed
Copy link
Author

@abhiTronix .

Yes, all are IP cameras connected with the POE switch.

Also, If add camera request comes from the Client then I want to start a separate process to process the IP camera stream.

if i use multithreading here Will not be slow down the performance of the server (single process).?

Is there any sample code for Vidgear to process multiple camera streams?

Thank you,

@abhiTronix
Copy link
Owner

@SaddamBInSyed , VidGear can handle any stream or any number of streams you can think of, it is designed for performance video processing.

Also, If add camera request comes from the Client then I want to start a separate process to process the IP camera stream.

Yes, you have to add a few lines of code for every new video stream, it can be easily done by Secure shell a.k.a. SSH into your local server.

if i use multithreading here Will not be slow down the performance of the server (single process).?

Multithreading is a leader when it comes down to performance on separate single process a.k.a threads as long as each thread don't interfere with each other. VidGear takes care that these threads are kept separated as far as possible with the help of performance queues a.k.a deques. So there won't be any performance issue if you're not running multiple instances of the same thread or interfering with any VidGear employed video stream with another python script.

Is there any sample code for Vidgear to process multiple camera streams?

Yep, it's pretty easy. See this example code in my comment, also everything runs synchronized as well. Goodluck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QUESTION ❓ User asked about the working/usage of VidGear APIs. SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Projects
None yet
Development

No branches or pull requests

2 participants