Grab RTSP stream from ip camera

asked 2021-06-08 02:16:10 -0500

Yehor gravatar image

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 video_stream_opencv pkg. However the resource consumption is very high, and I want to check maybe with gscam will be lighter for CPU.

Thanks!

edit retag flag offensive close merge delete

Comments

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

Humpelstilzchen gravatar image Humpelstilzchen  ( 2021-06-09 02:27:52 -0500 )edit

@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

Yehor gravatar image Yehor  ( 2021-06-09 02:56:09 -0500 )edit

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".

clyde gravatar image clyde  ( 2021-06-11 09:46:22 -0500 )edit

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

Yehor gravatar image Yehor  ( 2021-06-23 01:53:41 -0500 )edit

@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.

clyde gravatar image clyde  ( 2021-06-23 12:30:57 -0500 )edit