简体   繁体   中英

How to get image from ip camera rtsp using gstreamer

I am using the following command to get the image from ip camera using gstreamer.

gst-launch-0.10 -v rtspsrc location="rtsp://ipaddress
:554/user=&password=&channel=1&stream=0.sdp?real_stream--rtp-cachi
ng=100" do-timestamp=true is_live=treu timeout=5 ! multipartdemux ! ffmpegcolors
pace ! jpegenc ! filesink location=test.jpeg

But i got only empty file. Kindly help me.

First of all you should use a GStreamer 1.x version, the 0.10 versions are no longer supported and you're missing basically 3+ years of bugfixes, new features and other improvements.

But the problem in your pipeline is that you put the output of rtspsrc to multipartdemux. rtspsrc will output one or more RTP streams that have to be depayloaded, decoded, etc. Not multipart encoded data.

What you probably want is rtspsrc uri=... ! decodebin2 ! ffmpegcolorspace ! jpegenc ! filesink location=test.jpg

Note however that this will not just stop after the first JPEG picture but will append every received frame as JPEG picture to that single file. Use multifilesink instead of filesink if you want to create one file per frame.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM