1<HTML>
2<HEAD>
3<title>RTMPGW(8): </title></head>
4<table>
5<thead>
6<tr><td>RTMPGW(8)<td align="center"><td align="right">RTMPGW(8)
7</thead>
8<tfoot>
9<tr><td>RTMPDump v2.4<td align="center">2011-07-20<td align="right">RTMPGW(8)
10</tfoot>
11<tbody><tr><td colspan="3"><br><br><ul>
12<!-- Copyright 2011 Howard Chu.
13 Copying permitted according to the GNU General Public License V2.-->
14</ul>
15
16<h3>NAME</h3><ul>
17rtmpgw &minus; RTMP streaming media gateway
18</ul>
19
20<h3>SYNOPSIS</h3><ul>
21<b>rtmpgw</b>
22[<b>&minus;r</b><i>&nbsp;url</i>]
23[<b>&minus;n</b><i>&nbsp;hostname</i>]
24[<b>&minus;c</b><i>&nbsp;port</i>]
25[<b>&minus;l</b><i>&nbsp;protocol</i>]
26[<b>&minus;S</b><i>&nbsp;host:port</i>]
27[<b>&minus;a</b><i>&nbsp;app</i>]
28[<b>&minus;t</b><i>&nbsp;tcUrl</i>]
29[<b>&minus;p</b><i>&nbsp;pageUrl</i>]
30[<b>&minus;s</b><i>&nbsp;swfUrl</i>]
31[<b>&minus;f</b><i>&nbsp;flashVer</i>]
32[<b>&minus;u</b><i>&nbsp;auth</i>]
33[<b>&minus;C</b><i>&nbsp;conndata</i>]
34[<b>&minus;y</b><i>&nbsp;playpath</i>]
35[<b>&minus;v</b>]
36[<b>&minus;d</b><i>&nbsp;subscription</i>]
37[<b>&minus;e</b>]
38[<b>&minus;k</b><i>&nbsp;skip</i>]
39[<b>&minus;A</b><i>&nbsp;start</i>]
40[<b>&minus;B</b><i>&nbsp;stop</i>]
41[<b>&minus;b</b><i>&nbsp;buffer</i>]
42[<b>&minus;m</b><i>&nbsp;timeout</i>]
43[<b>&minus;T</b><i>&nbsp;key</i>]
44[<b>&minus;j</b><i>&nbsp;JSON</i>]
45[<b>&minus;w</b><i>&nbsp;swfHash</i>]
46[<b>&minus;x</b><i>&nbsp;swfSize</i>]
47[<b>&minus;W</b><i>&nbsp;swfUrl</i>]
48[<b>&minus;X</b><i>&nbsp;swfAge</i>]
49[<b>&minus;D</b><i>&nbsp;address</i>]
50[<b>&minus;g</b><i>&nbsp;port</i>]
51[<b>&minus;q</b>]
52[<b>&minus;V</b>]
53[<b>&minus;z</b>]
54<br>
55<b>rtmpgw &minus;h</b>
56</ul>
57
58<h3>DESCRIPTION</h3><ul>
59<b>rtmpgw</b>
60is a server for streaming media content from RTMP out to HTTP.
61<p>
62<b>rtmpgw</b>
63listens for HTTP requests that specify RTMP stream parameters and
64then returns the RTMP data in the HTTP response. The only valid
65HTTP request is "GET /" but additional options can be provided
66in URL-encoded fashion. Options specified on the command line will
67be used as defaults, which can be overridden by options in the HTTP
68request.
69</ul>
70
71<h3>OPTIONS</h3><ul>
72</ul>
73
74<h4>Network Parameters</h4><ul>
75These options define how to connect to the media server.
76<p>
77<dl compact><dt>
78<b>&minus;&minus;rtmp		&minus;r</b>&nbsp;<i>url</i>
79<dd>
80URL of the server and media content.
81</dl>
82<p>
83<dl compact><dt>
84<b>&minus;&minus;host		&minus;n</b>&nbsp;<i>hostname</i>
85<dd>
86Overrides the hostname in the RTMP URL.
87</dl>
88<p>
89<dl compact><dt>
90<b>&minus;&minus;port		&minus;c</b>&nbsp;<i>port</i>
91<dd>
92Overrides the port number in the RTMP URL.
93</dl>
94<p>
95<dl compact><dt>
96<b>&minus;&minus;protocol	&minus;l</b>&nbsp;<i>number</i>
97<dd>
98Overrides the protocol in the RTMP URL.
99<pre>
100  0 = rtmp
101  1 = rtmpt
102  2 = rtmpe
103  3 = rtmpte
104  4 = rtmps
105  5 = rtmpts
106</pre>
107</dl>
108<p>
109<dl compact><dt>
110<b>&minus;&minus;socks		&minus;S</b>&nbsp;<i>host:port</i>
111<dd>
112Use the specified SOCKS4 proxy.
113</dl>
114</ul>
115
116<h4>Connection Parameters</h4><ul>
117These options define the content of the RTMP Connect request packet.
118If correct values are not provided, the media server will reject the
119connection attempt.
120<p>
121<dl compact><dt>
122<b>&minus;&minus;app		&minus;a</b>&nbsp;<i>app</i>
123<dd>
124Name of application to connect to on the RTMP server. Overrides
125the app in the RTMP URL. Sometimes the rtmpdump URL parser cannot
126determine the app name automatically, so it must be given explicitly
127using this option.
128</dl>
129<p>
130<dl compact><dt>
131<b>&minus;&minus;tcUrl		&minus;t</b>&nbsp;<i>url</i>
132<dd>
133URL of the target stream. Defaults to rtmp[e]://host[:port]/app/playpath.
134</dl>
135<p>
136<dl compact><dt>
137<b>&minus;&minus;pageUrl		&minus;p</b>&nbsp;<i>url</i>
138<dd>
139URL of the web page in which the media was embedded. By default no
140value will be sent.
141</dl>
142<p>
143<dl compact><dt>
144<b>&minus;&minus;swfUrl		&minus;s</b>&nbsp;<i>url</i>
145<dd>
146URL of the SWF player for the media. By default no value will be sent.
147</dl>
148<p>
149<dl compact><dt>
150<b>&minus;&minus;flashVer	&minus;f</b>&nbsp;<i>version</i>
151<dd>
152Version of the Flash plugin used to run the SWF player. The
153default is "LNX 10,0,32,18".
154</dl>
155<p>
156<dl compact><dt>
157<b>&minus;&minus;auth		&minus;u</b>&nbsp;<i>string</i>
158<dd>
159An authentication string to be appended to the Connect message. Using
160this option will append a Boolean TRUE and then the specified string.
161This option is only used by some particular servers and is
162deprecated. The more general
163<b>&minus;&minus;conn</b>
164option should be used instead.
165</dl>
166<p>
167<dl compact><dt>
168<b>&minus;&minus;conn		&minus;C</b>&nbsp;<i>type:data</i>
169<dd>
170Append arbitrary AMF data to the Connect message. The type
171must be B for Boolean, N for number, S for string, O for object, or Z
172for null. For Booleans the data must be either 0 or 1 for FALSE or TRUE,
173respectively. Likewise for Objects the data must be 0 or 1 to end or
174begin an object, respectively. Data items in subobjects may be named, by
175prefixing the type with 'N' and specifying the name before the value, e.g.
176NB:myFlag:1. This option may be used multiple times to construct arbitrary
177AMF sequences. E.g.
178<pre>
179  &minus;C B:1 &minus;C S:authMe &minus;C O:1 &minus;C NN:code:1.23 &minus;C NS:flag:ok &minus;C O:0
180</pre>
181</dl>
182</ul>
183
184<h4>Session Parameters</h4><ul>
185These options take effect after the Connect request has succeeded.
186<p>
187<dl compact><dt>
188<b>&minus;&minus;playpath	&minus;y</b>&nbsp;<i>path</i>
189<dd>
190Overrides the playpath parsed from the RTMP URL. Sometimes the
191rtmpdump URL parser cannot determine the correct playpath
192automatically, so it must be given explicitly using this option.
193</dl>
194<p>
195<dl compact><dt>
196<b>&minus;&minus;live &minus;v</b>
197<dd>
198Specify that the media is a live stream. No resuming or seeking in
199live streams is possible.
200</dl>
201<p>
202<dl compact><dt>
203<b>&minus;&minus;subscribe	&minus;d</b>&nbsp;<i>stream</i>
204<dd>
205Name of live stream to subscribe to. Defaults to
206<i>playpath</i>.
207</dl>
208<p>
209<dl compact><dt>
210<b>&minus;&minus;start		&minus;A</b>&nbsp;<i>num</i>
211<dd>
212Start at
213<i>num</i>
214seconds into the stream. Not valid for live streams.
215</dl>
216<p>
217<dl compact><dt>
218<b>&minus;&minus;stop		&minus;B</b>&nbsp;<i>num</i>
219<dd>
220Stop at
221<i>num</i>
222seconds into the stream.
223</dl>
224<p>
225<dl compact><dt>
226<b>&minus;&minus;buffer		&minus;b</b>&nbsp;<i>num</i>
227<dd>
228Set buffer time to
229<i>num</i>
230milliseconds. The default is 20000.
231</dl>
232<p>
233<dl compact><dt>
234<b>&minus;&minus;timeout		&minus;m</b>&nbsp;<i>num</i>
235<dd>
236Timeout the session after
237<i>num</i>
238seconds without receiving any data from the server. The default is 120.
239</dl>
240</ul>
241
242<h4>Security Parameters</h4><ul>
243These options handle additional authentication requests from the server.
244<p>
245<dl compact><dt>
246<b>&minus;&minus;token		&minus;T</b>&nbsp;<i>key</i>
247<dd>
248Key for SecureToken response, used if the server requires SecureToken
249authentication.
250</dl>
251<p>
252<dl compact><dt>
253<b>&minus;&minus;jtv		&minus;j</b>&nbsp;<i>JSON</i>
254<dd>
255JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken
256</dl>
257<p>
258<dl compact><dt>
259<b>&minus;&minus;swfhash		&minus;w</b>&nbsp;<i>hexstring</i>
260<dd>
261SHA256 hash of the decompressed SWF file. This option may be needed if
262the server uses SWF Verification, but see the
263<b>&minus;&minus;swfVfy</b>
264option below. The hash is 32 bytes, and must be
265given in hexadecimal. The
266<b>&minus;&minus;swfsize</b>
267option must always be used with this option.
268</dl>
269<p>
270<dl compact><dt>
271<b>&minus;&minus;swfsize		&minus;x</b>&nbsp;<i>num</i>
272<dd>
273Size of the decompressed SWF file. This option may be needed if the
274server uses SWF Verification, but see the
275<b>&minus;&minus;swfVfy</b>
276option below. The
277<b>&minus;&minus;swfhash</b>
278option must always be used with this option.
279</dl>
280<p>
281<dl compact><dt>
282<b>&minus;&minus;swfVfy		&minus;W</b>&nbsp;<i>url</i>
283<dd>
284URL of the SWF player for this media. This option replaces all three
285of the
286<b>&minus;&minus;swfUrl</b>,
287<b>&minus;&minus;swfhash</b>,
288and
289<b>&minus;&minus;swfsize</b>
290options. When this option is used, the SWF player is retrieved from the
291specified URL and the hash and size are computed automatically. Also
292the information is cached in a
293<i>.swfinfo</i>
294file in the user's home directory, so that it doesn't need to be retrieved
295and recalculated every time rtmpdump is run. The .swfinfo file records
296the URL, the time it was fetched, the modification timestamp of the SWF
297file, its size, and its hash. By default, the cached info will be used
298for 30 days before re-checking.
299</dl>
300<p>
301<dl compact><dt>
302<b>&minus;&minus;swfAge		&minus;X</b>&nbsp;<i>days</i>
303<dd>
304Specify how many days to use the cached SWF info before re-checking. Use
3050 to always check the SWF URL. Note that if the check shows that the
306SWF file has the same modification timestamp as before, it will not be
307retrieved again.
308</dl>
309</ul>
310
311<h4>Miscellaneous</h4><ul>
312<p>
313<dl compact><dt>
314<b>&minus;&minus;device		&minus;D</b>&nbsp;<i>address</i>
315<dd>
316Listener IP address. The default is 0.0.0.0, i.e., any IP address.
317</dl>
318<p>
319<dl compact><dt>
320<b>&minus;&minus;sport		&minus;g</b>&nbsp;<i>port</i>
321<dd>
322Listener port. The default is 80.
323</dl>
324<p>
325<dl compact><dt>
326<b>&minus;&minus;quiet &minus;q</b>
327<dd>
328Suppress all command output.
329</dl>
330<p>
331<dl compact><dt>
332<b>&minus;&minus;verbose &minus;V</b>
333<dd>
334Verbose command output.
335</dl>
336<p>
337<dl compact><dt>
338<b>&minus;&minus;debug &minus;z</b>
339<dd>
340Debug level output. Extremely verbose, including hex dumps of all packet data.
341</dl>
342<p>
343<dl compact><dt>
344<b>&minus;&minus;help &minus;h</b>
345<dd>
346Print a summary of command options.
347</dl>
348</ul>
349
350<h3>EXAMPLES</h3><ul>
351The HTTP request
352<pre>
353	GET /?r=rtmp:%2f%2fserver%2fmyapp&y=somefile HTTP/1.0
354</pre>
355is equivalent to the
356<a href="../man1/rtrmpdump.1"><b>rtrmpdump</b></a>(1)
357invocation
358<pre>
359	rtmpdump &minus;r rtmp://server/myapp &minus;y somefile
360</pre>
361<p>
362Note that only the shortform (single letter) options are supported.
363</ul>
364
365<h3>ENVIRONMENT</h3><ul>
366<p>
367<dl compact><dt>
368<b>HOME</b>
369<dd>
370The value of
371$<b>HOME</b>
372is used as the location for the
373<i>.swfinfo</i>
374file.
375</dl>
376</ul>
377
378<h3>FILES</h3><ul>
379<p>
380<dl compact><dt>
381<i>$HOME/.swfinfo</i>
382<dd>
383Cache of SWF Verification information
384</dl>
385</ul>
386
387<h3>SEE ALSO</h3><ul>
388<a href="../man1/rtmpdump.1"><b>rtmpdump</b></a>(1)
389</ul>
390
391<h3>AUTHORS</h3><ul>
392Andrej Stepanchuk, Howard Chu, The Flvstreamer Team
393<br>
394&lt;<a href="http://rtmpdump.mplayerhq.hu">http://rtmpdump.mplayerhq.hu</a>>
395</ul></tbody></table></html>
396