What is way correct for capture rtsp stream from IP Camera?
Hi! Could you advice right way for capture rtsp stream from network (ip) camera? I use OpenCV 4.1.0 on Windows 10 x64. VS 2017, C++. I rebuilt sources with gstreamer support and try capture stream directly in my app. But I not satisfied of results. One rtsp stream (from VLC) open correctly, but after one minute a get increase delay between realtime video and those which show in my app. Another stream from camera not open at all. Demo rtsp stream from Internet openes, but show empty frames ;(
All of above rtsp samples I also tested in VLC player and they played correctly.
I thinking about use ffmpeg separately for capture rtsp and restream to pipe and then capture it in OpenCV from this pipe. But I doubt what it right way.
Could you explain what I do wrong and advice correct way?
Try this and see if it work or not.
ffmpeg -rtsp_transport tcp -i rtsp://xx:[email protected]:fd/tcp/av0_0 -f image2 -vf fps=fps=1 images/img%03d.png
Yes, it work. I execute this command and .png files been created in images folder. But what do I to do next with this files?
You can remove them
images/img%03d.png
Do you mean read each png file and then delete it? But I get additional workload to filesystem (write, read and delete operation).
No. I thought you wanted to save file or not.
No.I Need capture rtsp stream from camera and then processing it with openCV features.) Anyway, Thanks!
I understood. Fortunately, I'm using python
I detect the issue. I have frame freezing only when I try use analytics features (for example, face detection). If I capturing rtsp and only show it in window all OK.
What is your algorithms are you using? Are you using c++?
I test with example from here: Example
But when I open video from local webcamera (as device 0) app work normally(