Timestamping buffers with live and non-live sources
Bob Barker
bobbarker278 at gmail.com
Thu Oct 17 23:20:03 CEST 2013
Thanks Sebastian. In your response you talked about "running time" and used
the word "timestamp" but we still have the question:
For live sources: does this mean that if a buffer was captured live at time
1934234.34, the timestamp is also 1934234.34?
Asked another way: With a live source, what is the timestamp of the first
buffer? Zero. Or is it something else? If so, what? From reading the
documentation it sounds like it may be zero but we're not clear.
On Thu, Oct 17, 2013 at 11:50 AM, Sebastian Dröge <slomo at coaxion.net> wrote:
> On Do, 2013-10-17 at 09:31 -0700, Bob Barker wrote:
> > Hi All,
> >
> > We’re new to GStreamer, writing our own elements and trying to understand
> > the implications of these excerpts from the GStreamer Plugin Writers
> Guide:
> >
> > Sec 18.4.1 Non-live source elements
> >
> > “They must choose the timestamps and the values of the SEGMENT event in
> > such a way that the
> >
> > *running-time of the buffer starts from 0.” *
> >
> > Sec 18.4.2 Live Source Elements
> >
> > They must choose the timestamps and the values of the SEGMENT event in
> such
> > a way that the *running-time of the buffer* *matches exactly the
> > running-time of the pipeline clock when the first byte in the buffer was
> > captured.*
> >
> > Questions:
> >
> > -For live sources: does this mean that if a buffer was captured live at
> > time 1934234.34, the timestamp is also 1934234.34?
>
> The timestamp alone is irrelevant here. Important is the relation of the
> timestamp with the configured segment. The running time of every buffer
> should be equivalent to the running time of the clock when the buffer
> was captured. That means that the running time of that buffer should be
> the current clock time (of the current pipeline clock) minus the base
> time of the pipeline.
>
> The running time of the buffer is calculated from the timestamp of the
> buffer and the segment information as is done in the code of
> gst_segment_to_running_time(), basically (for positive rate):
> rtime = segment.base + segment.rate*(timestamp - (segment.start +
> segment.offset))
>
> > -For live sources: When is the base time snapped? When the sensor
> captures
> > the first sample? When the first element retrieves the first sample?
>
> When the element reaches the PLAYING state, so very soon after it is set
> to PLAYING.
>
> > We went through the tutorial at
> >
> > http://docs.gstreamer.com/display/GstSDK/Tutorials
> >
> > and couldn’t find anything explaining this. If there’s some documentation
> > clarifying all this, please point us at it.
>
> That documentation is only targeted at playback use cases from the
> application side (and only for 0.10 anyway). The only documentation I'm
> aware of that contains these things is the design documentation in
> gstreamer/docs/design.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131017/349764e8/attachment.html>
More information about the gstreamer-devel
mailing list