Get image buffer from local video stream

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Get image buffer from local video stream

Theuuu
Hello guys,

I'm new to GStreamer and I'm trying to figure out how to extract an image
buffer during a local video stream.

I've seen some posts talking about appsink, but I haven't had a good example
yet.

And I've read this :
https://gstreamer.freedesktop.org/documentation/application-development/advanced/buffering.html#stream-buffering

Can someone help me out ?

Thanks in advance !



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

Gst-Geek
Hi Theuuu,

Can you elaborate on what you actually want ??
Do you want to capture video as Image thumbnails ??

In case if you want image thumb nail then you are refering to wrong
document.

~ Vinod



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

Theuuu
No, I would like to know if there is a way to sequence a video file to
navigate through it by frames.
Afterwards, I'd also like to get the image buffer corresponding to a
specific frame.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

HermannSW
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

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

Le 24 nov. 2017 2:27 PM, "HermannSW" <[hidden email]> a écrit :
multifilesink does what you want:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-multifilesink.html



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

HermannSW
> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

Theuuu
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" <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Get image buffer from local video stream

Martin Vachovski

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 <[hidden email]> on behalf of Théo LAVAUX <[hidden email]>
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" <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel