~siretart/libav/trusty

« back to all changes in this revision

Viewing changes to doc/protocols.texi

  • Committer: Reinhard Tartler
  • Date: 2013-10-23 03:04:17 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: siretart@tauware.de-20131023030417-1o6mpkl1l0raifjt
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
A description of the currently available protocols follows.
21
21
 
22
 
@section applehttp
23
 
 
24
 
Read Apple HTTP Live Streaming compliant segmented stream as
25
 
a uniform one. The M3U8 playlists describing the segments can be
26
 
remote HTTP resources or local files, accessed using the standard
27
 
file protocol.
28
 
HTTP is default, specific protocol can be declared by specifying
29
 
"+@var{proto}" after the applehttp URI scheme name, where @var{proto}
30
 
is either "file" or "http".
31
 
 
32
 
@example
33
 
applehttp://host/path/to/remote/resource.m3u8
34
 
applehttp+http://host/path/to/remote/resource.m3u8
35
 
applehttp+file://path/to/local/resource.m3u8
36
 
@end example
37
 
 
38
22
@section concat
39
23
 
40
24
Physical concatenation protocol.
52
36
protocol.
53
37
 
54
38
For example to read a sequence of files @file{split1.mpeg},
55
 
@file{split2.mpeg}, @file{split3.mpeg} with @file{avplay} use the
 
39
@file{split2.mpeg}, @file{split3.mpeg} with @command{avplay} use the
56
40
command:
57
41
@example
58
42
avplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
81
65
 
82
66
Gopher protocol.
83
67
 
 
68
@section hls
 
69
 
 
70
Read Apple HTTP Live Streaming compliant segmented stream as
 
71
a uniform one. The M3U8 playlists describing the segments can be
 
72
remote HTTP resources or local files, accessed using the standard
 
73
file protocol.
 
74
The nested protocol is declared by specifying
 
75
"+@var{proto}" after the hls URI scheme name, where @var{proto}
 
76
is either "file" or "http".
 
77
 
 
78
@example
 
79
hls+http://host/path/to/remote/resource.m3u8
 
80
hls+file://path/to/local/resource.m3u8
 
81
@end example
 
82
 
 
83
Using this protocol is discouraged - the hls demuxer should work
 
84
just as well (if not, please report the issues) and is more complete.
 
85
To use the hls demuxer instead, simply use the direct URLs to the
 
86
m3u8 files.
 
87
 
84
88
@section http
85
89
 
86
90
HTTP (Hyper Text Transfer Protocol).
160
164
 
161
165
The required syntax is:
162
166
@example
163
 
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
 
167
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
164
168
@end example
165
169
 
166
170
The accepted parameters are:
175
179
@item app
176
180
It is the name of the application to access. It usually corresponds to
177
181
the path where the application is installed on the RTMP server
178
 
(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.).
 
182
(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
 
183
the value parsed from the URI through the @code{rtmp_app} option, too.
179
184
 
180
185
@item playpath
181
186
It is the path or name of the resource to play with reference to the
182
 
application specified in @var{app}, may be prefixed by "mp4:".
183
 
 
184
 
@end table
185
 
 
186
 
For example to read with @file{avplay} a multimedia resource named
 
187
application specified in @var{app}, may be prefixed by "mp4:". You
 
188
can override the value parsed from the URI through the @code{rtmp_playpath}
 
189
option, too.
 
190
 
 
191
@item listen
 
192
Act as a server, listening for an incoming connection.
 
193
 
 
194
@item timeout
 
195
Maximum time to wait for the incoming connection. Implies listen.
 
196
@end table
 
197
 
 
198
Additionally, the following parameters can be set via command line options
 
199
(or in code via @code{AVOption}s):
 
200
@table @option
 
201
 
 
202
@item rtmp_app
 
203
Name of application to connect on the RTMP server. This option
 
204
overrides the parameter specified in the URI.
 
205
 
 
206
@item rtmp_buffer
 
207
Set the client buffer time in milliseconds. The default is 3000.
 
208
 
 
209
@item rtmp_conn
 
210
Extra arbitrary AMF connection parameters, parsed from a string,
 
211
e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
 
212
Each value is prefixed by a single character denoting the type,
 
213
B for Boolean, N for number, S for string, O for object, or Z for null,
 
214
followed by a colon. For Booleans the data must be either 0 or 1 for
 
215
FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
 
216
1 to end or begin an object, respectively. Data items in subobjects may
 
217
be named, by prefixing the type with 'N' and specifying the name before
 
218
the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
 
219
times to construct arbitrary AMF sequences.
 
220
 
 
221
@item rtmp_flashver
 
222
Version of the Flash plugin used to run the SWF player. The default
 
223
is LNX 9,0,124,2.
 
224
 
 
225
@item rtmp_flush_interval
 
226
Number of packets flushed in the same request (RTMPT only). The default
 
227
is 10.
 
228
 
 
229
@item rtmp_live
 
230
Specify that the media is a live stream. No resuming or seeking in
 
231
live streams is possible. The default value is @code{any}, which means the
 
232
subscriber first tries to play the live stream specified in the
 
233
playpath. If a live stream of that name is not found, it plays the
 
234
recorded stream. The other possible values are @code{live} and
 
235
@code{recorded}.
 
236
 
 
237
@item rtmp_pageurl
 
238
URL of the web page in which the media was embedded. By default no
 
239
value will be sent.
 
240
 
 
241
@item rtmp_playpath
 
242
Stream identifier to play or to publish. This option overrides the
 
243
parameter specified in the URI.
 
244
 
 
245
@item rtmp_subscribe
 
246
Name of live stream to subscribe to. By default no value will be sent.
 
247
It is only sent if the option is specified or if rtmp_live
 
248
is set to live.
 
249
 
 
250
@item rtmp_swfhash
 
251
SHA256 hash of the decompressed SWF file (32 bytes).
 
252
 
 
253
@item rtmp_swfsize
 
254
Size of the decompressed SWF file, required for SWFVerification.
 
255
 
 
256
@item rtmp_swfurl
 
257
URL of the SWF player for the media. By default no value will be sent.
 
258
 
 
259
@item rtmp_swfverify
 
260
URL to player swf file, compute hash/size automatically.
 
261
 
 
262
@item rtmp_tcurl
 
263
URL of the target stream. Defaults to proto://host[:port]/app.
 
264
 
 
265
@end table
 
266
 
 
267
For example to read with @command{avplay} a multimedia resource named
187
268
"sample" from the application "vod" from an RTMP server "myserver":
188
269
@example
189
270
avplay rtmp://myserver/vod/sample
190
271
@end example
191
272
 
 
273
@section rtmpe
 
274
 
 
275
Encrypted Real-Time Messaging Protocol.
 
276
 
 
277
The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
 
278
streaming multimedia content within standard cryptographic primitives,
 
279
consisting of Diffie-Hellman key exchange and HMACSHA256, generating
 
280
a pair of RC4 keys.
 
281
 
 
282
@section rtmps
 
283
 
 
284
Real-Time Messaging Protocol over a secure SSL connection.
 
285
 
 
286
The Real-Time Messaging Protocol (RTMPS) is used for streaming
 
287
multimedia content across an encrypted connection.
 
288
 
 
289
@section rtmpt
 
290
 
 
291
Real-Time Messaging Protocol tunneled through HTTP.
 
292
 
 
293
The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
 
294
for streaming multimedia content within HTTP requests to traverse
 
295
firewalls.
 
296
 
 
297
@section rtmpte
 
298
 
 
299
Encrypted Real-Time Messaging Protocol tunneled through HTTP.
 
300
 
 
301
The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
 
302
is used for streaming multimedia content within HTTP requests to traverse
 
303
firewalls.
 
304
 
 
305
@section rtmpts
 
306
 
 
307
Real-Time Messaging Protocol tunneled through HTTPS.
 
308
 
 
309
The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
 
310
for streaming multimedia content within HTTPS requests to traverse
 
311
firewalls.
 
312
 
192
313
@section rtmp, rtmpe, rtmps, rtmpt, rtmpte
193
314
 
194
315
Real-Time Messaging Protocol and its variants supported through
224
345
avconv -re -i myfile -f flv rtmp://myserver/live/mystream
225
346
@end example
226
347
 
227
 
To play the same stream using @file{avplay}:
 
348
To play the same stream using @command{avplay}:
228
349
@example
229
350
avplay "rtmp://myserver/live/mystream live=1"
230
351
@end example
249
370
rtsp://@var{hostname}[:@var{port}]/@var{path}
250
371
@end example
251
372
 
252
 
The following options (set on the @command{avconv}/@file{avplay} command
 
373
The following options (set on the @command{avconv}/@command{avplay} command
253
374
line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
254
375
are supported:
255
376
 
281
402
@table @option
282
403
@item filter_src
283
404
Accept packets only from negotiated peer address and port.
 
405
@item listen
 
406
Act as a server, listening for an incoming connection.
284
407
@end table
285
408
 
286
409
When receiving data over UDP, the demuxer tries to reorder received packets
287
 
(since they may arrive out of order, or packets may get lost totally). In
288
 
order for this to be enabled, a maximum delay must be specified in the
289
 
@code{max_delay} field of AVFormatContext.
 
410
(since they may arrive out of order, or packets may get lost totally). This
 
411
can be disabled by setting the maximum demuxing delay to zero (via
 
412
the @code{max_delay} field of AVFormatContext).
290
413
 
291
 
When watching multi-bitrate Real-RTSP streams with @file{avplay}, the
 
414
When watching multi-bitrate Real-RTSP streams with @command{avplay}, the
292
415
streams to display can be chosen with @code{-vst} @var{n} and
293
416
@code{-ast} @var{n} for video and audio respectively, and can be switched
294
417
on the fly by pressing @code{v} and @code{a}.
313
436
avconv -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
314
437
@end example
315
438
 
 
439
To receive a stream in realtime:
 
440
 
 
441
@example
 
442
avconv -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
 
443
@end example
 
444
 
316
445
@section sap
317
446
 
318
447
Session Announcement Protocol (RFC 2974). This is not technically a
470
599
unreachable" is received.
471
600
For receiving, this gives the benefit of only receiving packets from
472
601
the specified peer address/port.
 
602
 
 
603
@item sources=@var{address}[,@var{address}]
 
604
Only receive packets sent to the multicast group from one of the
 
605
specified sender IP addresses.
 
606
 
 
607
@item block=@var{address}[,@var{address}]
 
608
Ignore packets sent to the multicast group from the specified
 
609
sender IP addresses.
473
610
@end table
474
611
 
475
612
Some usage examples of the udp protocol with @command{avconv} follow.