Hi My pipeline have multiple video and audio sources of different types, file sources others from webcams, and from tcp client. the sources from a file are the ones for loop, so I need implement a seek to a position 0.****************** ******************* ******************** v4l2srcbin ----------->input-selector1 ******************** ******************* tcpsrc ----------->input-selector1 ******************* ******************* etc ------ ******************* a example of filesrc bin is filesrc location=x ! decodebin ! videofilters ! etc.. ! queue ! "ghost pad linked to a input-selector1" all the pipeline works fine until a filesrc bin finish the read a file and send a eos, and I need the file is playing every time, from begining until the end and from the begining again, every time until the bin will deleted from the aplication thread. I tried add a pad probe with a checking a EOS event, the callback works but the seeking implementation not. (using this example https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-eventsseek.html) then, in the documentation part-seeking : "A seek is performed by sending a seek event to the sink elements of a pipeline. Sending the seek event to a bin will by default forward the event to all sinks in the bin " but the source bin not have a sink element, in the pipeline there is only two sinks using a tee, a autovideosink, and a rtmpsink, but in the seeking i dont want to affect the another sources. Other problem i see, is in the input-selector1, it sync all input stream if I add first the v4l2src, then the file (the sources are added dinamically in any time), the file begin not from the 0 position because input-selector dropped frames for conserve the time stamp from the pipeline. What is the correct way to implement this?? Any suggestions will be appreciated _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Sa, 2016-06-25 at 08:30 -0600, Natanael Mojica wrote:
> > all the pipeline works fine until a filesrc bin finish the read a > file and send a eos, and I need the file is playing every time, from > begining until the end and from the begining again, every time until > the bin will deleted from the aplication thread. Try using SEGMENT seeks for looping. You can find a short example here: https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/test-segment-seeks.c This skips forward with seeks but it can be trivially adjusted to loop the seek segment instead by using different seek positions. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
On Mo, 2016-06-27 at 10:39 +0300, Sebastian Dröge wrote:
> On Sa, 2016-06-25 at 08:30 -0600, Natanael Mojica wrote: > > > > all the pipeline works fine until a filesrc bin finish the read a > > file and send a eos, and I need the file is playing every time, from > > begining until the end and from the begining again, every time until > > the bin will deleted from the aplication thread. > > Try using SEGMENT seeks for looping. You can find a short example here: > https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/test-segment-seeks.c > > This skips forward with seeks but it can be trivially adjusted to loop > the seek segment instead by using different seek positions. input-selector, otherwise you will seek on all of the input-selector sources. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
In reply to this post by Natanael Mojica
Thanks Sebastian I followed your sugestions but I cant get it to work. v4l2src ----------> filesrcbin ------> input-selector--->pipeline----tee ---->autovideosinkalsasrc --------> all video stream are connected to a input-selector, and audio to 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); http://pastebin.com/WzMRv31g 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++ thanks !!!! (Muchas Gracias) _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Natanael Mojica
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. 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 _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel seek.log (512K) Download Attachment |
On Do, 2016-07-07 at 18:07 -0600, Natanael Mojica wrote:
> > 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 If you do a SEGMENT seek after EOS, that's not going to work. A flush is needed to get rid of the EOS flag. The easiest will probably be to just do flushing seeks on the srcpad of your filesrc/demuxer/decoder bin, and to update the pad-offset on that srcpad accordingly. Alternatively you could set an initial correct pad-offset (to the running time of the pipeline when it starts), and then only do SEGMENT seeks. You need to ensure that the first data you receive from there is already based on a SEGMENT seek, i.e. preroll that input and throw away all data, do a SEGMENT/FLUSH seek and only use the data that comes from that seek. At the end you will get a SEGMENT_DONE message (no EOS!) and could then do another SEGMENT/non-FLUSH seek back. Take a look at this example: https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/test-segment-seeks.c It shows how to use SEGMENT seeks in general. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (968 bytes) Download Attachment |
Free forum by Nabble | Edit this page |