I am looking to limit the segment length sent out by my “filesrc” element in my GStreamer pipeline to .25 seconds. Currently I suspect it to be around 3 seconds considering the latency between modifications I am making on elements in the pipeline after keystrokes and seeing the result displayed to me.
“GstBaseSrc” has a segment property that should do what I am looking to do, and “FileSrc” inherits it, but I can’t seem to get it to take the setting of the property.
I have tried to retrieve, modify, and set the segment duration property like this:
data.source = gst_element_factory_make ("filesrc", "source");
GstSegment segment = {0, 0, 0, 0, 0, 0, 0, 0};
// get segment from file src
g_object_get (G_OBJECT (data.source), "segment", &segment, NULL);
segment.duration = .25*GST_SECOND;
g_object_set (G_OBJECT (data.source), "segment", &segment, NULL);
// gst_base_src_set_format(GST_BASE_SRC(data.source), GST_FORMAT_TIME);
// add elements to pipeline
gst_bin_add_many (GST_BIN (data.pipeline), data.source, data.demuxer, data.decoder, data.videorate, data.encoder, data.muxer, data.sink, NULL);
When I run this code, I get g_object_set_is_valid_property: object class 'GstFileSrc' has no property named 'segment'
Is there a way I am missing to set this value?