seek event in a pipeline with multiple source bins
Natanael Mojica
neithanmo at gmail.com
Fri Jul 8 00:07:53 UTC 2016
I followed this sugestions but I didnt work
>Also just send a SEEK event to the source pad that is connected to the
>input-selector, otherwise you will seek on all of the input-selector
>sources.
the scenario is:
v4l2src ---------->
filesrcbin ------> input-selector--->pipeline----tee ---->autovideosink
------> audiomixer ----->rtmpsink
alsasrc -------->
all video stream are connected to a input-selector, and audio to audiomixer.
alsa and v4l2src have the do-timestamp properties set true. and sinks the
sync property true.
input-selector has the default properties, sync all income streams, the
same for audiomixer.
for seeking I do the follow:
1. add a probe in a src pad of a filesrc bin (the ghos pad connected to a
input-selector) the probe is the type downstream
2. in the callback function, if there a eos event then perform the seek of
type segment
the seek is implemented as follow:
if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_DATA (info)) == GST_EVENT_EOS){
GstSeekFlags seek_flags;
gboolean ret;
gint64 duration;
gst_element_query_duration(v->decoder, GST_FORMAT_TIME, &duration);
seek_flags = GST_SEEK_FLAG_SEGMENT;
gint64 start = 0;
GstEvent *event = gst_event_new_seek(1.0, GST_FORMAT_TIME,
seek_flags,
GST_SEEK_TYPE_SET, start,
GST_SEEK_TYPE_SET, duration);
gst_debug_set_threshold_from_string ("*:6", TRUE);
ret = gst_pad_send_event (v->videosrc, event);
gst_debug_set_threshold_from_string ("*:0", TRUE);
"videosrc" is a src pad connected to a input-selector.
with GST_DEBUG using the functions I can see how the event is sended to all
elements in the bin until qtdemux , see the logs bellow
http://pastebin.com/WzMRv31g
and in the logs:
0:00:53.868032558 21438 0x1fc0c00 DEBUG qtdemux
qtdemux.c:1580:gst_qtdemux_do_seek:<qtdemux1> configuring seek
0:00:53.868058679 21438 0x1fc0c00 DEBUG default
gstsegment.c:317:gst_segment_do_seek: updated segment.base: 42887979166
0:00:53.868082708 21438 0x1fc0c00 INFO default
gstsegment.c:372:gst_segment_do_seek: segment updated: time segment start=0
:00:00.000000000, offset=0:00:00.000000000, stop=0:00:42.902000000,
rate=1,000000,
applied_rate=1,000000, flags=0x08, time=0:00:00.000000000, base=0:00:
42.887979166, position 0:00:00.000000000, duration 0:00:42.902000000
0:00:53.868125630 21438 0x1fc0c00 DEBUG qtdemux
qtdemux.c:1473:gst_qtdemux_perform_seek:<qtdemux1> seeking to 0:00:
00.000000000
and then in the bus there is a segment-done message, but on the
autovideosink if the sink pad which is connected videosrc ghost pad, is
active, the image on the screen is frezze. so I dont now what happen here.
I thing the seek was performed but input-selector or audiomixer has another
time-stamp, and in this case the file is very short(~1:30 min) so, the
time-stamp of the pipeline is
higher. It is correct? what is the error in my implementation?
the source bins are added dinamically in any time. by default the pipeline
begin with alsa and videosrc.
Using gstreamer-1.8 and c++
bellow the attachment with all log info
thanks !!!! (Muchas Gracias)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160707/7cd37382/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seek.log
Type: text/x-log
Size: 383489 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160707/7cd37382/attachment-0001.bin>
More information about the gstreamer-devel
mailing list