• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Makefile.amH A D19-Apr-20194.6 KiB229222

Makefile.inH A D03-May-2022177 KiB2,3472,151

READMEH A D19-Apr-201917.4 KiB399307

TODOH A D19-Apr-2019379 169

dboolhuff.LICENSEH A D19-Apr-20191.5 KiB3024

dboolhuff.cH A D19-Apr-20192.1 KiB7453

dboolhuff.hH A D19-Apr-20194.3 KiB15698

fnv1hash.cH A D19-Apr-20191.6 KiB6429

fnv1hash.hH A D19-Apr-20191.2 KiB3711

gstasteriskh263.cH A D19-Apr-20196.5 KiB231153

gstasteriskh263.hH A D19-Apr-20191.9 KiB6633

gstrtp.cH A D19-Apr-201910.4 KiB434312

gstrtpL16depay.cH A D03-Dec-20198.5 KiB298202

gstrtpL16depay.hH A D19-Apr-20192.1 KiB6833

gstrtpL16pay.cH A D19-Apr-20198.2 KiB264182

gstrtpL16pay.hH A D19-Apr-20191.9 KiB6432

gstrtpL24depay.cH A D19-Apr-20197.7 KiB265178

gstrtpL24depay.hH A D19-Apr-20192.1 KiB6833

gstrtpL24pay.cH A D19-Apr-20197.3 KiB245163

gstrtpL24pay.hH A D19-Apr-20191.9 KiB6432

gstrtpL8depay.cH A D19-Apr-20197.8 KiB268176

gstrtpL8depay.hH A D19-Apr-20192 KiB6633

gstrtpL8pay.cH A D19-Apr-20197.3 KiB245162

gstrtpL8pay.hH A D19-Apr-20191.9 KiB6532

gstrtpac3depay.cH A D19-Apr-20195.3 KiB181104

gstrtpac3depay.hH A D19-Apr-20191.8 KiB5929

gstrtpac3pay.cH A D19-Apr-201912.6 KiB478322

gstrtpac3pay.hH A D19-Apr-20191.9 KiB6534

gstrtpamrdepay.cH A D19-Apr-201913.7 KiB479289

gstrtpamrdepay.hH A D19-Apr-20192.2 KiB7845

gstrtpamrpay.cH A D19-Apr-201913.4 KiB464295

gstrtpamrpay.hH A D19-Apr-20192 KiB7139

gstrtpbvdepay.cH A D19-Apr-20195.5 KiB191131

gstrtpbvdepay.hH A D19-Apr-20191.8 KiB6130

gstrtpbvpay.cH A D19-Apr-20196.9 KiB240166

gstrtpbvpay.hH A D19-Apr-20191.8 KiB6130

gstrtpceltdepay.cH A D19-Apr-20198.1 KiB277199

gstrtpceltdepay.hH A D19-Apr-20191.6 KiB5530

gstrtpceltpay.cH A D19-Apr-201913.6 KiB503366

gstrtpceltpay.hH A D19-Apr-20191.8 KiB6334

gstrtpchannels.cH A D19-Apr-20198.4 KiB311200

gstrtpchannels.hH A D19-Apr-20191.8 KiB4720

gstrtpdvdepay.cH A D19-Apr-201912.7 KiB426289

gstrtpdvdepay.hH A D19-Apr-20191.9 KiB6734

gstrtpdvpay.cH A D19-Apr-201911.7 KiB398286

gstrtpdvpay.hH A D19-Apr-20191.9 KiB7037

gstrtpg722depay.cH A D19-Apr-20197.2 KiB263183

gstrtpg722depay.hH A D19-Apr-20192 KiB6531

gstrtpg722pay.cH A D19-Apr-20196.9 KiB237167

gstrtpg722pay.hH A D19-Apr-20191.8 KiB6231

gstrtpg723depay.cH A D19-Apr-20195.7 KiB224147

gstrtpg723depay.hH A D19-Apr-20191.8 KiB6029

gstrtpg723pay.cH A D19-Apr-20198.6 KiB308210

gstrtpg723pay.hH A D19-Apr-20191.9 KiB6533

gstrtpg726depay.cH A D19-Apr-201912 KiB394281

gstrtpg726depay.hH A D19-Apr-20191.8 KiB5933

gstrtpg726pay.cH A D19-Apr-201913 KiB423295

gstrtpg726pay.hH A D19-Apr-20191.7 KiB5631

gstrtpg729depay.cH A D19-Apr-20195.9 KiB226150

gstrtpg729depay.hH A D19-Apr-20191.8 KiB6229

gstrtpg729pay.cH A D19-Apr-201911.8 KiB397277

gstrtpg729pay.hH A D19-Apr-20192 KiB6735

gstrtpgsmdepay.cH A D19-Apr-20194.6 KiB153102

gstrtpgsmdepay.hH A D19-Apr-20191.8 KiB5929

gstrtpgsmpay.cH A D19-Apr-20195.3 KiB182120

gstrtpgsmpay.hH A D19-Apr-20191.8 KiB6029

gstrtpgstdepay.cH A D19-Apr-201916.2 KiB635467

gstrtpgstdepay.hH A D19-Apr-20192 KiB6735

gstrtpgstpay.cH A D19-Apr-201919.9 KiB693484

gstrtpgstpay.hH A D19-Apr-20192.1 KiB7441

gstrtph261depay.cH A D19-Apr-20198.7 KiB295197

gstrtph261depay.hH A D19-Apr-20191.9 KiB6133

gstrtph261pay.cH A D19-Apr-201929.7 KiB1,072862

gstrtph261pay.hH A D19-Apr-20193.6 KiB10164

gstrtph263depay.cH A D19-Apr-201913.6 KiB448298

gstrtph263depay.hH A D19-Apr-20192.1 KiB6735

gstrtph263pay.cH A D19-Apr-201954.1 KiB1,8701,403

gstrtph263pay.hH A D19-Apr-201913.9 KiB416300

gstrtph263pdepay.cH A D19-Apr-201911.4 KiB404278

gstrtph263pdepay.hH A D19-Apr-20191.9 KiB6332

gstrtph263ppay.cH A D19-Apr-201926.1 KiB815568

gstrtph263ppay.hH A D19-Apr-20192.1 KiB7139

gstrtph264depay.cH A D19-Apr-201940.7 KiB1,368980

gstrtph264depay.hH A D19-Apr-20192.5 KiB9049

gstrtph264pay.cH A D19-Apr-201942.4 KiB1,4491,017

gstrtph264pay.hH A D19-Apr-20192.5 KiB9656

gstrtph265depay.cH A D19-Apr-201953 KiB1,6541,169

gstrtph265depay.hH A D19-Apr-20193.2 KiB11774

gstrtph265pay.cH A D19-Apr-201943.9 KiB1,4561,015

gstrtph265pay.hH A D19-Apr-20192.3 KiB7946

gstrtph265types.hH A D19-Apr-20192.4 KiB7744

gstrtpilbcdepay.cH A D19-Apr-20196.8 KiB238170

gstrtpilbcdepay.hH A D19-Apr-20191.9 KiB6634

gstrtpilbcpay.cH A D19-Apr-20196.7 KiB229162

gstrtpilbcpay.hH A D19-Apr-20191.8 KiB6130

gstrtpj2kcommon.hH A D19-Apr-20193 KiB10339

gstrtpj2kdepay.cH A D19-Apr-201919.2 KiB668467

gstrtpj2kdepay.hH A D19-Apr-20192.1 KiB7341

gstrtpj2kpay.cH A D19-Apr-201917.3 KiB570378

gstrtpj2kpay.hH A D19-Apr-20191.8 KiB5931

gstrtpjpegdepay.cH A D19-Apr-201923.9 KiB800565

gstrtpjpegdepay.hH A D19-Apr-20192.1 KiB7138

gstrtpjpegpay.cH A D19-Apr-201927.2 KiB1,007714

gstrtpjpegpay.hH A D19-Apr-20191.9 KiB6434

gstrtpklvdepay.cH A D19-Apr-201911.3 KiB398262

gstrtpklvdepay.hH A D19-Apr-20192.1 KiB6634

gstrtpklvpay.cH A D19-Apr-20196 KiB205121

gstrtpklvpay.hH A D19-Apr-20191.9 KiB6130

gstrtpmp1sdepay.cH A D19-Apr-20194.2 KiB14496

gstrtpmp1sdepay.hH A D19-Apr-20191.9 KiB5930

gstrtpmp2tdepay.cH A D19-Apr-20196.9 KiB244167

gstrtpmp2tdepay.hH A D19-Apr-20191.9 KiB6131

gstrtpmp2tpay.cH A D19-Apr-20197 KiB238159

gstrtpmp2tpay.hH A D19-Apr-20191.9 KiB6533

gstrtpmp4adepay.cH A D19-Apr-201913.6 KiB467326

gstrtpmp4adepay.hH A D19-Apr-20191.9 KiB6534

gstrtpmp4apay.cH A D19-Apr-201912.7 KiB465316

gstrtpmp4apay.hH A D19-Apr-20191.9 KiB6635

gstrtpmp4gdepay.cH A D19-Apr-201927 KiB811543

gstrtpmp4gdepay.hH A D19-Apr-20192.4 KiB8952

gstrtpmp4gpay.cH A D19-Apr-201918.4 KiB641417

gstrtpmp4gpay.hH A D19-Apr-20192.1 KiB7341

gstrtpmp4vdepay.cH A D19-Apr-20196.5 KiB228155

gstrtpmp4vdepay.hH A D19-Apr-20191.9 KiB6231

gstrtpmp4vpay.cH A D19-Apr-201917.7 KiB633443

gstrtpmp4vpay.hH A D19-Apr-20192.2 KiB7540

gstrtpmpadepay.cH A D19-Apr-20195.4 KiB182119

gstrtpmpadepay.hH A D19-Apr-20191.8 KiB5929

gstrtpmpapay.cH A D19-Apr-20199.8 KiB344232

gstrtpmpapay.hH A D19-Apr-20191.9 KiB6433

gstrtpmparobustdepay.cH A D19-Apr-201925.1 KiB812600

gstrtpmparobustdepay.hH A D19-Apr-20192.5 KiB7941

gstrtpmpvdepay.cH A D19-Apr-20196 KiB199124

gstrtpmpvdepay.hH A D19-Apr-20191.8 KiB5929

gstrtpmpvpay.cH A D19-Apr-20199.4 KiB336229

gstrtpmpvpay.hH A D19-Apr-20191.9 KiB6533

gstrtpopusdepay.cH A D19-Apr-20194.9 KiB161112

gstrtpopusdepay.hH A D19-Apr-20191.9 KiB6028

gstrtpopuspay.cH A D27-Aug-20197.8 KiB263193

gstrtpopuspay.hH A D19-Apr-20191.8 KiB6129

gstrtppcmadepay.cH A D19-Apr-20194.9 KiB165111

gstrtppcmadepay.hH A D19-Apr-20191.6 KiB5429

gstrtppcmapay.cH A D19-Apr-20193.8 KiB11773

gstrtppcmapay.hH A D19-Apr-20191.6 KiB5529

gstrtppcmudepay.cH A D19-Apr-20194.9 KiB166112

gstrtppcmudepay.hH A D19-Apr-20191.6 KiB5429

gstrtppcmupay.cH A D19-Apr-20193.8 KiB11773

gstrtppcmupay.hH A D19-Apr-20191.6 KiB5529

gstrtpqcelpdepay.cH A D19-Apr-201911.2 KiB433294

gstrtpqcelpdepay.hH A D19-Apr-20191.9 KiB6332

gstrtpqdmdepay.cH A D19-Apr-201912.3 KiB415301

gstrtpqdmdepay.hH A D19-Apr-20192.4 KiB8648

gstrtpreddec.cH A D19-Apr-201917.9 KiB545398

gstrtpreddec.hH A D19-Apr-20191.8 KiB6230

gstrtpredenc.cH A D19-Apr-201916.9 KiB532401

gstrtpredenc.hH A D19-Apr-20191.9 KiB6634

gstrtpsbcdepay.cH A D19-Apr-201911.6 KiB396286

gstrtpsbcdepay.hH A D19-Apr-20192 KiB7137

gstrtpsbcpay.cH A D19-Apr-201911.1 KiB384281

gstrtpsbcpay.hH A D19-Apr-20192 KiB6633

gstrtpsirendepay.cH A D19-Apr-20193.8 KiB12680

gstrtpsirendepay.hH A D19-Apr-20191.9 KiB6028

gstrtpsirenpay.cH A D19-Apr-20194.6 KiB14897

gstrtpsirenpay.hH A D19-Apr-20191.9 KiB5829

gstrtpspeexdepay.cH A D19-Apr-20196.4 KiB227164

gstrtpspeexdepay.hH A D19-Apr-20191.6 KiB5429

gstrtpspeexpay.cH A D19-Apr-20199.4 KiB351257

gstrtpspeexpay.hH A D19-Apr-20191.6 KiB5730

gstrtpstorage.cH A D19-Apr-20197 KiB219134

gstrtpstorage.hH A D19-Apr-20191.8 KiB6029

gstrtpstreamdepay.cH A D19-Apr-20197.8 KiB232156

gstrtpstreamdepay.hH A D19-Apr-20191.8 KiB5829

gstrtpstreampay.cH A D19-Apr-20199 KiB286203

gstrtpstreampay.hH A D19-Apr-20192 KiB5523

gstrtpsv3vdepay.cH A D19-Apr-20199.3 KiB323216

gstrtpsv3vdepay.hH A D19-Apr-20192 KiB6835

gstrtptheoradepay.cH A D19-Apr-201921.8 KiB708458

gstrtptheoradepay.hH A D19-Apr-20192.2 KiB7339

gstrtptheorapay.cH A D19-Apr-201929.5 KiB986684

gstrtptheorapay.hH A D19-Apr-20192.5 KiB8750

gstrtpulpfecdec.cH A D19-Apr-201923.5 KiB721529

gstrtpulpfecdec.hH A D19-Apr-20192.4 KiB8548

gstrtpulpfecenc.cH A D19-Apr-201922.2 KiB714509

gstrtpulpfecenc.hH A D19-Apr-20192.5 KiB10059

gstrtputils.cH A D19-Apr-20194.3 KiB152106

gstrtputils.hH A D19-Apr-20191.8 KiB5523

gstrtpvorbisdepay.cH A D19-Apr-201921.4 KiB712465

gstrtpvorbisdepay.hH A D19-Apr-20192.1 KiB7138

gstrtpvorbispay.cH A D19-Apr-201930 KiB1,003704

gstrtpvorbispay.hH A D19-Apr-20192.5 KiB8649

gstrtpvp8depay.cH A D19-Apr-20198.5 KiB293206

gstrtpvp8depay.hH A D19-Apr-20192.1 KiB7039

gstrtpvp8pay.cH A D19-Apr-201915.8 KiB548391

gstrtpvp8pay.hH A D19-Apr-20192.3 KiB7542

gstrtpvp9depay.cH A D19-Apr-201911.1 KiB379275

gstrtpvp9depay.hH A D19-Apr-20192.2 KiB7240

gstrtpvp9pay.cH A D19-Apr-201916.4 KiB563381

gstrtpvp9pay.hH A D19-Apr-20192.2 KiB7341

gstrtpvrawdepay.cH A D27-Aug-201918.1 KiB668507

gstrtpvrawdepay.hH A D19-Apr-20192.1 KiB7239

gstrtpvrawpay.cH A D19-Apr-201920.3 KiB666489

gstrtpvrawpay.hH A D19-Apr-20191.9 KiB6834

meson.buildH A D19-Apr-20192.7 KiB122119

rtpredcommon.cH A D19-Apr-20192.5 KiB9157

rtpredcommon.hH A D19-Apr-20192.6 KiB8137

rtpstorage.cH A D19-Apr-20196.9 KiB261191

rtpstorage.hH A D19-Apr-20192.6 KiB7039

rtpstoragestream.cH A D19-Apr-20198 KiB278193

rtpstoragestream.hH A D19-Apr-20192.7 KiB6334

rtpulpfeccommon.cH A D19-Apr-201912.8 KiB442333

rtpulpfeccommon.hH A D19-Apr-20196.4 KiB16390

README

1This directory contains some RTP payloaders/depayloaders for different payload
2types. Use one payloader/depayloder pair per payload. If several payloads can be
3payloaded/depayloaded by the same element, make different copies of it, one for
4each payload.
5
6The application/x-rtp mime type
7-------------------------------
8
9For valid RTP packets encapsulated in GstBuffers, we use the caps with
10mime type application/x-rtp.
11
12The following fields can or must (*) be specified in the structure:
13
14 * media: (String) [ "audio", "video", "application", "data", "control" ]
15     Defined in RFC 2327 in the SDP media announcement field.
16     Converted to lower case.
17
18 * payload: (int) [0, 127]
19     For audio and video, these will normally be a media payload type as
20     defined in the RTP Audio/Video Profile. For dynamicaly allocated
21     payload types, this value will be >= 96 and the encoding-name must be
22     set.
23
24 * clock-rate: (int) [0 - MAXINT]
25    The RTP clock rate.
26
27   encoding-name: (String) ANY
28     typically second part of the mime type. ex. MP4V-ES. only required if
29     payload type >= 96. Converted to upper case.
30
31   encoding-params: (String) ANY
32     extra encoding parameters (as in the SDP a=rtpmap: field). only required
33     if different from the default of the encoding-name.
34     Converted to lower-case.
35
36   ssrc: (uint) [0 - MAXINT]
37    The ssrc value currently in use. (default = the SSRC of the first RTP
38    packet)
39
40   timestamp-offset: (uint) [0 - MAXINT]
41    The RTP time representing time npt-start. (default = rtptime of first RTP
42    packet).
43
44   seqnum-offset: (uint) [0 - MAXINT]
45    The RTP sequence number representing the first rtp packet. When this
46    parameter is given, all sequence numbers below this seqnum should be
47    ignored. (default = seqnum of first RTP packet).
48
49   npt-start: (uint64) [0 - MAXINT]
50    The Normal Play Time for clock-base. This is the position in the stream and
51    is between 0 and the duration of the stream. This value is expressed in
52    nanoseconds GstClockTime. (default = 0)
53
54   npt-stop: (uint64) [0 - MAXINT]
55    The last position in the stream. This value is expressed in nanoseconds
56    GstClockTime. (default = -1, stop unknown)
57
58   play-speed: (gdouble) [-MIN - MAX]
59    The intended playback speed of the stream. The client is delivered data at
60    the adjusted speed. The client should adjust its playback speed with this
61    value and thus corresponds to the GStreamer rate field in the NEWSEGMENT
62    event. (default = 1.0)
63
64   play-scale: (gdouble) [-MIN - MAX]
65    The rate already applied to the stream. The client is delivered a stream
66    that is scaled by this amount. This value is used to adjust position
67    reporting and corresponds to the GStream applied-rate field in the
68    NEWSEGMENT event. (default = 1.0)
69
70   maxptime: (uint) [0, MAX]
71    The maxptime as defined in RFC 4566, this defines the maximum size of a
72    packet. It overrides the max-ptime property of payloaders.
73
74   Optional parameters as key/value pairs, media type specific. The value type
75   should be of type G_TYPE_STRING. The key is converted to lower-case. The
76   value is left in its original case.
77   A parameter with no value is converted to <param>=1.
78
79 Example:
80
81  "application/x-rtp",
82      "media", G_TYPE_STRING, "audio",		-.
83      "payload", G_TYPE_INT, 96,                 | - required
84      "clock-rate", G_TYPE_INT, 8000,           -'
85      "encoding-name", G_TYPE_STRING, "AMR",    -. - required since payload >= 96
86      "encoding-params", G_TYPE_STRING, "1",	-' - optional param for AMR
87      "octet-align", G_TYPE_STRING, "1",	-.
88      "crc", G_TYPE_STRING, "0",                 |
89      "robust-sorting", G_TYPE_STRING, "0",      |  AMR specific params.
90      "interleaving", G_TYPE_STRING, "0",       -'
91
92 Mapping of caps to and from SDP fields:
93
94   m=<media> <udp port> RTP/AVP <payload>       -] media and payload from caps
95   a=rtpmap:<payload> <encoding-name>/<clock-rate>[/<encoding-params>]
96              -> when <payload> >= 96
97   a=fmtp:<payload> <param>=<value>;...
98
99 For above caps:
100
101   m=audio <udp port> RTP/AVP 96
102   a=rtpmap:96 AMR/8000/1
103   a=fmtp:96 octet-align=1;crc=0;robust-sorting=0;interleaving=0
104
105 Attributes are converted as follows:
106
107  IANA registered attribute names are prepended with 'a-' before putting them in
108  the caps. Unregistered keys (starting with 'x-') are copied directly into the
109  caps.
110
111 in RTSP, the SSRC is also sent.
112
113 The optional parameters in the SDP fields are case insensitive. In the caps we
114 always use the lowercase names so that the SDP -> caps mapping remains
115 possible.
116
117 Mapping of caps to NEWSEGMENT:
118
119  rate:         <play-speed>
120  applied-rate: <play-scale>
121  format:       GST_FORMAT_TIME
122  start:        <clock-base> * GST_SECOND / <clock-rate>
123  stop:         if <ntp-stop> != -1
124                  <npt-stop> - <npt-start> + start
125		else
126		  -1
127  time:         <npt-start>
128
129
130Timestamping
131------------
132
133RTP in GStreamer uses a combination of the RTP timestamps and GStreamer buffer
134timestamps to ensure proper synchronisation at the sender and the receiver end.
135
136In RTP applications, the synchronisation is most complex at the receiver side.
137
138At the sender side, the RTP timestamps are generated in the payloaders based on
139GStreamer timestamps. At the receiver, GStreamer timestamps are reconstructed
140from the RTP timestamps and the GStreamer timestamps in the jitterbuffer. This
141process is explained in more detail below.
142
143= synchronisation at the sender
144
145Individual streams at the sender are synchronised using GStreamer timestamps.
146The payloader at the sender will convert the GStreamer timestamp into an RTP
147timestamp using the following formula:
148
149   RTP = ((RT - RT-base) * clock-rate / GST_SECOND) + RTP-offset
150
151  RTP:        the RTP timestamp for the stream. This value is truncated to
152              32 bits.
153  RT:         the GStreamer running time corresponding to the timestamp of the
154              packet to payload
155  RT-base:    the GStreamer running time of the first packet encoded
156  clock-rate: the clock-rate of the stream
157  RTP-offset: a random RTP offset
158
159The RTP timestamp corresponding to RT-base is the clock-base (see caps above).
160
161In addition to setting an RTP timestamp in the RTP packet, the payloader is also
162responsible for putting the GStreamer timestamp on the resulting output buffer.
163This timestamp is used for further synchronisation at the sender pipeline, such
164as for sending out the packet on the network.
165
166Notice that the absolute timing information is lost; if the sender is sending
167multiple streams, the RTP timestamps in the packets do not contain enough
168information to synchronize them in the receiver. The receiver can however use
169the RTP timestamps to reconstruct the timing of the stream as it was created by
170the sender according to the sender's clock.
171
172Because the payloaded packet contains both an RTP timestamp and a GStreamer
173timestamp, it is possible for an RTP session manager to derive the relation
174between the RTP and GST timestamps. This information is used by a session
175manager to create SR reports. The NTP time in the report will contain the
176running time converted to NTP time and the corresponding RTP timestamp.
177
178Note that at the sender side, the RTP and GStreamer timestamp both increment at
179the same rate, the sender rate. This rate depends on the global pipeline clock
180of the sender.
181
182Some pipelines to illustrate the process:
183
184    gst-launch-1.0 v4l2src ! videoconvert ! avenc_h263p ! rtph263ppay ! udpsink
185
186  v4l2src puts a GStreamer timestamp on the video frames base on the current
187  running_time. The encoder encodes and passed the timestamp on. The payloader
188  generates an RTP timestamp using the above formula and puts it in the RTP
189  packet. It also copies the incoming GStreamer timestamp on the output RTP
190  packet. udpsink synchronizes on the gstreamer timestamp before pushing out the
191  packet.
192
193
194= synchronisation at the receiver
195
196The receiver is responsible for timestamping the received RTP packet with the
197running_time of the clock at the time the packet was received. This GStreamer
198timestamp reflects the receiver rate and depends on the global pipeline clock of
199the receiver. The gstreamer timestamp of the received RTP packet contains a
200certain amount of jitter introduced by the network.
201
202The most simple option for the receiver is to depayload the RTP packet and play
203it back as soon as possible, this is with the timestamp when it was received
204from the network. For the above sender pipeline this would be done with the
205following pipeline:
206
207    gst-launch-1.0 udpsrc caps="application/x-rtp, media=(string)video,
208      clock-rate=(int)90000, encoding-name=(string)H263-1998" ! rtph263pdepay !
209      avdec_h263 ! autovideosink
210
211It is important that the depayloader copies the incoming GStreamer timestamp
212directly to the depayloaded output buffer. It should never attempt to perform
213any logic with the RTP timestamp, this task is for the jitterbuffer as we will
214see next.
215
216The above pipeline does not attempt to deal with reordered packets or network
217jitter, which could result in jerky playback in the case of high jitter or
218corrupted video in the case of packet loss or reordering. This functionality is
219performed by the gstrtpjitterbuffer in GStreamer.
220
221The task of the gstrtpjitterbuffer element is to:
222
223 - deal with reordered packets based on the seqnum
224 - calculate the drift between the sender and receiver clocks using the
225   GStreamer timestamps (receiver clock rate) and RTP timestamps (sender clock
226   rate).
227
228To deal with reordered packet, the jitterbuffer holds on to the received RTP
229packets in a queue for a configurable amount of time, called the latency.
230
231The jitterbuffer also eliminates network jitter and then tracks the drift
232between the local clock (as expressed in the GStreamer timestamps) and the
233remote clock (as expressed in the RTP timestamps). It will remove the jitter
234and will apply the drift correction to the GStreamer timestamp before pushing
235the buffer downstream. The result is that the depayloader receives a smoothed
236GStreamer timestamp on the RTP packet, which is copied to the depayloaded data.
237
238The following pipeline illustrates a receiver with a jitterbuffer.
239
240    gst-launch-1.0 udpsrc caps="application/x-rtp, media=(string)video,
241      clock-rate=(int)90000, encoding-name=(string)H263-1998" !
242      rtpjitterbuffer latency=100 ! rtph263pdepay !  avdec_h263 ! autovideosink
243
244The latency property on the jitterbuffer controls the amount of delay (in
245milliseconds) to apply to the outgoing packets. A higher latency will produce
246smoother playback in networks with high jitter but cause a higher latency.
247Choosing a good value for the latency is a tradeoff between the quality and
248latency. The better the network, the lower the latency can be set.
249
250
251usage with UDP
252--------------
253
254To correctly and completely use the RTP payloaders on the sender and the
255receiver you need to write an application. It is not possible to write a full
256blown RTP server with a single gst-launch-1.0 line.
257
258That said, it is possible to do something functional with a few gst-launch
259lines. The biggest problem when constructing a correct gst-launch-1.0 line lies on
260the receiver end.
261
262The receiver needs to know about the type of the RTP data along with a set of
263RTP configuration parameters. This information is usually transmitted to the
264client using some sort of session description language (SDP) over some reliable
265channel (HTTP/RTSP/...).
266
267All of the required parameters to connect and use the RTP session on the
268server can be found in the caps on the server end. The client receives this
269information in some way (caps are converted to and from SDP, as explained above,
270for example).
271
272Some gst-launch-1.0 lines:
273
274  gst-launch-1.0 -v videotestsrc ! videoconvert ! avenc_h263p ! rtph263ppay ! udpsink
275
276   Setting pipeline to PAUSED ...
277   /pipeline0/videotestsrc0.src: caps = video/x-raw, format=(string)I420,
278   width=(int)320, height=(int)240, framerate=(fraction)30/1
279   Pipeline is PREROLLING ...
280   ....
281   /pipeline0/udpsink0.sink: caps = application/x-rtp, media=(string)video,
282   payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H263-1998,
283   ssrc=(guint)527842345, clock-base=(guint)1150776941, seqnum-base=(guint)30982
284   ....
285   Pipeline is PREROLLED ...
286   Setting pipeline to PLAYING ...
287   New clock: GstSystemClock
288
289 Write down the caps on the udpsink and set them as the caps of the UDP
290 receiver:
291
292  gst-launch-1.0 -v udpsrc caps="application/x-rtp, media=(string)video,
293  payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H263-1998,
294  ssrc=(guint)527842345, clock-base=(guint)1150776941, seqnum-base=(guint)30982"
295  ! rtph263pdepay ! avdec_h263 ! autovideosink
296
297 The receiver now displays an h263 image. Since there is no jitterbuffer in the
298 pipeline, frames will be displayed at the time when they are received. This can
299 result in jerky playback in the case of high network jitter or currupted video
300 when packets are dropped or reordered.
301
302 Stream a quicktime file with mpeg4 video and AAC audio on port 5000 and port
303 5002.
304
305  gst-launch-1.0 -v filesrc location=~/data/sincity.mp4 ! qtdemux name=d ! queue ! rtpmp4vpay ! udpsink port=5000
306                         d. ! queue ! rtpmp4gpay ! udpsink port=5002
307    ....
308    /pipeline0/udpsink0.sink: caps = application/x-rtp, media=(string)video,
309    payload=(int)96, clock-rate=(int)90000, encoding-name=(string)MP4V-ES,
310    ssrc=(guint)1162703703, clock-base=(guint)816135835, seqnum-base=(guint)9294,
311    profile-level-id=(string)3, config=(string)000001b003000001b50900000100000001200086c5d4c307d314043c1463000001b25876694430303334
312    /pipeline0/udpsink1.sink: caps = application/x-rtp, media=(string)audio,
313    payload=(int)96, clock-rate=(int)44100, encoding-name=(string)MPEG4-GENERIC,
314    ssrc=(guint)3246149898, clock-base=(guint)4134514058, seqnum-base=(guint)57633,
315    encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)1,
316    mode=(string)aac-hbr, config=(string)1210, sizelength=(string)13,
317    indexlength=(string)3, indexdeltalength=(string)3
318    ....
319
320 Again copy the caps on both sinks to the receiver launch line
321
322    gst-launch-1.0
323     udpsrc port=5000 caps="application/x-rtp, media=(string)video, payload=(int)96,
324      clock-rate=(int)90000, encoding-name=(string)MP4V-ES, ssrc=(guint)1162703703,
325      clock-base=(guint)816135835, seqnum-base=(guint)9294, profile-level-id=(string)3,
326      config=(string)000001b003000001b50900000100000001200086c5d4c307d314043c1463000001b25876694430303334"
327      ! rtpmp4vdepay ! ffdec_mpeg4 ! autovideosink sync=false
328     udpsrc port=5002 caps="application/x-rtp, media=(string)audio, payload=(int)96,
329      clock-rate=(int)44100, encoding-name=(string)MPEG4-GENERIC, ssrc=(guint)3246149898,
330      clock-base=(guint)4134514058, seqnum-base=(guint)57633, encoding-params=(string)2,
331      streamtype=(string)5, profile-level-id=(string)1, mode=(string)aac-hbr,
332      config=(string)1210, sizelength=(string)13, indexlength=(string)3,
333      indexdeltalength=(string)3"
334      ! rtpmp4gdepay ! faad ! alsasink sync=false
335
336 The caps on the udpsinks can be retrieved when the server pipeline prerolled to
337 PAUSED.
338
339 The above pipeline sets sync=false on the audio and video sink which means that
340 no synchronisation will be performed in the sinks, they play the data when it
341 arrives. If you want to enable synchronisation in the sinks it is highly
342 recommended to use a gstrtpjitterbuffer after the udpsrc elements.
343
344 Even when sync is enabled, the two different streams will not play synchronised
345 against eachother because the receiver does not have enough information to
346 perform this task. For this you need to add the rtpbin element in both the
347 sender and receiver pipeline and use additional sources and sinks to transmit
348 RTCP packets used for inter-stream synchronisation.
349
350 The caps on the receiver side can be set on the UDP source elements when the
351 pipeline went to PAUSED. In that state no data is received from the UDP sources
352 as they are live sources and only produce data in PLAYING.
353
354
355Relevant RFCs
356-------------
357
3583550 RTP: A Transport Protocol for Real-Time Applications. ( 1889 Obsolete )
359
3602198 RTP Payload for Redundant Audio Data.
3613119 A More Loss-Tolerant RTP Payload Format for MP3 Audio.
362
3632793 RTP Payload for Text Conversation.
364
3652032 RTP Payload Format for H.261 Video Streams.
3662190 RTP Payload Format for H.263 Video Streams.
3672250 RTP Payload Format for MPEG1/MPEG2 Video.
3682343 RTP Payload Format for Bundled MPEG.
3692429 RTP Payload Format for the 1998 Version of ITU-T Rec. H.263 Video
3702431 RTP Payload Format for BT.656 Video Encoding.
3712435 RTP Payload Format for JPEG-compressed Video.
3723016 RTP Payload Format for MPEG-4 Audio/Visual Streams.
3733047 RTP Payload Format for ITU-T Recommendation G.722.1.
3743189 RTP Payload Format for DV (IEC 61834) Video.
3753190 RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio.
3763389 Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN)
3772733 An RTP Payload Format for Generic Forward Error Correction.
3782833 RTP Payload for DTMF Digits, Telephony Tones and Telephony
379     Signals.
3802862 RTP Payload Format for Real-Time Pointers.
3813351 RTP Profile for Audio and Video Conferences with Minimal Control. ( 1890 Obsolete )
3823555 MIME Type Registration of RTP Payload Formats.
383
3842508 Compressing IP/UDP/RTP Headers for Low-Speed Serial Links.
3851305 Network Time Protocol (Version 3) Specification, Implementation and Analysis.
3863339 Date and Time on the Internet: Timestamps.
3872246 The TLS Protocol Version 1.0
3883546 Transport Layer Security (TLS) Extensions. ( Updates 2246 )
389
390do we care?
391-----------
392
3932029 RTP Payload Format of Sun's CellB Video Encoding.
394
395useful
396------
397
398http://www.iana.org/assignments/rtp-parameters
399