Hi
I'm usng a pipeline that contains a filesrc, a decodebin, an appsink and some other elements. What I want to get is the duration of the current element. For this I'm using GstQuery *frameDuration = gst_query_new_duration(GST_FORMAT_DEFAULT); gst_element_query(reinterpret_cast<GstElement *>(m_pipeline), frameDuration); sint64 temp = 0; gst_query_parse_duration(frameDuration, 0, &temp); I have two problems with this approach. First, this works only after I called GstBuffer *buffer = gst_app_sink_pull_buffer(m_appSink); which is very annoying. And the second problem is that it does not work at all if I change the filename of the filesrc: gst_element_set_state(reinterpret_cast<GstElement *>(m_pipeline), GST_STATE_NULL); setProperty(reinterpret_cast<GObject *>(aviSrc), "location", filename); ... The duration is always the same for each new filename. What could I do? Kind Regards Hella Aglaia Mobile Vision GmbH Steffen Roeber Firmware & Tools Treskowstr. 14, D-13089 Berlin Amtsgericht Berlin-Charlottenburg HRB 66976 B Geschäftsführer: Kay Talmi Fon: +49 30 200 04 29– 412 Fax: +49 30 200 04 29– 109 Mail: [hidden email] URL: www.aglaia-gmbh.de URL: www.mobilevision.de Dieses Dokument ist vertraulich zu behandeln. Die Weitergabe sowie Vervielfältigung, Verwertung und Mitteilung seines Inhalts ist nur mit unserer ausdrücklichen Genehmigung gestattet. Alle Rechte vorbehalten, insbesondere für den Fall der Schutzrechtsanmeldung. This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or disclosed without our express permission. All rights reserved, especially the right to apply for protective rights. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Fri, 2012-03-09 at 09:34 +0100, [hidden email] wrote:
> I'm usng a pipeline that contains a filesrc, a decodebin, an appsink > and some other elements. What I want to get is the duration of the > current element. > For this I'm using > GstQuery *frameDuration = gst_query_new_duration(GST_FORMAT_DEFAULT); > gst_element_query(reinterpret_cast<GstElement *>(m_pipeline), > frameDuration); > sint64 temp = 0; > gst_query_parse_duration(frameDuration, 0, &temp); > > I have two problems with this approach. First, this works only after I > called > GstBuffer *buffer = gst_app_sink_pull_buffer(m_appSink); > which is very annoying. > And the second problem is that it does not work at all if I change the > filename of the filesrc: > gst_element_set_state(reinterpret_cast<GstElement *>(m_pipeline), > GST_STATE_NULL); > setProperty(reinterpret_cast<GObject *>(aviSrc), "location", > filename); > ... The duration should be available as soon as appsink (and all other sinks) has queued a buffer internally and the pipeline is prerolled, that is when you receive an ASYNC_DONE message on the bus (or a state change message with new_state==PAUSED and message->src==pipeline). There's no need to actually pull a buffer from appsink. If you just want to read metadata, GstDiscoverer might also be of interest. As for changing filesrc - you should just set up a new filesrc + decodebin2 (decodebin2 needs resetting as well) and remove the old elements when no longer needed. Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hi,
I tried the GstDiscoverer utility. For local files all is fine but files from a network path cannot be discovered. Hella Aglaia Mobile Vision GmbH Steffen Roeber Firmware & Tools Treskowstr. 14, D-13089 Berlin Amtsgericht Berlin-Charlottenburg HRB 66976 B Geschäftsführer: Kay Talmi Fon: +49 30 200 04 29– 412 Fax: +49 30 200 04 29– 109 Mail: [hidden email] URL: www.aglaia-gmbh.de URL: www.mobilevision.de Dieses Dokument ist vertraulich zu behandeln. Die Weitergabe sowie Vervielfältigung, Verwertung und Mitteilung seines Inhalts ist nur mit unserer ausdrücklichen Genehmigung gestattet. Alle Rechte vorbehalten, insbesondere für den Fall der Schutzrechtsanmeldung. This document has to be treated confidentially. Its contents are not to be passed on, duplicated, exploited or disclosed without our express permission. All rights reserved, especially the right to apply for protective rights.
On Fri, 2012-03-09 at 09:34 +0100, [hidden email] wrote: > I'm usng a pipeline that contains a filesrc, a decodebin, an appsink > and some other elements. What I want to get is the duration of the > current element. > For this I'm using > GstQuery *frameDuration = gst_query_new_duration(GST_FORMAT_DEFAULT); > gst_element_query(reinterpret_cast<GstElement *>(m_pipeline), > frameDuration); > sint64 temp = 0; > gst_query_parse_duration(frameDuration, 0, &temp); > > I have two problems with this approach. First, this works only after I > called > GstBuffer *buffer = gst_app_sink_pull_buffer(m_appSink); > which is very annoying. > And the second problem is that it does not work at all if I change the > filename of the filesrc: > gst_element_set_state(reinterpret_cast<GstElement *>(m_pipeline), > GST_STATE_NULL); > setProperty(reinterpret_cast<GObject *>(aviSrc), "location", > filename); > ... The duration should be available as soon as appsink (and all other sinks) has queued a buffer internally and the pipeline is prerolled, that is when you receive an ASYNC_DONE message on the bus (or a state change message with new_state==PAUSED and message->src==pipeline). There's no need to actually pull a buffer from appsink. If you just want to read metadata, GstDiscoverer might also be of interest. As for changing filesrc - you should just set up a new filesrc + decodebin2 (decodebin2 needs resetting as well) and remove the old elements when no longer needed. Cheers -Tim _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |