Get image buffer from local video stream

Martin Vachovski Martin.Vachovski at skytek.com
Mon Nov 27 10:24:01 UTC 2017


Hi Herman


>>> Can I get the image data into something like pixel array instead of solid file?

It looks like you can use a


appsink


element. It allows for extracting of data from a pipeline into your app

You can make a pipeline like


autovideosrc ! videoconvert ! video/x-raw,format=rgb,width=640,height=480,framerate=20/1 ! appsink name="appsink_element" emit-signals=true


Then in your app you can register a callback

when a

"new-sample"

signal arrives.


Have a look at the element's documentation

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-appsink.html


Hope that's what you are looking for


Martin


________________________________
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> on behalf of Théo LAVAUX <lavauxtheo at gmail.com>
Sent: Friday, November 24, 2017 7:27 PM
To: Discussion of the development of and with GStreamer
Subject: Re: Get image buffer from local video stream

First of all, I'm actually working under Windows, not Linux.
Second, isn't there a Gstreamer tool that would prevent me from reading the file and seeking the cursor by myself?
Thanks for your response by the way.

Le 24 nov. 2017 19:50, "HermannSW" <hermann at stamm-wilbrandt.de<mailto:hermann at stamm-wilbrandt.de>> a écrit :
> Can I get the image data into something like pixel array instead of solid
file?
>
Others may know.

>From a performance perspective I would store the files of multifilesink
under "/dev/shm", a tmpfs filesystem under many Unix-like OSes (exists even
on Raspbian).

All files will end up in memory which is efficient, but they are paged and
not contiguous.
For getting access to a single of those frames as pixel array in memory you
would have to read them (eg. with fopen/fseek/ftell/fread).
If you do that on a one frame after the other basis, your memory consumption
would be N+1 frames, not bad compared to the N frames memory consumption you
requested.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org<mailto: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/20171127/2d3e9aed/attachment-0001.html>


More information about the gstreamer-devel mailing list