Mercurial > hg > pmhd
comparison ffmpeg/doc/ffmpeg-protocols.1 @ 10:6840f77b83aa
commit
author | Yading Song <yading.song@eecs.qmul.ac.uk> |
---|---|
date | Sun, 21 Apr 2013 10:55:35 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:ed610a0bbf83 | 10:6840f77b83aa |
---|---|
1 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) | |
2 .\" | |
3 .\" Standard preamble: | |
4 .\" ======================================================================== | |
5 .de Sp \" Vertical space (when we can't use .PP) | |
6 .if t .sp .5v | |
7 .if n .sp | |
8 .. | |
9 .de Vb \" Begin verbatim text | |
10 .ft CW | |
11 .nf | |
12 .ne \\$1 | |
13 .. | |
14 .de Ve \" End verbatim text | |
15 .ft R | |
16 .fi | |
17 .. | |
18 .\" Set up some character translations and predefined strings. \*(-- will | |
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will | |
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and | |
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, | |
23 .\" nothing in troff, for use with C<>. | |
24 .tr \(*W- | |
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
26 .ie n \{\ | |
27 . ds -- \(*W- | |
28 . ds PI pi | |
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
31 . ds L" "" | |
32 . ds R" "" | |
33 . ds C` "" | |
34 . ds C' "" | |
35 'br\} | |
36 .el\{\ | |
37 . ds -- \|\(em\| | |
38 . ds PI \(*p | |
39 . ds L" `` | |
40 . ds R" '' | |
41 'br\} | |
42 .\" | |
43 .\" Escape single quotes in literal strings from groff's Unicode transform. | |
44 .ie \n(.g .ds Aq \(aq | |
45 .el .ds Aq ' | |
46 .\" | |
47 .\" If the F register is turned on, we'll generate index entries on stderr for | |
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index | |
49 .\" entries marked with X<> in POD. Of course, you'll have to process the | |
50 .\" output yourself in some meaningful fashion. | |
51 .ie \nF \{\ | |
52 . de IX | |
53 . tm Index:\\$1\t\\n%\t"\\$2" | |
54 .. | |
55 . nr % 0 | |
56 . rr F | |
57 .\} | |
58 .el \{\ | |
59 . de IX | |
60 .. | |
61 .\} | |
62 .\" | |
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
64 .\" Fear. Run. Save yourself. No user-serviceable parts. | |
65 . \" fudge factors for nroff and troff | |
66 .if n \{\ | |
67 . ds #H 0 | |
68 . ds #V .8m | |
69 . ds #F .3m | |
70 . ds #[ \f1 | |
71 . ds #] \fP | |
72 .\} | |
73 .if t \{\ | |
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
75 . ds #V .6m | |
76 . ds #F 0 | |
77 . ds #[ \& | |
78 . ds #] \& | |
79 .\} | |
80 . \" simple accents for nroff and troff | |
81 .if n \{\ | |
82 . ds ' \& | |
83 . ds ` \& | |
84 . ds ^ \& | |
85 . ds , \& | |
86 . ds ~ ~ | |
87 . ds / | |
88 .\} | |
89 .if t \{\ | |
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
96 .\} | |
97 . \" troff and (daisy-wheel) nroff accents | |
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
105 .ds ae a\h'-(\w'a'u*4/10)'e | |
106 .ds Ae A\h'-(\w'A'u*4/10)'E | |
107 . \" corrections for vroff | |
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
110 . \" for low resolution devices (crt and lpr) | |
111 .if \n(.H>23 .if \n(.V>19 \ | |
112 \{\ | |
113 . ds : e | |
114 . ds 8 ss | |
115 . ds o a | |
116 . ds d- d\h'-1'\(ga | |
117 . ds D- D\h'-1'\(hy | |
118 . ds th \o'bp' | |
119 . ds Th \o'LP' | |
120 . ds ae ae | |
121 . ds Ae AE | |
122 .\} | |
123 .rm #[ #] #H #V #F C | |
124 .\" ======================================================================== | |
125 .\" | |
126 .IX Title "FFMPEG-PROTOCOLS 1" | |
127 .TH FFMPEG-PROTOCOLS 1 "2013-04-21" " " " " | |
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
129 .\" way too many mistakes in technical documents. | |
130 .if n .ad l | |
131 .nh | |
132 .SH "NAME" | |
133 ffmpeg\-protocols \- FFmpeg protocols | |
134 .SH "DESCRIPTION" | |
135 .IX Header "DESCRIPTION" | |
136 This document describes the input and output protocols provided by the | |
137 libavformat library. | |
138 .SH "PROTOCOLS" | |
139 .IX Header "PROTOCOLS" | |
140 Protocols are configured elements in FFmpeg which allow to access | |
141 resources which require the use of a particular protocol. | |
142 .PP | |
143 When you configure your FFmpeg build, all the supported protocols are | |
144 enabled by default. You can list all available ones using the | |
145 configure option \*(L"\-\-list\-protocols\*(R". | |
146 .PP | |
147 You can disable all the protocols using the configure option | |
148 \&\*(L"\-\-disable\-protocols\*(R", and selectively enable a protocol using the | |
149 option "\-\-enable\-protocol=\fI\s-1PROTOCOL\s0\fR\*(L", or you can disable a | |
150 particular protocol using the option | |
151 \&\*(R"\-\-disable\-protocol=\fI\s-1PROTOCOL\s0\fR". | |
152 .PP | |
153 The option \*(L"\-protocols\*(R" of the ff* tools will display the list of | |
154 supported protocols. | |
155 .PP | |
156 A description of the currently available protocols follows. | |
157 .SS "bluray" | |
158 .IX Subsection "bluray" | |
159 Read BluRay playlist. | |
160 .PP | |
161 The accepted options are: | |
162 .IP "\fBangle\fR" 4 | |
163 .IX Item "angle" | |
164 BluRay angle | |
165 .IP "\fBchapter\fR" 4 | |
166 .IX Item "chapter" | |
167 Start chapter (1...N) | |
168 .IP "\fBplaylist\fR" 4 | |
169 .IX Item "playlist" | |
170 Playlist to read (\s-1BDMV/PLAYLIST/\s0?????.mpls) | |
171 .PP | |
172 Examples: | |
173 .PP | |
174 Read longest playlist from BluRay mounted to /mnt/bluray: | |
175 .PP | |
176 .Vb 1 | |
177 \& bluray:/mnt/bluray | |
178 .Ve | |
179 .PP | |
180 Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: | |
181 .PP | |
182 .Vb 1 | |
183 \& \-playlist 4 \-angle 2 \-chapter 2 bluray:/mnt/bluray | |
184 .Ve | |
185 .SS "concat" | |
186 .IX Subsection "concat" | |
187 Physical concatenation protocol. | |
188 .PP | |
189 Allow to read and seek from many resource in sequence as if they were | |
190 a unique resource. | |
191 .PP | |
192 A \s-1URL\s0 accepted by this protocol has the syntax: | |
193 .PP | |
194 .Vb 1 | |
195 \& concat:<URL1>|<URL2>|...|<URLN> | |
196 .Ve | |
197 .PP | |
198 where \fI\s-1URL1\s0\fR, \fI\s-1URL2\s0\fR, ..., \fI\s-1URLN\s0\fR are the urls of the | |
199 resource to be concatenated, each one possibly specifying a distinct | |
200 protocol. | |
201 .PP | |
202 For example to read a sequence of files \fIsplit1.mpeg\fR, | |
203 \&\fIsplit2.mpeg\fR, \fIsplit3.mpeg\fR with \fBffplay\fR use the | |
204 command: | |
205 .PP | |
206 .Vb 1 | |
207 \& ffplay concat:split1.mpeg\e|split2.mpeg\e|split3.mpeg | |
208 .Ve | |
209 .PP | |
210 Note that you may need to escape the character \*(L"|\*(R" which is special for | |
211 many shells. | |
212 .SS "data" | |
213 .IX Subsection "data" | |
214 Data in-line in the \s-1URI\s0. See <\fBhttp://en.wikipedia.org/wiki/Data_URI_scheme\fR>. | |
215 .PP | |
216 For example, to convert a \s-1GIF\s0 file given inline with \fBffmpeg\fR: | |
217 .PP | |
218 .Vb 1 | |
219 \& ffmpeg \-i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png | |
220 .Ve | |
221 .SS "file" | |
222 .IX Subsection "file" | |
223 File access protocol. | |
224 .PP | |
225 Allow to read from or read to a file. | |
226 .PP | |
227 For example to read from a file \fIinput.mpeg\fR with \fBffmpeg\fR | |
228 use the command: | |
229 .PP | |
230 .Vb 1 | |
231 \& ffmpeg \-i file:input.mpeg output.mpeg | |
232 .Ve | |
233 .PP | |
234 The ff* tools default to the file protocol, that is a resource | |
235 specified with the name \*(L"\s-1FILE\s0.mpeg\*(R" is interpreted as the \s-1URL\s0 | |
236 \&\*(L"file:FILE.mpeg\*(R". | |
237 .SS "gopher" | |
238 .IX Subsection "gopher" | |
239 Gopher protocol. | |
240 .SS "hls" | |
241 .IX Subsection "hls" | |
242 Read Apple \s-1HTTP\s0 Live Streaming compliant segmented stream as | |
243 a uniform one. The M3U8 playlists describing the segments can be | |
244 remote \s-1HTTP\s0 resources or local files, accessed using the standard | |
245 file protocol. | |
246 The nested protocol is declared by specifying | |
247 "+\fIproto\fR" after the hls \s-1URI\s0 scheme name, where \fIproto\fR | |
248 is either \*(L"file\*(R" or \*(L"http\*(R". | |
249 .PP | |
250 .Vb 2 | |
251 \& hls+http://host/path/to/remote/resource.m3u8 | |
252 \& hls+file://path/to/local/resource.m3u8 | |
253 .Ve | |
254 .PP | |
255 Using this protocol is discouraged \- the hls demuxer should work | |
256 just as well (if not, please report the issues) and is more complete. | |
257 To use the hls demuxer instead, simply use the direct URLs to the | |
258 m3u8 files. | |
259 .SS "http" | |
260 .IX Subsection "http" | |
261 \&\s-1HTTP\s0 (Hyper Text Transfer Protocol). | |
262 .PP | |
263 This protocol accepts the following options. | |
264 .IP "\fBseekable\fR" 4 | |
265 .IX Item "seekable" | |
266 Control seekability of connection. If set to 1 the resource is | |
267 supposed to be seekable, if set to 0 it is assumed not to be seekable, | |
268 if set to \-1 it will try to autodetect if it is seekable. Default | |
269 value is \-1. | |
270 .IP "\fBchunked_post\fR" 4 | |
271 .IX Item "chunked_post" | |
272 If set to 1 use chunked transfer-encoding for posts, default is 1. | |
273 .IP "\fBheaders\fR" 4 | |
274 .IX Item "headers" | |
275 Set custom \s-1HTTP\s0 headers, can override built in default headers. The | |
276 value must be a string encoding the headers. | |
277 .IP "\fBcontent_type\fR" 4 | |
278 .IX Item "content_type" | |
279 Force a content type. | |
280 .IP "\fBuser-agent\fR" 4 | |
281 .IX Item "user-agent" | |
282 Override User-Agent header. If not specified the protocol will use a | |
283 string describing the libavformat build. | |
284 .IP "\fBmultiple_requests\fR" 4 | |
285 .IX Item "multiple_requests" | |
286 Use persistent connections if set to 1. By default it is 0. | |
287 .IP "\fBpost_data\fR" 4 | |
288 .IX Item "post_data" | |
289 Set custom \s-1HTTP\s0 post data. | |
290 .IP "\fBtimeout\fR" 4 | |
291 .IX Item "timeout" | |
292 Set timeout of socket I/O operations used by the underlying low level | |
293 operation. By default it is set to \-1, which means that the timeout is | |
294 not specified. | |
295 .IP "\fBmime_type\fR" 4 | |
296 .IX Item "mime_type" | |
297 Set \s-1MIME\s0 type. | |
298 .IP "\fBcookies\fR" 4 | |
299 .IX Item "cookies" | |
300 Set the cookies to be sent in future requests. The format of each cookie is the | |
301 same as the value of a Set-Cookie \s-1HTTP\s0 response field. Multiple cookies can be | |
302 delimited by a newline character. | |
303 .PP | |
304 \fI\s-1HTTP\s0 Cookies\fR | |
305 .IX Subsection "HTTP Cookies" | |
306 .PP | |
307 Some \s-1HTTP\s0 requests will be denied unless cookie values are passed in with the | |
308 request. The \fBcookies\fR option allows these cookies to be specified. At | |
309 the very least, each cookie must specify a value along with a path and domain. | |
310 \&\s-1HTTP\s0 requests that match both the domain and path will automatically include the | |
311 cookie value in the \s-1HTTP\s0 Cookie header field. Multiple cookies can be delimited | |
312 by a newline. | |
313 .PP | |
314 The required syntax to play a stream specifying a cookie is: | |
315 .PP | |
316 .Vb 1 | |
317 \& ffplay \-cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8 | |
318 .Ve | |
319 .SS "mmst" | |
320 .IX Subsection "mmst" | |
321 \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1TCP\s0. | |
322 .SS "mmsh" | |
323 .IX Subsection "mmsh" | |
324 \&\s-1MMS\s0 (Microsoft Media Server) protocol over \s-1HTTP\s0. | |
325 .PP | |
326 The required syntax is: | |
327 .PP | |
328 .Vb 1 | |
329 \& mmsh://<server>[:<port>][/<app>][/<playpath>] | |
330 .Ve | |
331 .SS "md5" | |
332 .IX Subsection "md5" | |
333 \&\s-1MD5\s0 output protocol. | |
334 .PP | |
335 Computes the \s-1MD5\s0 hash of the data to be written, and on close writes | |
336 this to the designated output or stdout if none is specified. It can | |
337 be used to test muxers without writing an actual file. | |
338 .PP | |
339 Some examples follow. | |
340 .PP | |
341 .Vb 2 | |
342 \& # Write the MD5 hash of the encoded AVI file to the file output.avi.md5. | |
343 \& ffmpeg \-i input.flv \-f avi \-y md5:output.avi.md5 | |
344 \& | |
345 \& # Write the MD5 hash of the encoded AVI file to stdout. | |
346 \& ffmpeg \-i input.flv \-f avi \-y md5: | |
347 .Ve | |
348 .PP | |
349 Note that some formats (typically \s-1MOV\s0) require the output protocol to | |
350 be seekable, so they will fail with the \s-1MD5\s0 output protocol. | |
351 .SS "pipe" | |
352 .IX Subsection "pipe" | |
353 \&\s-1UNIX\s0 pipe access protocol. | |
354 .PP | |
355 Allow to read and write from \s-1UNIX\s0 pipes. | |
356 .PP | |
357 The accepted syntax is: | |
358 .PP | |
359 .Vb 1 | |
360 \& pipe:[<number>] | |
361 .Ve | |
362 .PP | |
363 \&\fInumber\fR is the number corresponding to the file descriptor of the | |
364 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If \fInumber\fR | |
365 is not specified, by default the stdout file descriptor will be used | |
366 for writing, stdin for reading. | |
367 .PP | |
368 For example to read from stdin with \fBffmpeg\fR: | |
369 .PP | |
370 .Vb 3 | |
371 \& cat test.wav | ffmpeg \-i pipe:0 | |
372 \& # ...this is the same as... | |
373 \& cat test.wav | ffmpeg \-i pipe: | |
374 .Ve | |
375 .PP | |
376 For writing to stdout with \fBffmpeg\fR: | |
377 .PP | |
378 .Vb 3 | |
379 \& ffmpeg \-i test.wav \-f avi pipe:1 | cat > test.avi | |
380 \& # ...this is the same as... | |
381 \& ffmpeg \-i test.wav \-f avi pipe: | cat > test.avi | |
382 .Ve | |
383 .PP | |
384 Note that some formats (typically \s-1MOV\s0), require the output protocol to | |
385 be seekable, so they will fail with the pipe output protocol. | |
386 .SS "rtmp" | |
387 .IX Subsection "rtmp" | |
388 Real-Time Messaging Protocol. | |
389 .PP | |
390 The Real-Time Messaging Protocol (\s-1RTMP\s0) is used for streaming multimedia | |
391 content across a \s-1TCP/IP\s0 network. | |
392 .PP | |
393 The required syntax is: | |
394 .PP | |
395 .Vb 1 | |
396 \& rtmp://<server>[:<port>][/<app>][/<instance>][/<playpath>] | |
397 .Ve | |
398 .PP | |
399 The accepted parameters are: | |
400 .IP "\fBserver\fR" 4 | |
401 .IX Item "server" | |
402 The address of the \s-1RTMP\s0 server. | |
403 .IP "\fBport\fR" 4 | |
404 .IX Item "port" | |
405 The number of the \s-1TCP\s0 port to use (by default is 1935). | |
406 .IP "\fBapp\fR" 4 | |
407 .IX Item "app" | |
408 It is the name of the application to access. It usually corresponds to | |
409 the path where the application is installed on the \s-1RTMP\s0 server | |
410 (e.g. \fI/ondemand/\fR, \fI/flash/live/\fR, etc.). You can override | |
411 the value parsed from the \s-1URI\s0 through the \f(CW\*(C`rtmp_app\*(C'\fR option, too. | |
412 .IP "\fBplaypath\fR" 4 | |
413 .IX Item "playpath" | |
414 It is the path or name of the resource to play with reference to the | |
415 application specified in \fIapp\fR, may be prefixed by \*(L"mp4:\*(R". You | |
416 can override the value parsed from the \s-1URI\s0 through the \f(CW\*(C`rtmp_playpath\*(C'\fR | |
417 option, too. | |
418 .IP "\fBlisten\fR" 4 | |
419 .IX Item "listen" | |
420 Act as a server, listening for an incoming connection. | |
421 .IP "\fBtimeout\fR" 4 | |
422 .IX Item "timeout" | |
423 Maximum time to wait for the incoming connection. Implies listen. | |
424 .PP | |
425 Additionally, the following parameters can be set via command line options | |
426 (or in code via \f(CW\*(C`AVOption\*(C'\fRs): | |
427 .IP "\fBrtmp_app\fR" 4 | |
428 .IX Item "rtmp_app" | |
429 Name of application to connect on the \s-1RTMP\s0 server. This option | |
430 overrides the parameter specified in the \s-1URI\s0. | |
431 .IP "\fBrtmp_buffer\fR" 4 | |
432 .IX Item "rtmp_buffer" | |
433 Set the client buffer time in milliseconds. The default is 3000. | |
434 .IP "\fBrtmp_conn\fR" 4 | |
435 .IX Item "rtmp_conn" | |
436 Extra arbitrary \s-1AMF\s0 connection parameters, parsed from a string, | |
437 e.g. like \f(CW\*(C`B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0\*(C'\fR. | |
438 Each value is prefixed by a single character denoting the type, | |
439 B for Boolean, N for number, S for string, O for object, or Z for null, | |
440 followed by a colon. For Booleans the data must be either 0 or 1 for | |
441 \&\s-1FALSE\s0 or \s-1TRUE\s0, respectively. Likewise for Objects the data must be 0 or | |
442 1 to end or begin an object, respectively. Data items in subobjects may | |
443 be named, by prefixing the type with 'N' and specifying the name before | |
444 the value (i.e. \f(CW\*(C`NB:myFlag:1\*(C'\fR). This option may be used multiple | |
445 times to construct arbitrary \s-1AMF\s0 sequences. | |
446 .IP "\fBrtmp_flashver\fR" 4 | |
447 .IX Item "rtmp_flashver" | |
448 Version of the Flash plugin used to run the \s-1SWF\s0 player. The default | |
449 is \s-1LNX\s0 9,0,124,2. | |
450 .IP "\fBrtmp_flush_interval\fR" 4 | |
451 .IX Item "rtmp_flush_interval" | |
452 Number of packets flushed in the same request (\s-1RTMPT\s0 only). The default | |
453 is 10. | |
454 .IP "\fBrtmp_live\fR" 4 | |
455 .IX Item "rtmp_live" | |
456 Specify that the media is a live stream. No resuming or seeking in | |
457 live streams is possible. The default value is \f(CW\*(C`any\*(C'\fR, which means the | |
458 subscriber first tries to play the live stream specified in the | |
459 playpath. If a live stream of that name is not found, it plays the | |
460 recorded stream. The other possible values are \f(CW\*(C`live\*(C'\fR and | |
461 \&\f(CW\*(C`recorded\*(C'\fR. | |
462 .IP "\fBrtmp_pageurl\fR" 4 | |
463 .IX Item "rtmp_pageurl" | |
464 \&\s-1URL\s0 of the web page in which the media was embedded. By default no | |
465 value will be sent. | |
466 .IP "\fBrtmp_playpath\fR" 4 | |
467 .IX Item "rtmp_playpath" | |
468 Stream identifier to play or to publish. This option overrides the | |
469 parameter specified in the \s-1URI\s0. | |
470 .IP "\fBrtmp_subscribe\fR" 4 | |
471 .IX Item "rtmp_subscribe" | |
472 Name of live stream to subscribe to. By default no value will be sent. | |
473 It is only sent if the option is specified or if rtmp_live | |
474 is set to live. | |
475 .IP "\fBrtmp_swfhash\fR" 4 | |
476 .IX Item "rtmp_swfhash" | |
477 \&\s-1SHA256\s0 hash of the decompressed \s-1SWF\s0 file (32 bytes). | |
478 .IP "\fBrtmp_swfsize\fR" 4 | |
479 .IX Item "rtmp_swfsize" | |
480 Size of the decompressed \s-1SWF\s0 file, required for SWFVerification. | |
481 .IP "\fBrtmp_swfurl\fR" 4 | |
482 .IX Item "rtmp_swfurl" | |
483 \&\s-1URL\s0 of the \s-1SWF\s0 player for the media. By default no value will be sent. | |
484 .IP "\fBrtmp_swfverify\fR" 4 | |
485 .IX Item "rtmp_swfverify" | |
486 \&\s-1URL\s0 to player swf file, compute hash/size automatically. | |
487 .IP "\fBrtmp_tcurl\fR" 4 | |
488 .IX Item "rtmp_tcurl" | |
489 \&\s-1URL\s0 of the target stream. Defaults to proto://host[:port]/app. | |
490 .PP | |
491 For example to read with \fBffplay\fR a multimedia resource named | |
492 \&\*(L"sample\*(R" from the application \*(L"vod\*(R" from an \s-1RTMP\s0 server \*(L"myserver\*(R": | |
493 .PP | |
494 .Vb 1 | |
495 \& ffplay rtmp://myserver/vod/sample | |
496 .Ve | |
497 .SS "rtmpe" | |
498 .IX Subsection "rtmpe" | |
499 Encrypted Real-Time Messaging Protocol. | |
500 .PP | |
501 The Encrypted Real-Time Messaging Protocol (\s-1RTMPE\s0) is used for | |
502 streaming multimedia content within standard cryptographic primitives, | |
503 consisting of Diffie-Hellman key exchange and \s-1HMACSHA256\s0, generating | |
504 a pair of \s-1RC4\s0 keys. | |
505 .SS "rtmps" | |
506 .IX Subsection "rtmps" | |
507 Real-Time Messaging Protocol over a secure \s-1SSL\s0 connection. | |
508 .PP | |
509 The Real-Time Messaging Protocol (\s-1RTMPS\s0) is used for streaming | |
510 multimedia content across an encrypted connection. | |
511 .SS "rtmpt" | |
512 .IX Subsection "rtmpt" | |
513 Real-Time Messaging Protocol tunneled through \s-1HTTP\s0. | |
514 .PP | |
515 The Real-Time Messaging Protocol tunneled through \s-1HTTP\s0 (\s-1RTMPT\s0) is used | |
516 for streaming multimedia content within \s-1HTTP\s0 requests to traverse | |
517 firewalls. | |
518 .SS "rtmpte" | |
519 .IX Subsection "rtmpte" | |
520 Encrypted Real-Time Messaging Protocol tunneled through \s-1HTTP\s0. | |
521 .PP | |
522 The Encrypted Real-Time Messaging Protocol tunneled through \s-1HTTP\s0 (\s-1RTMPTE\s0) | |
523 is used for streaming multimedia content within \s-1HTTP\s0 requests to traverse | |
524 firewalls. | |
525 .SS "rtmpts" | |
526 .IX Subsection "rtmpts" | |
527 Real-Time Messaging Protocol tunneled through \s-1HTTPS\s0. | |
528 .PP | |
529 The Real-Time Messaging Protocol tunneled through \s-1HTTPS\s0 (\s-1RTMPTS\s0) is used | |
530 for streaming multimedia content within \s-1HTTPS\s0 requests to traverse | |
531 firewalls. | |
532 .SS "rtmp, rtmpe, rtmps, rtmpt, rtmpte" | |
533 .IX Subsection "rtmp, rtmpe, rtmps, rtmpt, rtmpte" | |
534 Real-Time Messaging Protocol and its variants supported through | |
535 librtmp. | |
536 .PP | |
537 Requires the presence of the librtmp headers and library during | |
538 configuration. You need to explicitly configure the build with | |
539 \&\*(L"\-\-enable\-librtmp\*(R". If enabled this will replace the native \s-1RTMP\s0 | |
540 protocol. | |
541 .PP | |
542 This protocol provides most client functions and a few server | |
543 functions needed to support \s-1RTMP\s0, \s-1RTMP\s0 tunneled in \s-1HTTP\s0 (\s-1RTMPT\s0), | |
544 encrypted \s-1RTMP\s0 (\s-1RTMPE\s0), \s-1RTMP\s0 over \s-1SSL/TLS\s0 (\s-1RTMPS\s0) and tunneled | |
545 variants of these encrypted types (\s-1RTMPTE\s0, \s-1RTMPTS\s0). | |
546 .PP | |
547 The required syntax is: | |
548 .PP | |
549 .Vb 1 | |
550 \& <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options> | |
551 .Ve | |
552 .PP | |
553 where \fIrtmp_proto\fR is one of the strings \*(L"rtmp\*(R", \*(L"rtmpt\*(R", \*(L"rtmpe\*(R", | |
554 \&\*(L"rtmps\*(R", \*(L"rtmpte\*(R", \*(L"rtmpts\*(R" corresponding to each \s-1RTMP\s0 variant, and | |
555 \&\fIserver\fR, \fIport\fR, \fIapp\fR and \fIplaypath\fR have the same | |
556 meaning as specified for the \s-1RTMP\s0 native protocol. | |
557 \&\fIoptions\fR contains a list of space-separated options of the form | |
558 \&\fIkey\fR=\fIval\fR. | |
559 .PP | |
560 See the librtmp manual page (man 3 librtmp) for more information. | |
561 .PP | |
562 For example, to stream a file in real-time to an \s-1RTMP\s0 server using | |
563 \&\fBffmpeg\fR: | |
564 .PP | |
565 .Vb 1 | |
566 \& ffmpeg \-re \-i myfile \-f flv rtmp://myserver/live/mystream | |
567 .Ve | |
568 .PP | |
569 To play the same stream using \fBffplay\fR: | |
570 .PP | |
571 .Vb 1 | |
572 \& ffplay "rtmp://myserver/live/mystream live=1" | |
573 .Ve | |
574 .SS "rtp" | |
575 .IX Subsection "rtp" | |
576 Real-Time Protocol. | |
577 .SS "rtsp" | |
578 .IX Subsection "rtsp" | |
579 \&\s-1RTSP\s0 is not technically a protocol handler in libavformat, it is a demuxer | |
580 and muxer. The demuxer supports both normal \s-1RTSP\s0 (with data transferred | |
581 over \s-1RTP\s0; this is used by e.g. Apple and Microsoft) and Real-RTSP (with | |
582 data transferred over \s-1RDT\s0). | |
583 .PP | |
584 The muxer can be used to send a stream using \s-1RTSP\s0 \s-1ANNOUNCE\s0 to a server | |
585 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's | |
586 <\fBhttp://github.com/revmischa/rtsp\-server\fR>). | |
587 .PP | |
588 The required syntax for a \s-1RTSP\s0 url is: | |
589 .PP | |
590 .Vb 1 | |
591 \& rtsp://<hostname>[:<port>]/<path> | |
592 .Ve | |
593 .PP | |
594 The following options (set on the \fBffmpeg\fR/\fBffplay\fR command | |
595 line, or set in code via \f(CW\*(C`AVOption\*(C'\fRs or in \f(CW\*(C`avformat_open_input\*(C'\fR), | |
596 are supported: | |
597 .PP | |
598 Flags for \f(CW\*(C`rtsp_transport\*(C'\fR: | |
599 .IP "\fBudp\fR" 4 | |
600 .IX Item "udp" | |
601 Use \s-1UDP\s0 as lower transport protocol. | |
602 .IP "\fBtcp\fR" 4 | |
603 .IX Item "tcp" | |
604 Use \s-1TCP\s0 (interleaving within the \s-1RTSP\s0 control channel) as lower | |
605 transport protocol. | |
606 .IP "\fBudp_multicast\fR" 4 | |
607 .IX Item "udp_multicast" | |
608 Use \s-1UDP\s0 multicast as lower transport protocol. | |
609 .IP "\fBhttp\fR" 4 | |
610 .IX Item "http" | |
611 Use \s-1HTTP\s0 tunneling as lower transport protocol, which is useful for | |
612 passing proxies. | |
613 .PP | |
614 Multiple lower transport protocols may be specified, in that case they are | |
615 tried one at a time (if the setup of one fails, the next one is tried). | |
616 For the muxer, only the \f(CW\*(C`tcp\*(C'\fR and \f(CW\*(C`udp\*(C'\fR options are supported. | |
617 .PP | |
618 Flags for \f(CW\*(C`rtsp_flags\*(C'\fR: | |
619 .IP "\fBfilter_src\fR" 4 | |
620 .IX Item "filter_src" | |
621 Accept packets only from negotiated peer address and port. | |
622 .IP "\fBlisten\fR" 4 | |
623 .IX Item "listen" | |
624 Act as a server, listening for an incoming connection. | |
625 .PP | |
626 When receiving data over \s-1UDP\s0, the demuxer tries to reorder received packets | |
627 (since they may arrive out of order, or packets may get lost totally). This | |
628 can be disabled by setting the maximum demuxing delay to zero (via | |
629 the \f(CW\*(C`max_delay\*(C'\fR field of AVFormatContext). | |
630 .PP | |
631 When watching multi-bitrate Real-RTSP streams with \fBffplay\fR, the | |
632 streams to display can be chosen with \f(CW\*(C`\-vst\*(C'\fR \fIn\fR and | |
633 \&\f(CW\*(C`\-ast\*(C'\fR \fIn\fR for video and audio respectively, and can be switched | |
634 on the fly by pressing \f(CW\*(C`v\*(C'\fR and \f(CW\*(C`a\*(C'\fR. | |
635 .PP | |
636 Example command lines: | |
637 .PP | |
638 To watch a stream over \s-1UDP\s0, with a max reordering delay of 0.5 seconds: | |
639 .PP | |
640 .Vb 1 | |
641 \& ffplay \-max_delay 500000 \-rtsp_transport udp rtsp://server/video.mp4 | |
642 .Ve | |
643 .PP | |
644 To watch a stream tunneled over \s-1HTTP:\s0 | |
645 .PP | |
646 .Vb 1 | |
647 \& ffplay \-rtsp_transport http rtsp://server/video.mp4 | |
648 .Ve | |
649 .PP | |
650 To send a stream in realtime to a \s-1RTSP\s0 server, for others to watch: | |
651 .PP | |
652 .Vb 1 | |
653 \& ffmpeg \-re \-i <input> \-f rtsp \-muxdelay 0.1 rtsp://server/live.sdp | |
654 .Ve | |
655 .PP | |
656 To receive a stream in realtime: | |
657 .PP | |
658 .Vb 1 | |
659 \& ffmpeg \-rtsp_flags listen \-i rtsp://ownaddress/live.sdp <output> | |
660 .Ve | |
661 .IP "\fBstimeout\fR" 4 | |
662 .IX Item "stimeout" | |
663 Socket \s-1IO\s0 timeout in micro seconds. | |
664 .SS "sap" | |
665 .IX Subsection "sap" | |
666 Session Announcement Protocol (\s-1RFC\s0 2974). This is not technically a | |
667 protocol handler in libavformat, it is a muxer and demuxer. | |
668 It is used for signalling of \s-1RTP\s0 streams, by announcing the \s-1SDP\s0 for the | |
669 streams regularly on a separate port. | |
670 .PP | |
671 \fIMuxer\fR | |
672 .IX Subsection "Muxer" | |
673 .PP | |
674 The syntax for a \s-1SAP\s0 url given to the muxer is: | |
675 .PP | |
676 .Vb 1 | |
677 \& sap://<destination>[:<port>][?<options>] | |
678 .Ve | |
679 .PP | |
680 The \s-1RTP\s0 packets are sent to \fIdestination\fR on port \fIport\fR, | |
681 or to port 5004 if no port is specified. | |
682 \&\fIoptions\fR is a \f(CW\*(C`&\*(C'\fR\-separated list. The following options | |
683 are supported: | |
684 .IP "\fBannounce_addr=\fR\fIaddress\fR" 4 | |
685 .IX Item "announce_addr=address" | |
686 Specify the destination \s-1IP\s0 address for sending the announcements to. | |
687 If omitted, the announcements are sent to the commonly used \s-1SAP\s0 | |
688 announcement multicast address 224.2.127.254 (sap.mcast.net), or | |
689 ff0e::2:7ffe if \fIdestination\fR is an IPv6 address. | |
690 .IP "\fBannounce_port=\fR\fIport\fR" 4 | |
691 .IX Item "announce_port=port" | |
692 Specify the port to send the announcements on, defaults to | |
693 9875 if not specified. | |
694 .IP "\fBttl=\fR\fIttl\fR" 4 | |
695 .IX Item "ttl=ttl" | |
696 Specify the time to live value for the announcements and \s-1RTP\s0 packets, | |
697 defaults to 255. | |
698 .IP "\fBsame_port=\fR\fI0|1\fR" 4 | |
699 .IX Item "same_port=0|1" | |
700 If set to 1, send all \s-1RTP\s0 streams on the same port pair. If zero (the | |
701 default), all streams are sent on unique ports, with each stream on a | |
702 port 2 numbers higher than the previous. | |
703 VLC/Live555 requires this to be set to 1, to be able to receive the stream. | |
704 The \s-1RTP\s0 stack in libavformat for receiving requires all streams to be sent | |
705 on unique ports. | |
706 .PP | |
707 Example command lines follow. | |
708 .PP | |
709 To broadcast a stream on the local subnet, for watching in \s-1VLC:\s0 | |
710 .PP | |
711 .Vb 1 | |
712 \& ffmpeg \-re \-i <input> \-f sap sap://224.0.0.255?same_port=1 | |
713 .Ve | |
714 .PP | |
715 Similarly, for watching in \fBffplay\fR: | |
716 .PP | |
717 .Vb 1 | |
718 \& ffmpeg \-re \-i <input> \-f sap sap://224.0.0.255 | |
719 .Ve | |
720 .PP | |
721 And for watching in \fBffplay\fR, over IPv6: | |
722 .PP | |
723 .Vb 1 | |
724 \& ffmpeg \-re \-i <input> \-f sap sap://[ff0e::1:2:3:4] | |
725 .Ve | |
726 .PP | |
727 \fIDemuxer\fR | |
728 .IX Subsection "Demuxer" | |
729 .PP | |
730 The syntax for a \s-1SAP\s0 url given to the demuxer is: | |
731 .PP | |
732 .Vb 1 | |
733 \& sap://[<address>][:<port>] | |
734 .Ve | |
735 .PP | |
736 \&\fIaddress\fR is the multicast address to listen for announcements on, | |
737 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. \fIport\fR | |
738 is the port that is listened on, 9875 if omitted. | |
739 .PP | |
740 The demuxers listens for announcements on the given address and port. | |
741 Once an announcement is received, it tries to receive that particular stream. | |
742 .PP | |
743 Example command lines follow. | |
744 .PP | |
745 To play back the first stream announced on the normal \s-1SAP\s0 multicast address: | |
746 .PP | |
747 .Vb 1 | |
748 \& ffplay sap:// | |
749 .Ve | |
750 .PP | |
751 To play back the first stream announced on one the default IPv6 \s-1SAP\s0 multicast address: | |
752 .PP | |
753 .Vb 1 | |
754 \& ffplay sap://[ff0e::2:7ffe] | |
755 .Ve | |
756 .SS "tcp" | |
757 .IX Subsection "tcp" | |
758 Trasmission Control Protocol. | |
759 .PP | |
760 The required syntax for a \s-1TCP\s0 url is: | |
761 .PP | |
762 .Vb 1 | |
763 \& tcp://<hostname>:<port>[?<options>] | |
764 .Ve | |
765 .IP "\fBlisten\fR" 4 | |
766 .IX Item "listen" | |
767 Listen for an incoming connection | |
768 .IP "\fBtimeout=\fR\fImicroseconds\fR" 4 | |
769 .IX Item "timeout=microseconds" | |
770 In read mode: if no data arrived in more than this time interval, raise error. | |
771 In write mode: if socket cannot be written in more than this time interval, raise error. | |
772 This also sets timeout on \s-1TCP\s0 connection establishing. | |
773 .Sp | |
774 .Vb 2 | |
775 \& ffmpeg \-i <input> \-f <format> tcp://<hostname>:<port>?listen | |
776 \& ffplay tcp://<hostname>:<port> | |
777 .Ve | |
778 .SS "tls" | |
779 .IX Subsection "tls" | |
780 Transport Layer Security/Secure Sockets Layer | |
781 .PP | |
782 The required syntax for a \s-1TLS/SSL\s0 url is: | |
783 .PP | |
784 .Vb 1 | |
785 \& tls://<hostname>:<port>[?<options>] | |
786 .Ve | |
787 .IP "\fBlisten\fR" 4 | |
788 .IX Item "listen" | |
789 Act as a server, listening for an incoming connection. | |
790 .IP "\fBcafile=\fR\fIfilename\fR" 4 | |
791 .IX Item "cafile=filename" | |
792 Certificate authority file. The file must be in OpenSSL \s-1PEM\s0 format. | |
793 .IP "\fBcert=\fR\fIfilename\fR" 4 | |
794 .IX Item "cert=filename" | |
795 Certificate file. The file must be in OpenSSL \s-1PEM\s0 format. | |
796 .IP "\fBkey=\fR\fIfilename\fR" 4 | |
797 .IX Item "key=filename" | |
798 Private key file. | |
799 .IP "\fBverify=\fR\fI0|1\fR" 4 | |
800 .IX Item "verify=0|1" | |
801 Verify the peer's certificate. | |
802 .PP | |
803 Example command lines: | |
804 .PP | |
805 To create a \s-1TLS/SSL\s0 server that serves an input stream. | |
806 .PP | |
807 .Vb 1 | |
808 \& ffmpeg \-i <input> \-f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key> | |
809 .Ve | |
810 .PP | |
811 To play back a stream from the \s-1TLS/SSL\s0 server using \fBffplay\fR: | |
812 .PP | |
813 .Vb 1 | |
814 \& ffplay tls://<hostname>:<port> | |
815 .Ve | |
816 .SS "udp" | |
817 .IX Subsection "udp" | |
818 User Datagram Protocol. | |
819 .PP | |
820 The required syntax for a \s-1UDP\s0 url is: | |
821 .PP | |
822 .Vb 1 | |
823 \& udp://<hostname>:<port>[?<options>] | |
824 .Ve | |
825 .PP | |
826 \&\fIoptions\fR contains a list of &\-separated options of the form \fIkey\fR=\fIval\fR. | |
827 .PP | |
828 In case threading is enabled on the system, a circular buffer is used | |
829 to store the incoming data, which allows to reduce loss of data due to | |
830 \&\s-1UDP\s0 socket buffer overruns. The \fIfifo_size\fR and | |
831 \&\fIoverrun_nonfatal\fR options are related to this buffer. | |
832 .PP | |
833 The list of supported options follows. | |
834 .IP "\fBbuffer_size=\fR\fIsize\fR" 4 | |
835 .IX Item "buffer_size=size" | |
836 Set the \s-1UDP\s0 socket buffer size in bytes. This is used both for the | |
837 receiving and the sending buffer size. | |
838 .IP "\fBlocalport=\fR\fIport\fR" 4 | |
839 .IX Item "localport=port" | |
840 Override the local \s-1UDP\s0 port to bind with. | |
841 .IP "\fBlocaladdr=\fR\fIaddr\fR" 4 | |
842 .IX Item "localaddr=addr" | |
843 Choose the local \s-1IP\s0 address. This is useful e.g. if sending multicast | |
844 and the host has multiple interfaces, where the user can choose | |
845 which interface to send on by specifying the \s-1IP\s0 address of that interface. | |
846 .IP "\fBpkt_size=\fR\fIsize\fR" 4 | |
847 .IX Item "pkt_size=size" | |
848 Set the size in bytes of \s-1UDP\s0 packets. | |
849 .IP "\fBreuse=\fR\fI1|0\fR" 4 | |
850 .IX Item "reuse=1|0" | |
851 Explicitly allow or disallow reusing \s-1UDP\s0 sockets. | |
852 .IP "\fBttl=\fR\fIttl\fR" 4 | |
853 .IX Item "ttl=ttl" | |
854 Set the time to live value (for multicast only). | |
855 .IP "\fBconnect=\fR\fI1|0\fR" 4 | |
856 .IX Item "connect=1|0" | |
857 Initialize the \s-1UDP\s0 socket with \f(CW\*(C`connect()\*(C'\fR. In this case, the | |
858 destination address can't be changed with ff_udp_set_remote_url later. | |
859 If the destination address isn't known at the start, this option can | |
860 be specified in ff_udp_set_remote_url, too. | |
861 This allows finding out the source address for the packets with getsockname, | |
862 and makes writes return with \s-1AVERROR\s0(\s-1ECONNREFUSED\s0) if \*(L"destination | |
863 unreachable\*(R" is received. | |
864 For receiving, this gives the benefit of only receiving packets from | |
865 the specified peer address/port. | |
866 .IP "\fBsources=\fR\fIaddress\fR\fB[,\fR\fIaddress\fR\fB]\fR" 4 | |
867 .IX Item "sources=address[,address]" | |
868 Only receive packets sent to the multicast group from one of the | |
869 specified sender \s-1IP\s0 addresses. | |
870 .IP "\fBblock=\fR\fIaddress\fR\fB[,\fR\fIaddress\fR\fB]\fR" 4 | |
871 .IX Item "block=address[,address]" | |
872 Ignore packets sent to the multicast group from the specified | |
873 sender \s-1IP\s0 addresses. | |
874 .IP "\fBfifo_size=\fR\fIunits\fR" 4 | |
875 .IX Item "fifo_size=units" | |
876 Set the \s-1UDP\s0 receiving circular buffer size, expressed as a number of | |
877 packets with size of 188 bytes. If not specified defaults to 7*4096. | |
878 .IP "\fBoverrun_nonfatal=\fR\fI1|0\fR" 4 | |
879 .IX Item "overrun_nonfatal=1|0" | |
880 Survive in case of \s-1UDP\s0 receiving circular buffer overrun. Default | |
881 value is 0. | |
882 .IP "\fBtimeout=\fR\fImicroseconds\fR" 4 | |
883 .IX Item "timeout=microseconds" | |
884 In read mode: if no data arrived in more than this time interval, raise error. | |
885 .PP | |
886 Some usage examples of the \s-1UDP\s0 protocol with \fBffmpeg\fR follow. | |
887 .PP | |
888 To stream over \s-1UDP\s0 to a remote endpoint: | |
889 .PP | |
890 .Vb 1 | |
891 \& ffmpeg \-i <input> \-f <format> udp://<hostname>:<port> | |
892 .Ve | |
893 .PP | |
894 To stream in mpegts format over \s-1UDP\s0 using 188 sized \s-1UDP\s0 packets, using a large input buffer: | |
895 .PP | |
896 .Vb 1 | |
897 \& ffmpeg \-i <input> \-f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535 | |
898 .Ve | |
899 .PP | |
900 To receive over \s-1UDP\s0 from a remote endpoint: | |
901 .PP | |
902 .Vb 1 | |
903 \& ffmpeg \-i udp://[<multicast\-address>]:<port> | |
904 .Ve | |
905 .SH "SEE ALSO" | |
906 .IX Header "SEE ALSO" | |
907 \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavformat\fR\|(3) | |
908 .SH "AUTHORS" | |
909 .IX Header "AUTHORS" | |
910 The FFmpeg developers. | |
911 .PP | |
912 For details about the authorship, see the Git history of the project | |
913 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command | |
914 \&\fBgit log\fR in the FFmpeg source directory, or browsing the | |
915 online repository at <\fBhttp://source.ffmpeg.org\fR>. | |
916 .PP | |
917 Maintainers for the specific components are listed in the file | |
918 \&\fI\s-1MAINTAINERS\s0\fR in the source code tree. |