Using the valve plugin correctly in a gstreamer pipeline

Bruce Tsai wagamama.tsai at
Thu May 4 01:45:27 UTC 2017

The pipeline state is changed step-by-step, “NULL” -> “READY” -> “PAUSED” -> “PLAYING”.
From my understanding, all sink elements need to be changed to “PAUSED” state then whole pipeline successfully changes to “PAUSED” state.
Normally a “sink” element needs to received one buffer (preroll) to go to “PAUSED” state.
Now there is a “valve” in front of filesink (in your case).
The filesink never receives a buffer so it cannot go to “PAUSED” state.
As a result, the whole pipeline is waiting for filesink to change its state forever.

There are two options to overcome this situation.

1. Do not add filesink in the beginning.
Add filesink only when you want to save video to file and do not forget to not drop in valve.

2. Lock state of filesink by gst_element_set_locked_state(filesink, TRUE);
Then state of filesink is not sync with parent (pipeline).
And you need to change its state manually.

Yi-Lung (Bruce) Tsai
wagamama.tsai at

> On May 3, 2017, at 11:45 PM, xargon <daga_pankaj at> wrote:
> I am trying to use the `valve` plugin to basically block one branch of a
> `tee` in a gstreamer pipeline but this is setting my whole pipeline to
> `PAUSED`. So, what I am doing is basically saving H264 encoded video from my
> camera stream and also displaying it on the screen at the same time.
> I try to use the `valve` plugin to block off a branch as follows;
> However, this basically seems to set the whole pipeline to PAUSED rather
> than just the branch. I was still expecting to see the camera stream on the
> display but that is not the case.
> --
> View this message in context:
> Sent from the GStreamer-devel mailing list archive at
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list