Queries on how to stop and restart GstSplitMuxSink
watertreader at hotmail.com
Tue Apr 5 08:12:25 UTC 2022
I have some queries as with regards to how to stop the GstSplitMuxSink
1. Stopping it. I have split the files to be saved (each of 5 mins). The result is ok for the video files fulfilling the 5 mins interval but the last video (which is less than 5 mins) has size of 0 bytes. Nothing is being saved to it.
I read up the forum to find that I would need to send eos event to the splitmuxsink when I want to stop it. Somehow or rather I could not get it right. Would like some pointers on how to stop (any additional stuff needs to be done
My source code(or pseudo code) below
eos_cb(GstPad *pad, GstPadProbeInfo * info, gpointer user_data)
// blocking codes
while(GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) != GST_EVENT_EOS)
g_print("thread live: pad received eos \n");
/******************* do something ************************/
GstPad* splitMuxPad = gst_element_get_static_pad(records->fsink, "video");
if (!splitMuxPad && !(records->fsink))
g_critical(" Could not obtain the splitmux and records->fsink sinkpad!!\n"); // <---- fails here!
// should i send eos event to splitmuxsink or the pad?
Proceed on detaching other parts of the record bin
2. To start another cycle of recording and stop recording. The "working" method seem to be to destroy or unreference the Splitmuxsink and recreate splitmuxsink upon starting the recording. Is this true? Find it rather strange.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel