What is way correct for capture rtsp stream from IP Camera?

asked 2019-04-30 00:17:45 -0600

zebox gravatar image

updated 2019-04-30 00:20:05 -0600

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?

edit retag flag offensive close merge delete

Comments

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

supra56 gravatar imagesupra56 ( 2019-04-30 04:12:39 -0600 )edit
1

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?

zebox gravatar imagezebox ( 2019-04-30 05:29:14 -0600 )edit

You can remove them images/img%03d.png

supra56 gravatar imagesupra56 ( 2019-04-30 06:22:51 -0600 )edit

Do you mean read each png file and then delete it? But I get additional workload to filesystem (write, read and delete operation).

zebox gravatar imagezebox ( 2019-04-30 06:32:34 -0600 )edit

No. I thought you wanted to save file or not.

supra56 gravatar imagesupra56 ( 2019-04-30 07:05:43 -0600 )edit
1

No.I Need capture rtsp stream from camera and then processing it with openCV features.) Anyway, Thanks!

zebox gravatar imagezebox ( 2019-04-30 07:44:23 -0600 )edit

I understood. Fortunately, I'm using python

supra56 gravatar imagesupra56 ( 2019-04-30 08:21:11 -0600 )edit

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.

zebox gravatar imagezebox ( 2019-04-30 08:28:27 -0600 )edit

What is your algorithms are you using? Are you using c++?

supra56 gravatar imagesupra56 ( 2019-04-30 09:00:19 -0600 )edit

I test with example from here: Example

But when I open video from local webcamera (as device 0) app work normally(

zebox gravatar imagezebox ( 2019-04-30 10:10:02 -0600 )edit