Fix issue 1/7 from LMX of Qihoo 360 Codesafe Team
[rtmpdump.git] / rtmpgw.8.html
blob68d6734a677a91fd2df8c58a8ff648ca6e4551ea
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>
16 <h3>NAME</h3><ul>
17 rtmpgw &minus; RTMP streaming media gateway
18 </ul>
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>
58 <h3>DESCRIPTION</h3><ul>
59 <b>rtmpgw</b>
60 is a server for streaming media content from RTMP out to HTTP.
61 <p>
62 <b>rtmpgw</b>
63 listens for HTTP requests that specify RTMP stream parameters and
64 then returns the RTMP data in the HTTP response. The only valid
65 HTTP request is "GET /" but additional options can be provided
66 in URL-encoded fashion. Options specified on the command line will
67 be used as defaults, which can be overridden by options in the HTTP
68 request.
69 </ul>
71 <h3>OPTIONS</h3><ul>
72 </ul>
74 <h4>Network Parameters</h4><ul>
75 These 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>
80 URL 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>
86 Overrides 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>
92 Overrides 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>
98 Overrides 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>
109 <dl compact><dt>
110 <b>&minus;&minus;socks &minus;S</b>&nbsp;<i>host:port</i>
111 <dd>
112 Use the specified SOCKS4 proxy.
113 </dl>
114 </ul>
116 <h4>Connection Parameters</h4><ul>
117 These options define the content of the RTMP Connect request packet.
118 If correct values are not provided, the media server will reject the
119 connection attempt.
121 <dl compact><dt>
122 <b>&minus;&minus;app &minus;a</b>&nbsp;<i>app</i>
123 <dd>
124 Name of application to connect to on the RTMP server. Overrides
125 the app in the RTMP URL. Sometimes the rtmpdump URL parser cannot
126 determine the app name automatically, so it must be given explicitly
127 using this option.
128 </dl>
130 <dl compact><dt>
131 <b>&minus;&minus;tcUrl &minus;t</b>&nbsp;<i>url</i>
132 <dd>
133 URL of the target stream. Defaults to rtmp[e]://host[:port]/app/playpath.
134 </dl>
136 <dl compact><dt>
137 <b>&minus;&minus;pageUrl &minus;p</b>&nbsp;<i>url</i>
138 <dd>
139 URL of the web page in which the media was embedded. By default no
140 value will be sent.
141 </dl>
143 <dl compact><dt>
144 <b>&minus;&minus;swfUrl &minus;s</b>&nbsp;<i>url</i>
145 <dd>
146 URL of the SWF player for the media. By default no value will be sent.
147 </dl>
149 <dl compact><dt>
150 <b>&minus;&minus;flashVer &minus;f</b>&nbsp;<i>version</i>
151 <dd>
152 Version of the Flash plugin used to run the SWF player. The
153 default is "LNX 10,0,32,18".
154 </dl>
156 <dl compact><dt>
157 <b>&minus;&minus;auth &minus;u</b>&nbsp;<i>string</i>
158 <dd>
159 An authentication string to be appended to the Connect message. Using
160 this option will append a Boolean TRUE and then the specified string.
161 This option is only used by some particular servers and is
162 deprecated. The more general
163 <b>&minus;&minus;conn</b>
164 option should be used instead.
165 </dl>
167 <dl compact><dt>
168 <b>&minus;&minus;conn &minus;C</b>&nbsp;<i>type:data</i>
169 <dd>
170 Append arbitrary AMF data to the Connect message. The type
171 must be B for Boolean, N for number, S for string, O for object, or Z
172 for null. For Booleans the data must be either 0 or 1 for FALSE or TRUE,
173 respectively. Likewise for Objects the data must be 0 or 1 to end or
174 begin an object, respectively. Data items in subobjects may be named, by
175 prefixing the type with 'N' and specifying the name before the value, e.g.
176 NB:myFlag:1. This option may be used multiple times to construct arbitrary
177 AMF 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>
184 <h4>Session Parameters</h4><ul>
185 These options take effect after the Connect request has succeeded.
187 <dl compact><dt>
188 <b>&minus;&minus;playpath &minus;y</b>&nbsp;<i>path</i>
189 <dd>
190 Overrides the playpath parsed from the RTMP URL. Sometimes the
191 rtmpdump URL parser cannot determine the correct playpath
192 automatically, so it must be given explicitly using this option.
193 </dl>
195 <dl compact><dt>
196 <b>&minus;&minus;live &minus;v</b>
197 <dd>
198 Specify that the media is a live stream. No resuming or seeking in
199 live streams is possible.
200 </dl>
202 <dl compact><dt>
203 <b>&minus;&minus;subscribe &minus;d</b>&nbsp;<i>stream</i>
204 <dd>
205 Name of live stream to subscribe to. Defaults to
206 <i>playpath</i>.
207 </dl>
209 <dl compact><dt>
210 <b>&minus;&minus;start &minus;A</b>&nbsp;<i>num</i>
211 <dd>
212 Start at
213 <i>num</i>
214 seconds into the stream. Not valid for live streams.
215 </dl>
217 <dl compact><dt>
218 <b>&minus;&minus;stop &minus;B</b>&nbsp;<i>num</i>
219 <dd>
220 Stop at
221 <i>num</i>
222 seconds into the stream.
223 </dl>
225 <dl compact><dt>
226 <b>&minus;&minus;buffer &minus;b</b>&nbsp;<i>num</i>
227 <dd>
228 Set buffer time to
229 <i>num</i>
230 milliseconds. The default is 20000.
231 </dl>
233 <dl compact><dt>
234 <b>&minus;&minus;timeout &minus;m</b>&nbsp;<i>num</i>
235 <dd>
236 Timeout the session after
237 <i>num</i>
238 seconds without receiving any data from the server. The default is 120.
239 </dl>
240 </ul>
242 <h4>Security Parameters</h4><ul>
243 These options handle additional authentication requests from the server.
245 <dl compact><dt>
246 <b>&minus;&minus;token &minus;T</b>&nbsp;<i>key</i>
247 <dd>
248 Key for SecureToken response, used if the server requires SecureToken
249 authentication.
250 </dl>
252 <dl compact><dt>
253 <b>&minus;&minus;jtv &minus;j</b>&nbsp;<i>JSON</i>
254 <dd>
255 JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken
256 </dl>
258 <dl compact><dt>
259 <b>&minus;&minus;swfhash &minus;w</b>&nbsp;<i>hexstring</i>
260 <dd>
261 SHA256 hash of the decompressed SWF file. This option may be needed if
262 the server uses SWF Verification, but see the
263 <b>&minus;&minus;swfVfy</b>
264 option below. The hash is 32 bytes, and must be
265 given in hexadecimal. The
266 <b>&minus;&minus;swfsize</b>
267 option must always be used with this option.
268 </dl>
270 <dl compact><dt>
271 <b>&minus;&minus;swfsize &minus;x</b>&nbsp;<i>num</i>
272 <dd>
273 Size of the decompressed SWF file. This option may be needed if the
274 server uses SWF Verification, but see the
275 <b>&minus;&minus;swfVfy</b>
276 option below. The
277 <b>&minus;&minus;swfhash</b>
278 option must always be used with this option.
279 </dl>
281 <dl compact><dt>
282 <b>&minus;&minus;swfVfy &minus;W</b>&nbsp;<i>url</i>
283 <dd>
284 URL of the SWF player for this media. This option replaces all three
285 of the
286 <b>&minus;&minus;swfUrl</b>,
287 <b>&minus;&minus;swfhash</b>,
289 <b>&minus;&minus;swfsize</b>
290 options. When this option is used, the SWF player is retrieved from the
291 specified URL and the hash and size are computed automatically. Also
292 the information is cached in a
293 <i>.swfinfo</i>
294 file in the user's home directory, so that it doesn't need to be retrieved
295 and recalculated every time rtmpdump is run. The .swfinfo file records
296 the URL, the time it was fetched, the modification timestamp of the SWF
297 file, its size, and its hash. By default, the cached info will be used
298 for 30 days before re-checking.
299 </dl>
301 <dl compact><dt>
302 <b>&minus;&minus;swfAge &minus;X</b>&nbsp;<i>days</i>
303 <dd>
304 Specify how many days to use the cached SWF info before re-checking. Use
305 0 to always check the SWF URL. Note that if the check shows that the
306 SWF file has the same modification timestamp as before, it will not be
307 retrieved again.
308 </dl>
309 </ul>
311 <h4>Miscellaneous</h4><ul>
313 <dl compact><dt>
314 <b>&minus;&minus;device &minus;D</b>&nbsp;<i>address</i>
315 <dd>
316 Listener IP address. The default is 0.0.0.0, i.e., any IP address.
317 </dl>
319 <dl compact><dt>
320 <b>&minus;&minus;sport &minus;g</b>&nbsp;<i>port</i>
321 <dd>
322 Listener port. The default is 80.
323 </dl>
325 <dl compact><dt>
326 <b>&minus;&minus;quiet &minus;q</b>
327 <dd>
328 Suppress all command output.
329 </dl>
331 <dl compact><dt>
332 <b>&minus;&minus;verbose &minus;V</b>
333 <dd>
334 Verbose command output.
335 </dl>
337 <dl compact><dt>
338 <b>&minus;&minus;debug &minus;z</b>
339 <dd>
340 Debug level output. Extremely verbose, including hex dumps of all packet data.
341 </dl>
343 <dl compact><dt>
344 <b>&minus;&minus;help &minus;h</b>
345 <dd>
346 Print a summary of command options.
347 </dl>
348 </ul>
350 <h3>EXAMPLES</h3><ul>
351 The HTTP request
352 <pre>
353 GET /?r=rtmp:%2f%2fserver%2fmyapp&y=somefile HTTP/1.0
354 </pre>
355 is equivalent to the
356 <a href="../man1/rtrmpdump.1"><b>rtrmpdump</b></a>(1)
357 invocation
358 <pre>
359 rtmpdump &minus;r rtmp://server/myapp &minus;y somefile
360 </pre>
362 Note that only the shortform (single letter) options are supported.
363 </ul>
365 <h3>ENVIRONMENT</h3><ul>
367 <dl compact><dt>
368 <b>HOME</b>
369 <dd>
370 The value of
371 $<b>HOME</b>
372 is used as the location for the
373 <i>.swfinfo</i>
374 file.
375 </dl>
376 </ul>
378 <h3>FILES</h3><ul>
380 <dl compact><dt>
381 <i>$HOME/.swfinfo</i>
382 <dd>
383 Cache of SWF Verification information
384 </dl>
385 </ul>
387 <h3>SEE ALSO</h3><ul>
388 <a href="../man1/rtmpdump.1"><b>rtmpdump</b></a>(1)
389 </ul>
391 <h3>AUTHORS</h3><ul>
392 Andrej 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>