How to push a new-segment event for mp4mux?

Grégoire Gentil gregoire at gentil.com
Wed Sep 5 17:13:11 UTC 2018


Hello,


I'm doing a gst_seek event in a pipeline containing a mp4mux and the 
resulting mp4 file is broken  (obviously, if I don't do the seek event, 
the file is OK). I think that the problem is that I need a new segment 
event pushed to the mp4mux element.

gst_element_seek(gstPipeline, 1.0f, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH 
| GST_SEEK_FLAG_KEY_UNIT, GST_SEEK_TYPE_SET, extractStart, 
GST_SEEK_TYPE_SET, extractEnd);

so I have added this:

GstSegment segment;
gst_segment_init(&segment, GST_FORMAT_TIME);
GstIterator *iter = gst_element_iterate_src_pads(gstMp4muxElement);
gst_iterator_foreach (iter, 
(GstIteratorForeachFunction)gst_mp4_push_event, &segment);
gst_iterator_free (iter);

with this function:

static void gst_mp4_push_event(const GValue *vpad, GstSegment *pseg) {
	GstPad *pad = g_value_get_object(vpad);
	gst_pad_push_event(pad, gst_event_new_segment(pseg));
}

so that all the src pads of the mp4mux element are getting the 
new-segment event.

The mp4 file is still broken. What am I doing wrong? Many thanks in advance,

Grégoire



More information about the gstreamer-devel mailing list