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

How to make it work with IP network camera?? #17

Open
starlord263 opened this issue Jul 17, 2022 · 3 comments
Open

How to make it work with IP network camera?? #17

starlord263 opened this issue Jul 17, 2022 · 3 comments

Comments

@starlord263
Copy link

HI, i tried using it with IP camera RTSP stream but latency is too high, How i can make it work with it??

@Qengineering
Copy link
Owner

I'm afraid you have a common OpenCV problem.
First, determine the cause of your latency. Do you have a fluid video (with a constant -low- latency) when you're showing the frames and not analysing the faces?
In that case, face recognition is slowing down your pipeline, meaning that VideoCapture() cannot read frames as fast as they are being produced over the network. They are gradually queuing up to build in increased latency.
The only solution here is grabbing some frames without recognition after one with face detection.
You get a sequence like | Face - No Face - No Face | Face - No Face - No Face |
The overall process time of the pipeline needs to be at least in sync with the frame rate.

@starlord263
Copy link
Author

starlord263 commented Jul 24, 2022

Hii @Qengineering I tried working with Gstream but still it is unable to detect face on rtsp stream

using this gst-launch-1.0 rtspsrc location=rtsp://root:[email protected]/axis-media/media.amp latency=200 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw, width=640, height=480, format=BGRx ! videoconvert ! appsink drop=true

@Qengineering
Copy link
Owner

@starlord263
Start debugging. Do you have live video when the whole analyse algorithm is commented out?
Once you have a video working, try to detect only the faces. Still comment out the person recognition, blur detecting etc.
Because the code works fine with a Rpi camera, the interaction with the IP camera is causing your problem.
Tip: see https://github.com/Qengineering/GStreamer-1.18.4-RPi_64-bits or https://github.com/Qengineering/Libcamera-OpenCV-RPi-Bullseye-64OS if you can get your camera working without any deep learning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants