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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
|
'\" t
.\" Title: sydra-rtp
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 10/03/2014
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "SYDRA\-RTP" "8" "10/03/2014" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sydra-rtp \- tool for RTP based streams
.SH "SYNOPSIS"
.sp
.nf
sydra\-rtp
[ \fB\-h|\-\-help\fR ]
[ \fB\-D|\-\-nodaemonize\fR ]
[ \fB\-u|\-\-username\fR <username> ]
[ \fB\-g|\-\-groupname\fR <groupname> ]
[ \fB\-C|\-\-chroot\fR <path> ]
[ \fB\-P|\-\-write\-pid\fR <filename> ]
[ \fB\-L|\-\-log\fR <target>:<level>[,<param1>[,<param2>[\&.\&.]]] ]
[ \fB\-U|\-\-debug\fR ]
[ \fB\-n|\-\-appname\fR <name> ]
[ \fB\-m|\-\-mode\fR (sender|reciever) ]
[ \fB\-\-source\fR <bin description> ]
[ \fB\-\-video\-encoder\fR <bin description> ]
[ \fB\-\-video\-payloader\fR <element> ]
[ \fB\-\-previewsink\fR <bin description> ]
[ \fB\-\-audio\-encoder\fR <bin description> ]
[ \fB\-\-audio\-payloader\fR <element> ]
[ \fB\-\-video\-caps\fR <caps> ]
[ \fB\-\-video\-depayloader\fR <element> ]
[ \fB\-\-video\-decoder\fR <bin description> ]
[ \fB\-\-audio\-caps\fR <caps> ]
[ \fB\-\-audio\-depayloader\fR <element> ]
[ \fB\-\-audio\-decoder\fR <bin description> ]
[ \fB\-\-sink\fR <bin description> ]
[ \fB\-a|\-\-rtp\-host\fR <host> ]
[ \fB\-o|\-\-rtp\-port\-base\fR <port> ]
[ \fB\-A|\-\-rtp\-addr\-local\fR <address> ]
[ \fB\-O|\-\-rtp\-port\-base\-local\fR <port> ]
[ \fB\-\-rtp\-host\-reflector\fR <host> ]
[ \fB\-\-rtp\-port\-base\-reflector\fR <port> ]
[ \fB\-c|\-\-no\-auto\-client\fR ]
[ \fB\-t|\-\-timeout\fR <timeout> ]
[ \fB\-k|\-\-keepalive\-interval\fR <interval> ]
[ \fB\-\-rec\-video\-encoder\fR <bin description> ]
[ \fB\-\-rec\-audio\-encoder\fR <bin description> ]
[ \fB\-\-rec\-mux\fR <element> ]
[ \fB\-\-rec\-name\-format\fR <formatstring> ]
.fi
.SH "DESCRIPTION"
.sp
\fBsydra\fR is a toolbox which allows you to set up multiple bidirectional Video/Audio streams from external locations\&. \fBsydra\fR has been written to be used for the Elevate Festival in Graz Austria in order to involve external locations to present themselves at the festival\&.
.sp
This manpage describes \fBsydra\-rtp\fR the basic utility for the task which is based on GStreamer and is written in C\&. The \fBsydra\-rtp\fR utility creates a gstreamer pipeline to send or receive RTP\-based Audio/Video streams\&. For a bidirectional connection 2 instances of \fBsydra\-rtp\fR are required on both sides of the communication\&. \fBsydra\-rtp\fR has automatic client detection capabilities in the form of keep alive messages\&. These message are sent out by receivers to request RTP packets from a sender\&. The sender will send RTP packets to one or more receivers which request the stream\&. It also uses the keep alive messages to remove stale client \fIconnections\fR\&. A receiver can also request to be removed from the list of receivers\&. This ensures a fast and clean shutdown\&. The keepalive messages are also a simple way to work around NAT and firewalls (UDP hole punching)\&.
.SH "OPTIONS"
.sp
The following options can be passed to the \fBsydra\-rtp\fR daemon:
.sp
\fBglobal options\fR
.PP
\fB\-D, \-\-nodaemonize\fR
.RS 4
This option instructs
\fBsydra\-rtp\fR
to run in foreground instead of becoming a daemon which is the default\&.
.RE
.PP
\fB\-u, \-\-username <username>\fR
.RS 4
run as this user\&. If no group is specified (\fB\-g\fR) the default group of the user is used\&. The default is to not drop privileges\&.
.RE
.PP
\fB\-g, \-\-groupname <groupname>\fR
.RS 4
run as this group\&. If no username is specified (\fB\-u\fR) this gets ignored\&. The default is to not drop privileges\&.
.RE
.PP
\fB\-C, \-\-chroot <path>\fR
.RS 4
Instruct
\fBsydra\-rtp\fR
to run in a chroot jail\&. The default is to not run in chroot\&.
.RE
.PP
\fB\-P, \-\-write\-pid <filename>\fR
.RS 4
Instruct
\fBsydra\-rtp\fR
to write it\(cqs pid to this file\&. The default is to not create a pid file\&.
.RE
.PP
\fB\-L, \-\-log <target>:<level>[,<param1>[,<param2>[\&.\&.]]]\fR
.RS 4
add log target to logging system\&. This can be invoked several times in order to log to different targets at the same time\&. Every target has its own log level which is a number between 0 and 5\&. Where 0 means disabling log and 5 means debug messages are enabled\&.
The file target can be used more than once with different levels\&. If no target is provided at the command line a single target with the config
\fBsyslog:3,sydra\-rtp,daemon\fR
is added\&.
The following targets are supported:
.PP
\fBsyslog\fR
.RS 4
log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
.RE
.PP
\fBfile\fR
.RS 4
log to file, parameters <level>[,<path>]
.RE
.PP
\fBstdout\fR
.RS 4
log to standard output, parameters <level>
.RE
.PP
\fBstderr\fR
.RS 4
log to standard error, parameters <level>
.RE
.RE
.PP
\fB\-U, \-\-debug\fR
.RS 4
This option instructs
\fBsydra\-rtp\fR
to run in debug mode\&. It implicits
\fB\-D\fR
(don\(cqt daemonize) and adds a log target with the configuration
\fBstdout:5\fR
(logging with maximum level)\&. In future releases there might be additional output when this option is supplied\&.
.RE
.PP
\fB\-n, \-\-appname <name>\fR
.RS 4
This set the application name using
\fIg_set_prgname()\fR\&. It will be used for example by xvimagesink for window title\&.
.RE
.PP
\fB\-m, \-\-mode (sender|reciever)\fR
.RS 4
This sets the main mode of
\fBsydra\-rtp\fR\&. The sender will read raw video and audio from the source bin and send it via RTP to one or more receivers\&.
.RE
.sp
\fBsender\-mode only options\fR
.PP
\fB\-\-source <bin description>\fR
.RS 4
A gst\-launch\-style description for the raw video and audio bin\&. This bin must contain an element called
\fIvideosrc\fR
and an element called
\fIaudiosrc\fR
which should each contain a pad called
\fIsrc\fR\&. Theses pads will get connected to the encoder bins\&. Example:
\fIv4l2src ! videoconvert ! videoscale ! video/x\-raw,format=I420,width=864,height=480 ! identity name="videosrc" autoaudiosrc ! audio/x\-raw,format=S16LE,channels=1,rate=48000 ! identity name="audiosrc"\fR
.RE
.PP
\fB\-\-video\-encoder <bin description>\fR
.RS 4
Bin description for the video encoder\&. Example:
\fIvideoconvert ! vp8enc\fR
.RE
.PP
\fB\-\-video\-payloader <element>\fR
.RS 4
A RTP payloader element for the video codec in use\&. Example:
\fIrtpvp8pay\fR
.RE
.PP
\fB\-\-previewsink <bin description>\fR
.RS 4
A video sink element for local preview\&. Example:
\fIvideoconvert ! textoverlay test="preview" ! xvimagesink\fR
.RE
.PP
\fB\-\-audio\-encoder <bin description>\fR
.RS 4
Bin description for the audio encoder\&. Example:
\fIaudioconveert ! opusenc\fR
.RE
.PP
\fB\-\-audio\-payloader <element>\fR
.RS 4
A RTP payloader element for the audio codec in use\&. Example:
\fIrtpopuspay\fR
.RE
.sp
\fBreceiver\-mode only options\fR
.PP
\fB\-\-video\-caps <caps>\fR
.RS 4
These caps will get assigned to incoming RTP packets for video\&. Example:
\fIapplication/x\-rtp,media=video,clock\-rate=90000,encoding\-name=VP8\-DRAFT\-IETF\-01,caps="video/x\-vp8"\fR
.RE
.PP
\fB\-\-video\-depayloader <element>\fR
.RS 4
A RTP depayloader element for the video codec in use\&. Example:
\fIrtpvp8depay\fR
.RE
.PP
\fB\-\-video\-decoder <bin description>\fR
.RS 4
Bin description for the video decoder\&. Example:
\fIvp8dec\fR
.RE
.PP
\fB\-\-audio\-caps <caps>\fR
.RS 4
These caps will get assigned to incoming RTP packets for audio\&. Example:
\fIapplication/x\-rtp,media=audio,clock\-rate=48000,payload=96,encoding\-name=X\-GST\-OPUS\-DRAFT\-SPITTKA\-00,caps="audio/x\-opus"\fR
.RE
.PP
\fB\-\-audio\-depayloader <element>\fR
.RS 4
A RTP depayloader element for the audio codec in use\&. Example:
\fIrtpopusdepay\fR
.RE
.PP
\fB\-\-audio\-decoder <bin description>\fR
.RS 4
Bin description for the audio decoder\&. Example:
\fIopusdec\fR
.RE
.PP
\fB\-\-sink <bin description>\fR
.RS 4
A gst\-launch\-style description for the raw video and audio bin\&. This bin must contain an element called
\fIvideosink\fR
and an element called
\fIaudiosink\fR
which should each contain a pad called
\fIsink\fR\&. Theses pads will get connected to the decoder bins\&. Example:
\fIvideoconvert name="videosink" ! videoscale add\-borders=true ! xvimagesink audioconvert name="audiosink" ! autoaudiosink\fR
.RE
.sp
\fBoptions for RTP\fR
.PP
\fB\-a, \-\-rtp\-host <host>\fR
.RS 4
In
\fIsender\fR
mode this sets the address or hostname of the remote RTP receiver\&. Please mind that the remote RTP host is always added as a receiver and it shouldn\(cqt be configured to send keepalives\&. This would re\-add the receiver to the list of clients and as a result duplicate packages will be sent\&. Also the remote RTP host is excluded from client timeout handling and remove requests from it will get ignored\&. When you omit this in sender mode the automatic client detection will be used to add receivers\&. In
\fIreceiver\fR
mode keepalive messages will be sent to this host\&. Leave empty to disable keepalive messages\&.
.RE
.PP
\fB\-o, \-\-rtp\-port\-base <port>\fR
.RS 4
The base number for remote ports\&.
\fBsydra\-rtp\fR
will send the RTP/RTCP packets using the following mapping:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
rtp\-port\-base + 0: RTP Video
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
rtp\-port\-base + 1: RTCP Video
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
rtp\-port\-base + 2: RTP Audio
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
rtp\-port\-base + 3: RTCP Audio
.RE
.RE
.PP
\fB\-A, \-\-rtp\-addr\-local <address>\fR
.RS 4
The local address to wait for incoming UDP messages\&. Leave empty to listen on any address\&.
.RE
.PP
\fB\-O, \-\-rtp\-port\-base\-local <port>\fR
.RS 4
The base number for local ports to bind to\&. The same mapping as for the remote port\-base is used to map incoming RTP packets to the RTP bin\&.
.RE
.PP
\fB\-\-rtp\-host\-reflector <host>\fR
.RS 4
When in receiver mode the incoming RTP packets will get reflected to this host\&. Leave empty to disable RTP packet reflection\&.
.RE
.PP
\fB\-\-rtp\-port\-base\-reflector <port>\fR
.RS 4
When a reflector\-host gets specified using the option above the RTP packets will get sent to the ports based on this\&. The same mapping as with the other port\-base options is used\&.
.RE
.PP
\fB\-c, \-\-no\-auto\-client\fR
.RS 4
This disables auto\-detection for clients in
\fIsender\fR
mode\&. Mind that if you disable the automatic client detection and also omit the rtp\-host option
\fBsydra\-rtp\fR
won\(cqt send any RTP messages\&. If configured recording will work but this is most probably not what you want\&.
.RE
.PP
\fB\-t, \-\-timeout <timeout>\fR
.RS 4
This sets the client timeout in seconds in
\fIsender\fR
mode\&. A value of 0 disables client timeouts\&. This is not recommended\&.
.RE
.PP
\fB\-k, \-\-keepalive\-interval <interval>\fR
.RS 4
This sets the interval in seconds for sending out keepalive messages in
\fIreceiver\fR
mode\&. A value of 0 disables keepalive messages and therefor the client auto detection won\(cqt work for this client\&.
.RE
.sp
\fBoptions for recording\fR
.PP
\fB\-\-rec\-video\-encoder <bin description>\fR
.RS 4
A bin description for the video encoder used for recording\&. If you leave this empty the output from the RTP video encoder is used\&. Example:
\fIvideoconvert ! jpegenc\fR
.RE
.PP
\fB\-\-rec\-audio\-encoder <bin description>\fR
.RS 4
A bin description for the audio encoder used for recording\&. If you leave this empty the output from the RTP audio encoder is used\&. Example:
\fIaudioconvert ! vorbisenc\fR
.RE
.PP
\fB\-\-rec\-mux <element>\fR
.RS 4
A gstreamer muxer element used for recording\&. If you leave this empty recording will be disabled\&. Example:
\fImatroskamux\fR
.RE
.PP
\fB\-\-rec\-name\-format <formatstring>\fR
.RS 4
A
\fIstrftime\fR
based format string which will be used to create the name for the recorded file\&. Example: \&./recordings/%Y\-%m\-%d_%H\-%M\-%S\&.mkv
.RE
.SH "BUGS"
.sp
Most likely there are some bugs in \fBsydra\-rtp\fR\&. If you find a bug, please let the developers know at equinox@spreadspace\&.org\&. Of course, patches are preferred\&.
.SH "SEE ALSO"
.sp
\fBstrftime\fR(3), \fBgst\-launch\fR(1)
.SH "AUTHORS"
.sp
Christian Pointner <equinox@spreadspace\&.org>
.SH "COPYING"
.sp
Copyright (C) 2014 Christian Pointner\&. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version\&.
|