Get frames from rtsp video stream
Akash Dhamasia
akash.dhamasia12 at gmail.com
Thu May 26 10:27:33 UTC 2016
Use appsink element to receive the frame and save it in .jpg format using
opencv:
For eg.
GstElement *pipeline = gst_parse_launch ("rtspsrc location=rtsp://address !
YOUR CODEC ! appsink name=sink", &error);
GstElement *sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
GstAppSink *appsink = GST_APP_SINK(sink);
GstSample *sample = gst_app_sink_pull_sample(appsink);
GstBuffer *buffer = gst_sample_get_buffer(sample);
GstMapInfo map;
gst_buffer_map (buffer, &map, GST_MAP_READ);
Mat frame(Size(320, 240), CV_8UC3, (char*)map.data, Mat::AUTO_STEP); if
its a 320x240 size image
imwrite("XYZ.jpg",frame);
On Thu, May 26, 2016 at 3:19 PM, Alexander Soloviev <alexolut at gmail.com>
wrote:
> Hi all.
>
> I'm new to gstreamer. Maybe my question is quite easy or stupid.
>
> I would like to know the easiest way how to get frames from rtsp video
> stream to, for example, store them to files as jpeg/png/bmp etc.
>
> I need to use it from C/C++ code.
>
> Thanks in advance.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160526/a0dcc20c/attachment.html>
More information about the gstreamer-devel
mailing list