/usr/share/doc/gstreamer1.0-doc/manual/html/chapter-clocks.html is in gstreamer1.0-doc 1.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 14. Clocks and synchronization in GStreamer</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="GStreamer Application Development Manual (1.8.0)"><link rel="up" href="part-advanced.html" title="Part III. Advanced GStreamer concepts"><link rel="prev" href="section-interfaces-videooverlay.html" title="The Video Overlay interface"><link rel="next" href="section-buffer-running-time.html" title="Buffer running-time"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. Clocks and synchronization in <span class="application">GStreamer</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="section-interfaces-videooverlay.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced <span class="application">GStreamer</span> concepts</th><td width="20%" align="right"> <a accesskey="n" href="section-buffer-running-time.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="chapter-clocks"></a>Chapter 14. Clocks and synchronization in <span class="application">GStreamer</span></h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="chapter-clocks.html#section-clock-time-types">Clock running-time </a></span></dt><dt><span class="sect1"><a href="section-buffer-running-time.html">Buffer running-time</a></span></dt><dt><span class="sect1"><a href="section-buffer-stream-time.html">Buffer stream-time</a></span></dt><dt><span class="sect1"><a href="section-time-overview.html">Time overview</a></span></dt><dt><span class="sect1"><a href="section-clocks-providers.html">Clock providers</a></span></dt><dt><span class="sect1"><a href="section-clocks-latency.html">Latency</a></span></dt><dd><dl><dt><span class="sect2"><a href="section-clocks-latency.html#section-latency-compensation">Latency compensation</a></span></dt><dt><span class="sect2"><a href="section-clocks-latency.html#section-latency-dynamic">Dynamic Latency</a></span></dt></dl></dd></dl></div><p>
When playing complex media, each sound and video sample must be played in a
specific order at a specific time. For this purpose, GStreamer provides a
synchronization mechanism.
</p><p>
<span class="application">GStreamer</span> provides support for the following use cases:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Non-live sources with access faster than playback rate. This is
the case where one is reading media from a file and playing it
back in a synchronized fashion. In this case, multiple streams need
to be synchronized, like audio, video and subtitles.
</p></li><li class="listitem"><p>
Capture and synchronized muxing/mixing of media from multiple live
sources. This is a typical use case where you record audio and
video from a microphone/camera and mux it into a file for
storage.
</p></li><li class="listitem"><p>
Streaming from (slow) network streams with buffering. This is the
typical web streaming case where you access content from a streaming
server with http.
</p></li><li class="listitem"><p>
Capture from live source and and playback to live source with
configurable latency. This is used when, for example, capture from
a camera, apply an effect and display the result. It is also used
when streaming low latency content over a network with UDP.
</p></li><li class="listitem"><p>
Simultaneous live capture and playback from prerecorded content.
This is used in audio recording cases where you play a previously
recorded audio and record new samples, the purpose is to have the
new audio perfectly in sync with the previously recorded data.
</p></li></ul></div><p>
</p><p>
<span class="application">GStreamer</span> uses a <code class="classname">GstClock</code> object, buffer
timestamps and a SEGMENT event to synchronize streams in a pipeline
as we will see in the next sections.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section-clock-time-types"></a>Clock running-time </h2></div></div></div><p>
In a typical computer, there are many sources that can be used as a
time source, e.g., the system time, soundcards, CPU performance
counters, ... For this reason, there are many
<code class="classname">GstClock</code> implementations available in <span class="application">GStreamer</span>.
The clock time doesn't always start from 0 or from some known value.
Some clocks start counting from some known start date, other clocks start
counting since last reboot, etc...
</p><p>
A <code class="classname">GstClock</code> returns the
<span class="strong"><strong>absolute-time</strong></span>
according to that clock with <code class="function">gst_clock_get_time ()</code>.
The absolute-time (or clock time) of a clock is monotonically increasing.
From the absolute-time is a <span class="strong"><strong>running-time</strong></span>
calculated, which is simply the difference between a previous snapshot
of the absolute-time called the <span class="strong"><strong>base-time</strong></span>.
So:
</p><p>
running-time = absolute-time - base-time
</p><p>
A <span class="application">GStreamer</span> <code class="classname">GstPipeline</code> object maintains a
<code class="classname">GstClock</code> object and a base-time when it goes
to the PLAYING state. The pipeline gives a handle to the selected
<code class="classname">GstClock</code> to each element in the pipeline along
with selected base-time. The pipeline will select a base-time in such
a way that the running-time reflects the total time spent in the
PLAYING state. As a result, when the pipeline is PAUSED, the
running-time stands still.
</p><p>
Because all objects in the pipeline have the same clock and base-time,
they can thus all calculate the running-time according to the pipeline
clock.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="section-interfaces-videooverlay.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="part-advanced.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="section-buffer-running-time.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The Video Overlay interface </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Buffer running-time</td></tr></table></div></body></html>
|