Still capture implementation in source plugin

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

Still capture implementation in source plugin

caoxi
I wonder if Gstreamer plugin can do still capture while doing preview at the same time? Or even like smart phones to do preview, video recording and snapshot at the same time?
Reply | Threaded
Open this post in threaded view
|

Re: Still capture implementation in source plugin

Nicolas Dufresne-5


Le 16 avr. 2017 10:52 PM, "caoxi" <[hidden email]> a écrit :
I wonder if Gstreamer plugin can do still capture while doing preview at the
same time? Or even like smart phones to do preview, video recording and
snapshot at the same time?

I have written an experiment with that, and it worked. I added a streaming mode property to the pad, in still mode, you have to call a snapshot action signal to get a frame. That also make per frame settings really easy. We also added burst with start-burt and stop-burst action signal.




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Still-capture-implementation-in-source-plugin-tp4682674.html
Sent from the GStreamer-devel mailing list archive at 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: Still capture implementation in source plugin

caoxi
Thanks, can you help to explain how to trigger the action you mentioned to do snapshot? by calling Gstreamer APIs
Reply | Threaded
Open this post in threaded view
|

Re: Still capture implementation in source plugin

Yi-Lung Tsai
I have done similar feature before.
My method is to get “last-sample” from videosink and then create another pipeline to save that sample to image file.


--
Yi-Lung (Bruce) Tsai





On Apr 18, 2017, at 10:36 AM, caoxi <[hidden email]> wrote:

Thanks, can you help to explain how to trigger the action you mentioned to do
snapshot? by calling Gstreamer APIs



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Still-capture-implementation-in-source-plugin-tp4682674p4682685.html
Sent from the GStreamer-devel mailing list archive at 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: Still capture implementation in source plugin

caoxi
Hi, do you have any examples? I haven't used last-sample before, thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Still capture implementation in source plugin

Nicolas Dufresne-5
In reply to this post by caoxi
Le lundi 17 avril 2017 à 19:36 -0700, caoxi a écrit :
> Thanks, can you help to explain how to trigger the action you
> mentioned to do
> snapshot? by calling Gstreamer APIs

The action signal works like GObject signal, but instead of the object
emiting to the outisde, it's outside that emits the signal to the
object. You can find multiple examples of that kind of signal in
GStreamer code base, here's just one:

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gs
t/insertbin/gstinsertbin.c#n145

Calling an API could look like:

  g_signal_emit_by_name (G_OBJECT (self), "trigger-capture", NULL);

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

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Still capture implementation in source plugin

Yi-Lung Tsai
In reply to this post by caoxi
I use “last-sample” as follows:

GstSample *last = NULL;
g_object_get(my_sink, “last-sample”, &last, NULL);

Then push last sample to “appsrc” with following pipeline.

appsrc ! videoconvert ! capsfilter ! jpegenc ! filesink 

You could emit a signal to push sample to “appsrc” as follows:

GstFlowReturn ret;
g_signal_emit_by_name(appsrc, “push-sample”, last, &ret);

--
Yi-Lung (Bruce) Tsai





On Apr 25, 2017, at 10:10 AM, caoxi <[hidden email]> wrote:

Hi, do you have any examples? I haven't used last-sample before, thanks!



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Still-capture-implementation-in-source-plugin-tp4682674p4682792.html
Sent from the GStreamer-devel mailing list archive at 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