Don't do strchr on a string that isn't necessarily null-terminated
[rtmpdump.git] / rtmpgw.8
blob0a231b41b0b6c765f19bc0a4176d5e7b144b8d51
1 .TH RTMPGW 8 "2011-07-20" "RTMPDump v2.4"
2 .\" Copyright 2011 Howard Chu.
3 .\" Copying permitted according to the GNU General Public License V2.
4 .SH NAME
5 rtmpgw \- RTMP streaming media gateway
6 .SH SYNOPSIS
7 .B rtmpgw
8 [\c
9 .BI \-r \ url\fR]
10 [\c
11 .BI \-n \ hostname\fR]
12 [\c
13 .BI \-c \ port\fR]
14 [\c
15 .BI \-l \ protocol\fR]
16 [\c
17 .BI \-S \ host:port\fR]
18 [\c
19 .BI \-a \ app\fR]
20 [\c
21 .BI \-t \ tcUrl\fR]
22 [\c
23 .BI \-p \ pageUrl\fR]
24 [\c
25 .BI \-s \ swfUrl\fR]
26 [\c
27 .BI \-f \ flashVer\fR]
28 [\c
29 .BI \-u \ auth\fR]
30 [\c
31 .BI \-C \ conndata\fR]
32 [\c
33 .BI \-y \ playpath\fR]
34 [\c
35 .BR \-v ]
36 [\c
37 .BI \-d \ subscription\fR]
38 [\c
39 .BR \-e ]
40 [\c
41 .BI \-k \ skip\fR]
42 [\c
43 .BI \-A \ start\fR]
44 [\c
45 .BI \-B \ stop\fR]
46 [\c
47 .BI \-b \ buffer\fR]
48 [\c
49 .BI \-m \ timeout\fR]
50 [\c
51 .BI \-T \ key\fR]
52 [\c
53 .BI \-j \ JSON\fR]
54 [\c
55 .BI \-w \ swfHash\fR]
56 [\c
57 .BI \-x \ swfSize\fR]
58 [\c
59 .BI \-W \ swfUrl\fR]
60 [\c
61 .BI \-X \ swfAge\fR]
62 [\c
63 .BI \-D \ address\fR]
64 [\c
65 .BI \-g \ port\fR]
66 [\c
67 .BR \-q ]
68 [\c
69 .BR \-V ]
70 [\c
71 .BR \-z ]
72 .br
73 .B rtmpgw \-h
74 .SH DESCRIPTION
75 .B rtmpgw
76 is a server for streaming media content from RTMP out to HTTP.
77 .LP
78 .B rtmpgw
79 listens for HTTP requests that specify RTMP stream parameters and
80 then returns the RTMP data in the HTTP response. The only valid
81 HTTP request is "GET /" but additional options can be provided
82 in URL-encoded fashion. Options specified on the command line will
83 be used as defaults, which can be overridden by options in the HTTP
84 request.
85 .SH OPTIONS
86 .SS "Network Parameters"
87 These options define how to connect to the media server.
88 .TP
89 \fB\-\-rtmp             \-r\fP\ \fIurl\fP
90 URL of the server and media content.
91 .TP
92 \fB\-\-host             \-n\fP\ \fIhostname\fP
93 Overrides the hostname in the RTMP URL.
94 .TP
95 \fB\-\-port             \-c\fP\ \fIport\fP
96 Overrides the port number in the RTMP URL.
97 .TP
98 \fB\-\-protocol \-l\fP\ \fInumber\fP
99 Overrides the protocol in the RTMP URL.
101   0 = rtmp
102   1 = rtmpt
103   2 = rtmpe
104   3 = rtmpte
105   4 = rtmps
106   5 = rtmpts
109 \fB\-\-socks            \-S\fP\ \fIhost:port\fP
110 Use the specified SOCKS4 proxy.
111 .SS "Connection Parameters"
112 These options define the content of the RTMP Connect request packet.
113 If correct values are not provided, the media server will reject the
114 connection attempt.
116 \fB\-\-app              \-a\fP\ \fIapp\fP
117 Name of application to connect to on the RTMP server. Overrides
118 the app in the RTMP URL. Sometimes the rtmpdump URL parser cannot
119 determine the app name automatically, so it must be given explicitly
120 using this option.
122 \fB\-\-tcUrl            \-t\fP\ \fIurl\fP
123 URL of the target stream. Defaults to rtmp[e]://host[:port]/app/playpath.
125 \fB\-\-pageUrl          \-p\fP\ \fIurl\fP
126 URL of the web page in which the media was embedded. By default no
127 value will be sent.
129 \fB\-\-swfUrl           \-s\fP\ \fIurl\fP
130 URL of the SWF player for the media. By default no value will be sent.
132 \fB\-\-flashVer \-f\fP\ \fIversion\fP
133 Version of the Flash plugin used to run the SWF player. The
134 default is "LNX 10,0,32,18".
136 \fB\-\-auth             \-u\fP\ \fIstring\fP
137 An authentication string to be appended to the Connect message. Using
138 this option will append a Boolean TRUE and then the specified string.
139 This option is only used by some particular servers and is
140 deprecated. The more general
141 .B \-\-conn
142 option should be used instead.
144 \fB\-\-conn             \-C\fP\ \fItype:data\fP
145 Append arbitrary AMF data to the Connect message. The type
146 must be B for Boolean, N for number, S for string, O for object, or Z
147 for null. For Booleans the data must be either 0 or 1 for FALSE or TRUE,
148 respectively. Likewise for Objects the data must be 0 or 1 to end or
149 begin an object, respectively. Data items in subobjects may be named, by
150 prefixing the type with 'N' and specifying the name before the value, e.g.
151 NB:myFlag:1. This option may be used multiple times to construct arbitrary
152 AMF sequences. E.g.
154   \-C B:1 \-C S:authMe \-C O:1 \-C NN:code:1.23 \-C NS:flag:ok \-C O:0
156 .SS "Session Parameters"
157 These options take effect after the Connect request has succeeded.
159 \fB\-\-playpath \-y\fP\ \fIpath\fP
160 Overrides the playpath parsed from the RTMP URL. Sometimes the
161 rtmpdump URL parser cannot determine the correct playpath
162 automatically, so it must be given explicitly using this option.
164 .B \-\-live             \-v
165 Specify that the media is a live stream. No resuming or seeking in
166 live streams is possible.
168 \fB\-\-subscribe        \-d\fP\ \fIstream\fP
169 Name of live stream to subscribe to. Defaults to
170 .IR playpath .
172 \fB\-\-start            \-A\fP\ \fInum\fP
173 Start at
174 .I num
175 seconds into the stream. Not valid for live streams.
177 \fB\-\-stop             \-B\fP\ \fInum\fP
178 Stop at
179 .I num
180 seconds into the stream.
182 \fB\-\-buffer           \-b\fP\ \fInum\fP
183 Set buffer time to
184 .I num
185 milliseconds. The default is 20000.
187 \fB\-\-timeout          \-m\fP\ \fInum\fP
188 Timeout the session after
189 .I num
190 seconds without receiving any data from the server. The default is 120.
191 .SS "Security Parameters"
192 These options handle additional authentication requests from the server.
194 \fB\-\-token            \-T\fP\ \fIkey\fP
195 Key for SecureToken response, used if the server requires SecureToken
196 authentication.
198 \fB\-\-jtv              \-j\fP\ \fIJSON\fP
199 JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken
201 \fB\-\-swfhash          \-w\fP\ \fIhexstring\fP
202 SHA256 hash of the decompressed SWF file. This option may be needed if
203 the server uses SWF Verification, but see the
204 .B \-\-swfVfy
205 option below. The hash is 32 bytes, and must be
206 given in hexadecimal. The
207 .B \-\-swfsize
208 option must always be used with this option.
210 \fB\-\-swfsize          \-x\fP\ \fInum\fP
211 Size of the decompressed SWF file. This option may be needed if the
212 server uses SWF Verification, but see the
213 .B \-\-swfVfy
214 option below. The
215 .B \-\-swfhash
216 option must always be used with this option.
218 \fB\-\-swfVfy           \-W\fP\ \fIurl\fP
219 URL of the SWF player for this media. This option replaces all three
220 of the
221 .BR \-\-swfUrl ,
222 .BR \-\-swfhash ,
224 .B \-\-swfsize
225 options. When this option is used, the SWF player is retrieved from the
226 specified URL and the hash and size are computed automatically. Also
227 the information is cached in a
228 .I .swfinfo
229 file in the user's home directory, so that it doesn't need to be retrieved
230 and recalculated every time rtmpdump is run. The .swfinfo file records
231 the URL, the time it was fetched, the modification timestamp of the SWF
232 file, its size, and its hash. By default, the cached info will be used
233 for 30 days before re-checking.
235 \fB\-\-swfAge           \-X\fP\ \fIdays\fP
236 Specify how many days to use the cached SWF info before re-checking. Use
237 0 to always check the SWF URL. Note that if the check shows that the
238 SWF file has the same modification timestamp as before, it will not be
239 retrieved again.
240 .SS Miscellaneous
242 \fB\-\-device           \-D\fP\ \fIaddress\fP
243 Listener IP address. The default is 0.0.0.0, i.e., any IP address.
245 \fB\-\-sport            \-g\fP\ \fIport\fP
246 Listener port. The default is 80.
248 .B \-\-quiet            \-q
249 Suppress all command output.
251 .B \-\-verbose          \-V
252 Verbose command output.
254 .B \-\-debug            \-z
255 Debug level output. Extremely verbose, including hex dumps of all packet data.
257 .B \-\-help             \-h
258 Print a summary of command options.
259 .SH EXAMPLES
260 The HTTP request
262         GET /?r=rtmp:%2f%2fserver%2fmyapp&y=somefile HTTP/1.0
264 is equivalent to the
265 .BR rtrmpdump (1)
266 invocation
268         rtmpdump \-r rtmp://server/myapp \-y somefile
271 Note that only the shortform (single letter) options are supported.
272 .SH ENVIRONMENT
274 .B HOME
275 The value of
276 .RB $ HOME
277 is used as the location for the
278 .I .swfinfo
279 file.
280 .SH FILES
282 .I $HOME/.swfinfo
283 Cache of SWF Verification information
284 .SH "SEE ALSO"
285 .BR rtmpdump (1)
286 .SH AUTHORS
287 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team
289 <http://rtmpdump.mplayerhq.hu>