Pausing a gstreamer thread made with tee
Tim Müller
tim at centricular.com
Sat Aug 15 02:37:49 PDT 2015
On Fri, 2015-08-14 at 10:24 -0700, lacho.tomov wrote:
Hi,
> I have a gstreamer pipeline that takes video from the webcam and splits it
> into two threads:
> 1) use appsink so I can programmatically edit the captured frames
> 2) saves the video to a file
>
> The pipeline looks like this:
>
> gst-launch-1.0 v4l2src device=/dev/video0 \
> ! tee name=t ! queue ! videoconvert ! videoscale ! appsink name=sink
> caps="video/x-raw,format=RGB,width=800,framerate=15/1" t. \
> ! queue ! video/x-raw,width=800,framerate=15/1 ! jpegenc ! avimux ! filesink
> location=/tmp/output.avi
> I'm using this inside a C++ app.
>
> My problem is that in most of the time I don't need the two threads running
> simultaneously, but only one of them. And in rare cases - need both.
> So I need some way to temporarily pause/stop either the appsink or the video
> saving - in order to save CPU.
>
> I've been looking for such a solution, but no luck so far - is there any way
> to do that?
This should be possible (dynamically adding/removing tee branches as
needed). Did you have any particular problems with that?
You could also use the 'camerabin' element and set your appsink as
"viewfinder-sink" on it and then you can start/stop video recording via
the start-capture/stop-capture action signals.
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
Join us at the GStreamer Conference: 8-9 October 2015 in Dublin, Ireland
More information about the gstreamer-devel
mailing list