Robotics StackExchange | Archived questions

Grab RTSP stream from ip camera

Hello,

Have anyone tried to grab the rtsp image stream from ip camera with gstreamer gscam node? And If yes what GSCAM_CONFIG used?

I have successfully grabbed stream with videostreamopencv pkg. However the resource consumption is very high, and I want to check maybe with gscam will be lighter for CPU.

Thanks!

Asked by Yehor on 2021-06-08 02:16:10 UTC

Comments

ok what gstreamer pipeline did you try for gscam? With the rtspsrc element probably?

Asked by Humpelstilzchen on 2021-06-09 02:27:52 UTC

@Humpelstilzchen Hi , yes rtspsrc. I have tried this line:

rtspsrc location=rtsp://admin:Admin2020@192.168.57.201 latency=100 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! autovideosink -- working

Does the node which you have provide stream video? or receive? Because I want to get the video

Asked by Yehor on 2021-06-09 02:56:09 UTC

gscam adds an appsink element to the pipeline, and uses the appsink API to pull image data and publish ROS image messages. I am not sure what you mean by "get the video".

Asked by clyde on 2021-06-11 09:46:22 UTC

@clyde By "get the video", I want exactly what you mentioned. I want grab the stream and publish it to ROS.

Asked by Yehor on 2021-06-23 01:53:41 UTC

@yehor If gst-launch-1.0 rtspsrc location=rtsp://admin:Admin2020@192.168.57.201 latency=100 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! autovideosink works, then this GSCAM_CONFIG should also work: rtspsrc location=rtsp://admin:Admin2020@192.168.57.201 latency=100 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480

To your original question, I don't know how CPU usage compares to video_stream_opencv.

Asked by clyde on 2021-06-23 12:30:57 UTC

Answers