Project

General

Profile

Feature #220 » crtmpserver.lua

Working crtmpserver conf, but needs cleansing of extras - Hammel, 27 Aug 2013 08:46

 
1
-- Start of the configuration. This is the only node in the config file. 
2
-- The rest of them are sub-nodes
3
configuration=
4
{
5
	-- if true, the server will run as a daemon.
6
	-- NOTE: all console appenders will be ignored if this is a daemon
7
	daemon=false,
8
	-- the OS's path separator. Used in composing paths
9
	pathSeparator="/",
10

    
11
	-- this is the place where all the logging facilities are setted up
12
	-- you can add/remove any number of locations
13

    
14
	logAppenders=
15
	{
16
		{
17
			-- name of the appender. Not too important, but is mandatory
18
			name="console appender",
19
			-- type of the appender. We can have the following values:
20
			-- console, coloredConsole and file
21
			-- NOTE: console appenders will be ignored if we run the server
22
			-- as a daemon
23
			type="coloredConsole",
24
			-- the level of logging. 6 is the FINEST message, 0 is FATAL message.
25
			-- The appender will "catch" all the messages below or equal to this level
26
			-- bigger the level, more messages are recorded
27
			level=6
28
		},
29
		{
30
			name="file appender",
31
			type="file",
32
			level=6,
33
			-- the file where the log messages are going to land
34
			fileName="/tmp/crtmpserver",
35
			--newLineCharacters="\r\n",
36
			fileHistorySize=10,
37
			fileLength=1024*256,
38
			singleLine=true
39
		}
40
	},
41
	
42
	-- this node holds all the RTMP applications
43
	applications=
44
	{
45
		-- this is the root directory of all applications
46
		-- usually this is relative to the binary execuable
47
		rootDirectory="/usr/lib/crtmpserver/applications",
48
		
49
		
50
		--this is where the applications array starts
51
		{
52
			-- The name of the application. It is mandatory and must be unique 
53
			name="appselector",
54
			-- Short description of the application. Optional
55
			description="Application for selecting the rest of the applications",
56
			
57
			-- The type of the application. Possible values are:
58
			-- dynamiclinklibrary - the application is a shared library
59
			protocol="dynamiclinklibrary",
60
			-- the complete path to the library. This is optional. If not provided, 
61
			-- the server will try to load the library from here
62
			-- <rootDirectory>/<name>/lib<name>.{so|dll|dylib}
63
			-- library="/some/path/to/some/shared/library.so"
64
			
65
			-- Tells the server to validate the clien's handshake before going further. 
66
			-- It is optional, defaulted to true
67
			validateHandshake=true,
68
			-- this is the folder from where the current application gets it's content.
69
			-- It is optional. If not specified, it will be defaulted to:
70
			-- <rootDirectory>/<name>/mediaFolder
71
			mediaFolder="/var/volatile/cache/crtmpserver",
72
			-- the application will also be known by that names. It is optional
73
			--aliases=
74
			--{
75
			--	"simpleLive",
76
			--	"vod",
77
			--	"live",
78
			--},
79
			-- This flag designates the default application. The default application
80
			-- is responsable of analyzing the "connect" request and distribute 
81
			-- the future connection to the correct application.
82
			default=true,
83
			acceptors = 
84
			{
85
				{
86
					ip="0.0.0.0",
87
					port=1935,
88
					protocol="inboundRtmp"
89
				},
90
				-- {
91
				-- 	ip="0.0.0.0",
92
				-- 	port=8081,
93
				-- 	protocol="inboundRtmps",
94
				-- 	sslKey="server.key",
95
				-- 	sslCert="server.crt"
96
				-- },
97
				{
98
					ip="0.0.0.0",
99
					port=8080,
100
					protocol="inboundRtmpt"
101
                                },
102
			}
103
		},
104
		{
105
			description="FLV Playback Sample",
106
			name="flvplayback",
107
			protocol="dynamiclinklibrary",
108
			mediaFolder="/var/volatile/cache/crtmpserver/",
109
			aliases=
110
			{
111
				"simpleLive",
112
				"vod",
113
				"live",
114
				"WeeklyQuest",
115
				"SOSample",
116
				"oflaDemo",
117
			},
118
			acceptors = 
119
			{
120
				{
121
					ip="0.0.0.0",
122
					port=6666,
123
					protocol="inboundLiveFlv",
124
					waitForMetadata=true,
125
				},
126
				{
127
					ip="0.0.0.0",
128
					port=9999,
129
					protocol="inboundTcpTs",
130
				},
131
				{
132
					ip="0.0.0.0",
133
					port=10000,
134
					protocol="inboundUdpTs",
135
                                },
136
				--[[{
137
					ip="0.0.0.0",
138
					port=7654,
139
					protocol="inboundRawHttpStream",
140
					crossDomainFile="/tmp/crossdomain.xml"
141
				},
142
				{
143
					ip="0.0.0.0",
144
					port=554,
145
					protocol="inboundRtsp"
146
				},]]--
147
			},
148
			externalStreams = 
149
			{
150
				--[[
151
				{
152
					uri="rtsp://fms20.mediadirect.ro/live2/realitatea/realitatea",
153
					localStreamName="rtsp_test",
154
					forceTcp=true
155
				},
156
				{
157
					uri="rtmp://edge01.fms.dutchview.nl/botr/bunny",
158
					localStreamName="rtmp_test",
159
					swfUrl="http://www.example.com/example.swf";
160
					pageUrl="http://www.example.com/";
161
					emulateUserAgent="MAC 10,1,82,76",
162
				}]]--
163
			},
164
			validateHandshake=true,
165
			keyframeSeek=false,
166
			seekGranularity=500, --in seconds, between 0.1 and 600
167
			clientSideBuffer=5, --in seconds, between 5 and 30
168
			--generateMetaFiles=true, --this will generate seek/meta files on application startup
169
			--renameBadFiles=false,
170
			--enableCheckBandwidth=true,
171
			--[[authentication=
172
			{
173
				rtmp={
174
					type="adobe",
175
					encoderAgents=
176
					{
177
						"FMLE/3.0 (compatible; FMSc/1.0)",
178
						"My user agent",
179
					},
180
					usersFile="users.lua"
181
				},
182
				rtsp={
183
					usersFile="users.lua"
184
				}
185
			}, --]]
186
		},
187
		{
188
			name="samplefactory",
189
			description="asdsadasdsa",
190
			protocol="dynamiclinklibrary",
191
			aliases=
192
			{
193
				"httpOutboundTest"
194
			},
195
			acceptors = 
196
			{
197
				{
198
					ip="0.0.0.0",
199
					port=8989,
200
					protocol="httpEchoProtocol"
201
				},
202
				{
203
					ip="0.0.0.0",
204
					port=8988,
205
					protocol="echoProtocol"
206
				}
207
			}
208
			--validateHandshake=true,
209
			--default=true,
210
		},
211
		{
212
			name="vptests",
213
			description="Variant protocol tests",
214
			protocol="dynamiclinklibrary",
215
			aliases=
216
			{
217
				"vptests_alias1",
218
				"vptests_alias2",
219
				"vptests_alias3",
220
			},
221
			acceptors = 
222
			{
223
				{
224
					ip="0.0.0.0",
225
					port=1111,
226
					protocol="inboundHttpXmlVariant"
227
				}
228
			}
229
			--validateHandshake=true,
230
			--default=true,
231
		},
232
		{
233
			name="admin",
234
			description="Application for administering",
235
			protocol="dynamiclinklibrary",
236
			aliases=
237
			{
238
				"admin_alias1",
239
				"admin_alias2",
240
				"admin_alias3",
241
			},
242
			acceptors = 
243
			{
244
				{
245
					ip="0.0.0.0",
246
					port=1112,
247
					protocol="inboundJsonCli",
248
					useLengthPadding=true
249
				},
250
			}
251
			--validateHandshake=true,
252
			--default=true,
253
		},
254
		{
255
			name="proxypublish",
256
			description="Application for forwarding streams to another RTMP server",
257
			protocol="dynamiclinklibrary",
258
			acceptors =
259
			{
260
				{	
261
					ip="0.0.0.0",
262
					port=6665,
263
					protocol="inboundLiveFlv"
264
				},
265
			},
266
			abortOnConnectError=true,
267
			targetServers = 
268
			{
269
				--[[{
270
					targetUri="rtmp://x.xxxxxxx.fme.ustream.tv/ustreamVideo/xxxxxxx",
271
					targetStreamName="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
272
					localStreamName="gigi",
273
					emulateUserAgent="FMLE/3.0 (compatible; FMSc/1.0 http://www.rtmpd.com)"
274
				}]]--,
275
				{
276
					targetUri="rtmp://gigi:spaima@localhost/vod",
277
					targetStreamType="live", -- (live, record or append)
278
					emulateUserAgent="My user agent",
279
					localStreamName="stream1",
280
					keepAlive=true
281
				},
282
			},
283
			--[[externalStreams = 
284
			{
285
				{
286
					uri="rtsp://fms20.mediadirect.ro/live2/realitatea/realitatea",
287
					localStreamName="stream1",
288
					forceTcp=true,
289
					keepAlive=true
290
				},
291
			},]]--
292
			--validateHandshake=true,
293
			--default=true,
294
		},
295
		{
296
			name="stresstest",
297
			description="Application for stressing a streaming server",
298
			protocol="dynamiclinklibrary",
299
			targetServer="localhost",
300
			targetApp="vod",
301
			active=false,
302
			--[[streams = 
303
			{
304
				"lg00","lg01","lg02","lg03","lg04","lg05","lg06","lg07","lg08",
305
				"lg09","lg10","lg11","lg12","lg13","lg14","lg15","lg16","lg17",
306
				"lg18","lg19","lg20","lg21","lg22","lg23","lg24","lg25","lg26",
307
				"lg27","lg28","lg29","lg30","lg31","lg32","lg33","lg34","lg35",
308
				"lg36","lg37","lg38","lg39","lg40","lg41","lg42","lg43","lg44",
309
				"lg45","lg46","lg47","lg48","lg49"
310
			},]]--
311
			streams = 
312
			{
313
				"mp4:lg.mp4"
314
			},
315
			numberOfConnections=10,
316
			randomAccessStreams=false
317
		},
318
		{
319
			name="applestreamingclient",
320
			description="Apple Streaming Client",
321
			protocol="dynamiclinklibrary",
322
			--[[acceptors = 
323
			{
324
				{
325
					ip="0.0.0.0",
326
					port=5544,
327
					protocol="inboundRtsp"
328
				}
329
			},]]--
330
			aliases=
331
			{
332
				"asc",
333
			},
334
			--validateHandshake=true,
335
			--default=true,
336
		},
337
		--[[{
338
			name="vmapp",
339
			description="An application demonstrating the use of virtual machines",
340
			protocol="dynamiclinklibrary",
341
			vmType="lua",
342
			script="flvplayback.lua",
343
			aliases=
344
			{
345
				"flvplayback1",
346
				"vod1"
347
			},
348
			acceptors=
349
			{
350
				{
351
					ip="0.0.0.0",
352
					port=6544,
353
					protocol="inboundTcpTs"
354
				}
355
			}
356
		},]]--
357
		--#INSERTION_MARKER# DO NOT REMOVE THIS. USED BY appscaffold SCRIPT.
358
	}
359
}
360

    
(4-4/5)