New segment and mp4mux

Grégoire Gentil gregoire at gentil.com
Wed Oct 24 19:46:55 UTC 2018



Date: Thu, 11 Oct 2018 14:23:21 -0500 (CDT)
From: killerrats <koreysjunkmail at gmail.com>
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: New segment and mp4mux
Message-ID: <1539285801114-0.post at n4.nabble.com>
Content-Type: text/plain; charset="utf-8"

EOS the pipeline:
gst-launch-1.0 -e filesrc location=%s ! qtdemux name=demux ! queue !
h264parse ! queue ! mpegpsmux name=mux ! filesink location=/tmp/a.mp4
*or*
gst_element_send_event(Pipeline, gst_event_new_eos());
editing the timestamps you can do it this way also:
filesrc location=%s ! qtdemux name=demux ! queue ! identity ! h264parse !
queue ! mpegpsmux name=mux ! filesink location=/tmp/a.mp4
C++:
GstElement* identity = gst_bin_get_by_name(GST_BIN(pipeline),"identity0");
g_signal_connect(identity, "handoff",
G_CALLBACK(identity_handoff),this->pRtspPipeline);
void identity_handoff(GstElement* element, GstBuffer* buffer, gpointer
user_data){	auto pRtspPipe = static_cast<RtspPipeline*>(user_data);	try	{	
GstClockTime now;		GstClockTime base_time;		now =
gst_clock_get_time(gst_element_get_clock(element));		base_time =
gst_element_get_base_time(element);		if (gst_buffer_is_writable(buffer))		
GST_BUFFER_DTS(buffer) = now - base_time;	}	catch (std::exception ex)	{	}}





Even with the identity element and messing the DTS in a good way to 
"align" them, it's not working. Even if I do decodebin ! x264enc instead 
of h264parse (in order to remove anything in the video container), it's 
not working. And even if I do:

start in pause mode
wait for preroll
seek to 0
wait for preroll
playing

it's not working and the mp4 file is not valid.

So there is something else that touches the mp4mux element when there is 
a seek,

Grégoire



More information about the gstreamer-devel mailing list