Terminate pipeline after fixed time

Sanchayan Maity sanchayan at sanchayanmaity.net
Fri Jun 11 10:37:43 UTC 2021


Try sending an EOS to the pipeline after your required timeout.

gst_element_send_event (pipeline, gst_event_new_eos ());

Wait for the EOS and then set the pipeline state to NULL.

On 21-06-09 12:27:20, va6996 via gstreamer-devel wrote:
> To be specific, I was looking for advice on how to stop the pipeline
> correctly. If I directly set the pipeline state to null and then terminate,
> the pipeline is set to null but the file size is still 0 bytes (I am trying
> to filesink). Not sure what I'm doing wrong. For reference, here is the
> relevant code:
>
> msg = gst_bus_timed_pop_filtered (bus, 100000000 * GST_MSECOND,
>         GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_ERROR | GST_MESSAGE_EOS |
> GST_MESSAGE_DURATION);
>
> switch (GST_MESSAGE_TYPE (msg)) {
>         case GST_MESSAGE_DURATION:
>             gst_element_set_state (videoCompositor.pipeline,
> GST_STATE_NULL);
>           break;
> }
>
> Full code: (used tutorial boilerplate code) https://pastebin.com/8uusk7q6
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

--
Regards,
Sanchayan.


More information about the gstreamer-devel mailing list