3 <title>LIBRTMP(
3):
</title></head>
6 <tr><td>LIBRTMP(
3)
<td align=
"center"><td align=
"right">LIBRTMP(
3)
9 <tr><td>RTMPDump v2.4
<td align=
"center">2011-
07-
20<td align=
"right">LIBRTMP(
3)
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.-->
17 librtmp
− RTMPDump Real-Time Messaging Protocol API
21 RTMPDump RTMP (librtmp, -lrtmp)
25 <b>#include
<librtmp/rtmp.h
></b>
28 <h3>DESCRIPTION
</h3><ul>
29 The Real-Time Messaging Protocol (RTMP) is used for streaming
30 multimedia content across a TCP/IP network. This API provides most client
31 functions and a few server functions needed to support RTMP, RTMP tunneled
32 in HTTP (RTMPT), encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and
33 tunneled variants of these encrypted types (RTMPTE, RTMPTS). The basic
34 RTMP specification has been published by Adobe but this API was
35 reverse-engineered without use of the Adobe specification. As such, it may
36 deviate from any published specifications but it usually duplicates the
37 actual behavior of the original Adobe clients.
39 The RTMPDump software package includes a basic client utility program
41 <a href=
"../man1/rtmpdump.1"><b>rtmpdump
</b></a>(
1),
42 some sample servers, and a library used to provide programmatic access
43 to the RTMP protocol. This man page gives an overview of the RTMP
44 library routines. These routines are found in the -lrtmp library. Many
45 other routines are also available, but they are not documented yet.
47 The basic interaction is as follows. A session handle is created using
51 All session parameters are provided using
52 <b>RTMP_SetupURL
</b>().
53 The network connection is established using
54 <b>RTMP_Connect
</b>(),
55 and then the RTMP session is established using
56 <b>RTMP_ConnectStream
</b>().
57 The stream is read using
59 A client can publish a stream by calling
60 <b>RTMP_EnableWrite
</b>()
65 after the session is established.
66 While a stream is playing it may be paused and unpaused using
68 The stream playback position can be moved using
72 returns
0 bytes, the stream is complete and may be closed using
74 The session handle is freed using
77 All data is transferred using FLV format. The basic session requires
78 an RTMP URL. The RTMP URL format is of the form
80 rtmp[t][e|s]://hostname[:port][/app[/playpath]]
83 Plain rtmp, as well as tunneled and encrypted sessions are supported.
85 Additional options may be specified by appending space-separated
86 key=value pairs to the URL. Special characters in values may need
87 to be escaped to prevent misinterpretation by the option parser.
88 The escape encoding uses a backslash followed by two hexadecimal digits
89 representing the ASCII value of the character. E.g., spaces must
90 be escaped as
<b>\
20</b> and backslashes must be escaped as
<b>\
5c
</b>.
96 <h4>Network Parameters
</h4><ul>
97 These options define how to connect to the media server.
100 <b>socks=
</b><i>host:port
</i>
102 Use the specified SOCKS4 proxy.
106 <h4>Connection Parameters
</h4><ul>
107 These options define the content of the RTMP Connect request packet.
108 If correct values are not provided, the media server will reject the
112 <b>app=
</b><i>name
</i>
114 Name of application to connect to on the RTMP server. Overrides
115 the app in the RTMP URL. Sometimes the librtmp URL parser cannot
116 determine the app name automatically, so it must be given explicitly
121 <b>tcUrl=
</b><i>url
</i>
123 URL of the target stream. Defaults to rtmp[t][e|s]://host[:port]/app.
127 <b>pageUrl=
</b><i>url
</i>
129 URL of the web page in which the media was embedded. By default no
134 <b>swfUrl=
</b><i>url
</i>
136 URL of the SWF player for the media. By default no value will be sent.
140 <b>flashVer=
</b><i>version
</i>
142 Version of the Flash plugin used to run the SWF player. The
143 default is
"LNX 10,0,32,18".
147 <b>conn=
</b><i>type:data
</i>
149 Append arbitrary AMF data to the Connect message. The type
150 must be B for Boolean, N for number, S for string, O for object, or Z
151 for null. For Booleans the data must be either
0 or
1 for FALSE or TRUE,
152 respectively. Likewise for Objects the data must be
0 or
1 to end or
153 begin an object, respectively. Data items in subobjects may be named, by
154 prefixing the type with 'N' and specifying the name before the value, e.g.
155 NB:myFlag:
1. This option may be used multiple times to construct arbitrary
158 conn=B:
1 conn=S:authMe conn=O:
1 conn=NN:code:
1.23 conn=NS:flag:ok conn=O:
0
163 <h4>Session Parameters
</h4><ul>
164 These options take effect after the Connect request has succeeded.
167 <b>playpath=
</b><i>path
</i>
169 Overrides the playpath parsed from the RTMP URL. Sometimes the
170 rtmpdump URL parser cannot determine the correct playpath
171 automatically, so it must be given explicitly using this option.
175 <b>playlist=
</b><i>0|
1</i>
177 If the value is
1 or TRUE, issue a set_playlist command before sending the
178 play command. The playlist will just contain the current playpath. If the
179 value is
0 or FALSE, the set_playlist command will not be sent. The
184 <b>live=
</b><i>0|
1</i>
186 Specify that the media is a live stream. No resuming or seeking in
187 live streams is possible.
191 <b>subscribe=
</b><i>path
</i>
193 Name of live stream to subscribe to. Defaults to
198 <b>start=
</b><i>num
</i>
202 seconds into the stream. Not valid for live streams.
206 <b>stop=
</b><i>num
</i>
210 seconds into the stream.
214 <b>buffer=
</b><i>num
</i>
218 milliseconds. The default is
30000.
222 <b>timeout=
</b><i>num
</i>
224 Timeout the session after
226 seconds without receiving any data from the server. The default is
120.
230 <h4>Security Parameters
</h4><ul>
231 These options handle additional authentication requests from the server.
234 <b>token=
</b><i>key
</i>
236 Key for SecureToken response, used if the server requires SecureToken
241 <b>jtv=
</b><i>JSON
</i>
243 JSON token used by legacy Justin.tv servers. Invokes NetStream.Authenticate.UsherToken
247 <b>swfVfy=
</b><i>0|
1</i>
249 If the value is
1 or TRUE, the SWF player is retrieved from the
252 for performing SWF Verification. The SWF hash and size (used in the
253 verification step) are computed automatically. Also the SWF information is
256 file in the user's home directory, so that it doesn't need to be retrieved
257 and recalculated every time. The .swfinfo file records
258 the SWF URL, the time it was fetched, the modification timestamp of the SWF
259 file, its size, and its hash. By default, the cached info will be used
260 for
30 days before re-checking.
264 <b>swfAge=
</b><i>days
</i>
266 Specify how many days to use the cached SWF info before re-checking. Use
267 0 to always check the SWF URL. Note that if the check shows that the
268 SWF file has the same modification timestamp as before, it will not be
273 <h3>EXAMPLES
</h3><ul>
274 An example character string suitable for use with
275 <b>RTMP_SetupURL
</b>():
277 "rtmp://flashserver:1935/ondemand/thefile swfUrl=<a href="http://flashserver/player.swf
">http://flashserver/player.swf</a> swfVfy=1"
281 <h3>ENVIRONMENT
</h3><ul>
288 is used as the location for the
297 <i>$HOME/.swfinfo
</i>
299 Cache of SWF Verification information
303 <h3>SEE ALSO
</h3><ul>
304 <a href=
"../man1/rtmpdump.1"><b>rtmpdump
</b></a>(
1),
305 <a href=
"../man8/rtmpgw.8"><b>rtmpgw
</b></a>(
8)
309 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team
311 <<a href=
"http://rtmpdump.mplayerhq.hu">http://rtmpdump.mplayerhq.hu
</a>>
312 </ul></tbody></table></html>