]> git.sesse.net Git - casparcg/blob - dependencies/ffmpeg/doc/ffmpeg-protocols.html
19c3d2d41a36d16cdb220ab24bb063b794caadda
[casparcg] / dependencies / ffmpeg / doc / ffmpeg-protocols.html
1 <!DOCTYPE html>
2 <html>
3 <!-- Created on December 14, 2013 by texi2html 1.82 -->
4 <!--
5 texi2html was written by: 
6             Lionel Cons <Lionel.Cons@cern.ch> (original author)
7             Karl Berry  <karl@freefriends.org>
8             Olaf Bachmann <obachman@mathematik.uni-kl.de>
9             and many others.
10 Maintained by: Many creative people.
11 Send bugs and suggestions to <texi2html-bug@nongnu.org>
12
13 -->
14 <head>
15 <title>FFmpeg documentation : FFmpeg Protocols </title>
16
17 <meta name="description" content="FFmpeg Protocols Documentation: ">
18 <meta name="keywords" content="FFmpeg documentation : FFmpeg Protocols ">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <link rel="stylesheet" type="text/css" href="default.css" />
22
23 <link rel="icon" href="favicon.png" type="image/png" />
24 </head>
25 <body>
26 <div id="container">
27 <div id="body">
28
29 <a name="SEC_Top"></a>
30 <h1 class="settitle">FFmpeg Protocols Documentation</h1>
31
32 <a name="SEC_Contents"></a>
33 <h1>Table of Contents</h1>
34 <div class="contents">
35
36 <ul class="toc">
37   <li><a name="toc-Description" href="#Description">1. Description</a></li>
38   <li><a name="toc-Protocols" href="#Protocols">2. Protocols</a>
39   <ul class="toc">
40     <li><a name="toc-bluray" href="#bluray">2.1 bluray</a></li>
41     <li><a name="toc-cache" href="#cache">2.2 cache</a></li>
42     <li><a name="toc-concat" href="#concat">2.3 concat</a></li>
43     <li><a name="toc-crypto" href="#crypto">2.4 crypto</a></li>
44     <li><a name="toc-data" href="#data">2.5 data</a></li>
45     <li><a name="toc-file" href="#file">2.6 file</a></li>
46     <li><a name="toc-ftp" href="#ftp">2.7 ftp</a></li>
47     <li><a name="toc-gopher" href="#gopher">2.8 gopher</a></li>
48     <li><a name="toc-hls" href="#hls">2.9 hls</a></li>
49     <li><a name="toc-http" href="#http">2.10 http</a>
50     <ul class="toc">
51       <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">2.10.1 HTTP Cookies</a></li>
52     </ul></li>
53     <li><a name="toc-mmst" href="#mmst">2.11 mmst</a></li>
54     <li><a name="toc-mmsh" href="#mmsh">2.12 mmsh</a></li>
55     <li><a name="toc-md5" href="#md5">2.13 md5</a></li>
56     <li><a name="toc-pipe" href="#pipe">2.14 pipe</a></li>
57     <li><a name="toc-rtmp" href="#rtmp">2.15 rtmp</a></li>
58     <li><a name="toc-rtmpe" href="#rtmpe">2.16 rtmpe</a></li>
59     <li><a name="toc-rtmps" href="#rtmps">2.17 rtmps</a></li>
60     <li><a name="toc-rtmpt" href="#rtmpt">2.18 rtmpt</a></li>
61     <li><a name="toc-rtmpte" href="#rtmpte">2.19 rtmpte</a></li>
62     <li><a name="toc-rtmpts" href="#rtmpts">2.20 rtmpts</a></li>
63     <li><a name="toc-libssh" href="#libssh">2.21 libssh</a></li>
64     <li><a name="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">2.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
65     <li><a name="toc-rtp" href="#rtp">2.23 rtp</a></li>
66     <li><a name="toc-rtsp" href="#rtsp">2.24 rtsp</a></li>
67     <li><a name="toc-sap" href="#sap">2.25 sap</a>
68     <ul class="toc">
69       <li><a name="toc-Muxer" href="#Muxer">2.25.1 Muxer</a></li>
70       <li><a name="toc-Demuxer" href="#Demuxer">2.25.2 Demuxer</a></li>
71     </ul></li>
72     <li><a name="toc-sctp" href="#sctp">2.26 sctp</a></li>
73     <li><a name="toc-srtp" href="#srtp">2.27 srtp</a></li>
74     <li><a name="toc-tcp" href="#tcp">2.28 tcp</a></li>
75     <li><a name="toc-tls" href="#tls">2.29 tls</a></li>
76     <li><a name="toc-udp" href="#udp">2.30 udp</a></li>
77     <li><a name="toc-unix" href="#unix">2.31 unix</a></li>
78   </ul></li>
79   <li><a name="toc-See-Also" href="#See-Also">3. See Also</a></li>
80   <li><a name="toc-Authors" href="#Authors">4. Authors</a></li>
81 </ul>
82 </div>
83
84 <a name="Description"></a>
85 <h1 class="chapter"><a href="ffmpeg-protocols.html#toc-Description">1. Description</a></h1>
86
87 <p>This document describes the input and output protocols provided by the
88 libavformat library.
89 </p>
90
91 <a name="Protocols"></a>
92 <h1 class="chapter"><a href="ffmpeg-protocols.html#toc-Protocols">2. Protocols</a></h1>
93
94 <p>Protocols are configured elements in FFmpeg that enable access to
95 resources that require specific protocols.
96 </p>
97 <p>When you configure your FFmpeg build, all the supported protocols are
98 enabled by default. You can list all available ones using the
99 configure option &quot;&ndash;list-protocols&quot;.
100 </p>
101 <p>You can disable all the protocols using the configure option
102 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
103 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
104 particular protocol using the option
105 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
106 </p>
107 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
108 supported protocols.
109 </p>
110 <p>A description of the currently available protocols follows.
111 </p>
112 <a name="bluray"></a>
113 <h2 class="section"><a href="ffmpeg-protocols.html#toc-bluray">2.1 bluray</a></h2>
114
115 <p>Read BluRay playlist.
116 </p>
117 <p>The accepted options are:
118 </p><dl compact="compact">
119 <dt> &lsquo;<samp>angle</samp>&rsquo;</dt>
120 <dd><p>BluRay angle
121 </p>
122 </dd>
123 <dt> &lsquo;<samp>chapter</samp>&rsquo;</dt>
124 <dd><p>Start chapter (1...N)
125 </p>
126 </dd>
127 <dt> &lsquo;<samp>playlist</samp>&rsquo;</dt>
128 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
129 </p>
130 </dd>
131 </dl>
132
133 <p>Examples:
134 </p>
135 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
136 </p><table><tr><td>&nbsp;</td><td><pre class="example">bluray:/mnt/bluray
137 </pre></td></tr></table>
138
139 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
140 </p><table><tr><td>&nbsp;</td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
141 </pre></td></tr></table>
142
143 <a name="cache"></a>
144 <h2 class="section"><a href="ffmpeg-protocols.html#toc-cache">2.2 cache</a></h2>
145
146 <p>Caching wrapper for input stream.
147 </p>
148 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
149 </p>
150 <table><tr><td>&nbsp;</td><td><pre class="example">cache:<var>URL</var>
151 </pre></td></tr></table>
152
153 <a name="concat"></a>
154 <h2 class="section"><a href="ffmpeg-protocols.html#toc-concat">2.3 concat</a></h2>
155
156 <p>Physical concatenation protocol.
157 </p>
158 <p>Allow to read and seek from many resource in sequence as if they were
159 a unique resource.
160 </p>
161 <p>A URL accepted by this protocol has the syntax:
162 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
163 </pre></td></tr></table>
164
165 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
166 resource to be concatenated, each one possibly specifying a distinct
167 protocol.
168 </p>
169 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
170 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
171 command:
172 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
173 </pre></td></tr></table>
174
175 <p>Note that you may need to escape the character &quot;|&quot; which is special for
176 many shells.
177 </p>
178 <a name="crypto"></a>
179 <h2 class="section"><a href="ffmpeg-protocols.html#toc-crypto">2.4 crypto</a></h2>
180
181 <p>AES-encrypted stream reading protocol.
182 </p>
183 <p>The accepted options are:
184 </p><dl compact="compact">
185 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
186 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
187 </p>
188 </dd>
189 <dt> &lsquo;<samp>iv</samp>&rsquo;</dt>
190 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
191 </p></dd>
192 </dl>
193
194 <p>Accepted URL formats:
195 </p><table><tr><td>&nbsp;</td><td><pre class="example">crypto:<var>URL</var>
196 crypto+<var>URL</var>
197 </pre></td></tr></table>
198
199 <a name="data"></a>
200 <h2 class="section"><a href="ffmpeg-protocols.html#toc-data">2.5 data</a></h2>
201
202 <p>Data in-line in the URI. See <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">http://en.wikipedia.org/wiki/Data_URI_scheme</a>.
203 </p>
204 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
205 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
206 </pre></td></tr></table>
207
208 <a name="file"></a>
209 <h2 class="section"><a href="ffmpeg-protocols.html#toc-file">2.6 file</a></h2>
210
211 <p>File access protocol.
212 </p>
213 <p>Allow to read from or read to a file.
214 </p>
215 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
216 use the command:
217 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
218 </pre></td></tr></table>
219
220 <p>The ff* tools default to the file protocol, that is a resource
221 specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
222 &quot;file:FILE.mpeg&quot;.
223 </p>
224 <p>This protocol accepts the following options:
225 </p>
226 <dl compact="compact">
227 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
228 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
229 truncating. Default value is 1.
230 </p>
231 </dd>
232 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
233 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
234 <code>INT_MAX</code>, which results in not limiting the requested block size.
235 Setting this value reasonably low improves user termination request reaction
236 time, which is valuable for files on slow medium.
237 </p></dd>
238 </dl>
239
240 <a name="ftp"></a>
241 <h2 class="section"><a href="ffmpeg-protocols.html#toc-ftp">2.7 ftp</a></h2>
242
243 <p>FTP (File Transfer Protocol).
244 </p>
245 <p>Allow to read from or write to remote resources using FTP protocol.
246 </p>
247 <p>Following syntax is required.
248 </p><table><tr><td>&nbsp;</td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
249 </pre></td></tr></table>
250
251 <p>This protocol accepts the following options.
252 </p>
253 <dl compact="compact">
254 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
255 <dd><p>Set timeout of socket I/O operations used by the underlying low level
256 operation. By default it is set to -1, which means that the timeout is
257 not specified.
258 </p>
259 </dd>
260 <dt> &lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
261 <dd><p>Password used when login as anonymous user. Typically an e-mail address
262 should be used.
263 </p>
264 </dd>
265 <dt> &lsquo;<samp>ftp-write-seekable</samp>&rsquo;</dt>
266 <dd><p>Control seekability of connection during encoding. If set to 1 the
267 resource is supposed to be seekable, if set to 0 it is assumed not
268 to be seekable. Default value is 0.
269 </p></dd>
270 </dl>
271
272 <p>NOTE: Protocol can be used as output, but it is recommended to not do
273 it, unless special care is taken (tests, customized server configuration
274 etc.). Different FTP servers behave in different way during seek
275 operation. ff* tools may produce incomplete content due to server limitations.
276 </p>
277 <a name="gopher"></a>
278 <h2 class="section"><a href="ffmpeg-protocols.html#toc-gopher">2.8 gopher</a></h2>
279
280 <p>Gopher protocol.
281 </p>
282 <a name="hls"></a>
283 <h2 class="section"><a href="ffmpeg-protocols.html#toc-hls">2.9 hls</a></h2>
284
285 <p>Read Apple HTTP Live Streaming compliant segmented stream as
286 a uniform one. The M3U8 playlists describing the segments can be
287 remote HTTP resources or local files, accessed using the standard
288 file protocol.
289 The nested protocol is declared by specifying
290 &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
291 is either &quot;file&quot; or &quot;http&quot;.
292 </p>
293 <table><tr><td>&nbsp;</td><td><pre class="example">hls+http://host/path/to/remote/resource.m3u8
294 hls+file://path/to/local/resource.m3u8
295 </pre></td></tr></table>
296
297 <p>Using this protocol is discouraged - the hls demuxer should work
298 just as well (if not, please report the issues) and is more complete.
299 To use the hls demuxer instead, simply use the direct URLs to the
300 m3u8 files.
301 </p>
302 <a name="http"></a>
303 <h2 class="section"><a href="ffmpeg-protocols.html#toc-http">2.10 http</a></h2>
304
305 <p>HTTP (Hyper Text Transfer Protocol).
306 </p>
307 <p>This protocol accepts the following options.
308 </p>
309 <dl compact="compact">
310 <dt> &lsquo;<samp>seekable</samp>&rsquo;</dt>
311 <dd><p>Control seekability of connection. If set to 1 the resource is
312 supposed to be seekable, if set to 0 it is assumed not to be seekable,
313 if set to -1 it will try to autodetect if it is seekable. Default
314 value is -1.
315 </p>
316 </dd>
317 <dt> &lsquo;<samp>chunked_post</samp>&rsquo;</dt>
318 <dd><p>If set to 1 use chunked transfer-encoding for posts, default is 1.
319 </p>
320 </dd>
321 <dt> &lsquo;<samp>headers</samp>&rsquo;</dt>
322 <dd><p>Set custom HTTP headers, can override built in default headers. The
323 value must be a string encoding the headers.
324 </p>
325 </dd>
326 <dt> &lsquo;<samp>content_type</samp>&rsquo;</dt>
327 <dd><p>Force a content type.
328 </p>
329 </dd>
330 <dt> &lsquo;<samp>user-agent</samp>&rsquo;</dt>
331 <dd><p>Override User-Agent header. If not specified the protocol will use a
332 string describing the libavformat build.
333 </p>
334 </dd>
335 <dt> &lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
336 <dd><p>Use persistent connections if set to 1. By default it is 0.
337 </p>
338 </dd>
339 <dt> &lsquo;<samp>post_data</samp>&rsquo;</dt>
340 <dd><p>Set custom HTTP post data.
341 </p>
342 </dd>
343 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
344 <dd><p>Set timeout of socket I/O operations used by the underlying low level
345 operation. By default it is set to -1, which means that the timeout is
346 not specified.
347 </p>
348 </dd>
349 <dt> &lsquo;<samp>mime_type</samp>&rsquo;</dt>
350 <dd><p>Set MIME type.
351 </p>
352 </dd>
353 <dt> &lsquo;<samp>icy</samp>&rsquo;</dt>
354 <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
355 supports this, the metadata has to be retrieved by the application by reading
356 the &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
357 The default is 0.
358 </p>
359 </dd>
360 <dt> &lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
361 <dd><p>If the server supports ICY metadata, this contains the ICY specific HTTP reply
362 headers, separated with newline characters.
363 </p>
364 </dd>
365 <dt> &lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
366 <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
367 contains the last non-empty metadata packet sent by the server.
368 </p>
369 </dd>
370 <dt> &lsquo;<samp>cookies</samp>&rsquo;</dt>
371 <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
372 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
373 delimited by a newline character.
374 </p></dd>
375 </dl>
376
377 <a name="HTTP-Cookies"></a>
378 <h3 class="subsection"><a href="ffmpeg-protocols.html#toc-HTTP-Cookies">2.10.1 HTTP Cookies</a></h3>
379
380 <p>Some HTTP requests will be denied unless cookie values are passed in with the
381 request. The &lsquo;<samp>cookies</samp>&rsquo; option allows these cookies to be specified. At
382 the very least, each cookie must specify a value along with a path and domain.
383 HTTP requests that match both the domain and path will automatically include the
384 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
385 by a newline.
386 </p>
387 <p>The required syntax to play a stream specifying a cookie is:
388 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
389 </pre></td></tr></table>
390
391 <a name="mmst"></a>
392 <h2 class="section"><a href="ffmpeg-protocols.html#toc-mmst">2.11 mmst</a></h2>
393
394 <p>MMS (Microsoft Media Server) protocol over TCP.
395 </p>
396 <a name="mmsh"></a>
397 <h2 class="section"><a href="ffmpeg-protocols.html#toc-mmsh">2.12 mmsh</a></h2>
398
399 <p>MMS (Microsoft Media Server) protocol over HTTP.
400 </p>
401 <p>The required syntax is:
402 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
403 </pre></td></tr></table>
404
405 <a name="md5"></a>
406 <h2 class="section"><a href="ffmpeg-protocols.html#toc-md5">2.13 md5</a></h2>
407
408 <p>MD5 output protocol.
409 </p>
410 <p>Computes the MD5 hash of the data to be written, and on close writes
411 this to the designated output or stdout if none is specified. It can
412 be used to test muxers without writing an actual file.
413 </p>
414 <p>Some examples follow.
415 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
416 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
417
418 # Write the MD5 hash of the encoded AVI file to stdout.
419 ffmpeg -i input.flv -f avi -y md5:
420 </pre></td></tr></table>
421
422 <p>Note that some formats (typically MOV) require the output protocol to
423 be seekable, so they will fail with the MD5 output protocol.
424 </p>
425 <a name="pipe"></a>
426 <h2 class="section"><a href="ffmpeg-protocols.html#toc-pipe">2.14 pipe</a></h2>
427
428 <p>UNIX pipe access protocol.
429 </p>
430 <p>Allow to read and write from UNIX pipes.
431 </p>
432 <p>The accepted syntax is:
433 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
434 </pre></td></tr></table>
435
436 <p><var>number</var> is the number corresponding to the file descriptor of the
437 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
438 is not specified, by default the stdout file descriptor will be used
439 for writing, stdin for reading.
440 </p>
441 <p>For example to read from stdin with <code>ffmpeg</code>:
442 </p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
443 # ...this is the same as...
444 cat test.wav | ffmpeg -i pipe:
445 </pre></td></tr></table>
446
447 <p>For writing to stdout with <code>ffmpeg</code>:
448 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
449 # ...this is the same as...
450 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
451 </pre></td></tr></table>
452
453 <p>This protocol accepts the following options:
454 </p>
455 <dl compact="compact">
456 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
457 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
458 <code>INT_MAX</code>, which results in not limiting the requested block size.
459 Setting this value reasonably low improves user termination request reaction
460 time, which is valuable if data transmission is slow.
461 </p></dd>
462 </dl>
463
464 <p>Note that some formats (typically MOV), require the output protocol to
465 be seekable, so they will fail with the pipe output protocol.
466 </p>
467 <a name="rtmp"></a>
468 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmp">2.15 rtmp</a></h2>
469
470 <p>Real-Time Messaging Protocol.
471 </p>
472 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
473 content across a TCP/IP network.
474 </p>
475 <p>The required syntax is:
476 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://[<var>username</var>:<var>password</var>@]<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>instance</var>][/<var>playpath</var>]
477 </pre></td></tr></table>
478
479 <p>The accepted parameters are:
480 </p><dl compact="compact">
481 <dt> &lsquo;<samp>username</samp>&rsquo;</dt>
482 <dd><p>An optional username (mostly for publishing).
483 </p>
484 </dd>
485 <dt> &lsquo;<samp>password</samp>&rsquo;</dt>
486 <dd><p>An optional password (mostly for publishing).
487 </p>
488 </dd>
489 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
490 <dd><p>The address of the RTMP server.
491 </p>
492 </dd>
493 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
494 <dd><p>The number of the TCP port to use (by default is 1935).
495 </p>
496 </dd>
497 <dt> &lsquo;<samp>app</samp>&rsquo;</dt>
498 <dd><p>It is the name of the application to access. It usually corresponds to
499 the path where the application is installed on the RTMP server
500 (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
501 the value parsed from the URI through the <code>rtmp_app</code> option, too.
502 </p>
503 </dd>
504 <dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
505 <dd><p>It is the path or name of the resource to play with reference to the
506 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
507 can override the value parsed from the URI through the <code>rtmp_playpath</code>
508 option, too.
509 </p>
510 </dd>
511 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
512 <dd><p>Act as a server, listening for an incoming connection.
513 </p>
514 </dd>
515 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
516 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
517 </p></dd>
518 </dl>
519
520 <p>Additionally, the following parameters can be set via command line options
521 (or in code via <code>AVOption</code>s):
522 </p><dl compact="compact">
523 <dt> &lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
524 <dd><p>Name of application to connect on the RTMP server. This option
525 overrides the parameter specified in the URI.
526 </p>
527 </dd>
528 <dt> &lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
529 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
530 </p>
531 </dd>
532 <dt> &lsquo;<samp>rtmp_conn</samp>&rsquo;</dt>
533 <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
534 e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
535 Each value is prefixed by a single character denoting the type,
536 B for Boolean, N for number, S for string, O for object, or Z for null,
537 followed by a colon. For Booleans the data must be either 0 or 1 for
538 FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
539 1 to end or begin an object, respectively. Data items in subobjects may
540 be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
541 the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
542 times to construct arbitrary AMF sequences.
543 </p>
544 </dd>
545 <dt> &lsquo;<samp>rtmp_flashver</samp>&rsquo;</dt>
546 <dd><p>Version of the Flash plugin used to run the SWF player. The default
547 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
548 &lt;libavformat version&gt;).)
549 </p>
550 </dd>
551 <dt> &lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
552 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
553 is 10.
554 </p>
555 </dd>
556 <dt> &lsquo;<samp>rtmp_live</samp>&rsquo;</dt>
557 <dd><p>Specify that the media is a live stream. No resuming or seeking in
558 live streams is possible. The default value is <code>any</code>, which means the
559 subscriber first tries to play the live stream specified in the
560 playpath. If a live stream of that name is not found, it plays the
561 recorded stream. The other possible values are <code>live</code> and
562 <code>recorded</code>.
563 </p>
564 </dd>
565 <dt> &lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
566 <dd><p>URL of the web page in which the media was embedded. By default no
567 value will be sent.
568 </p>
569 </dd>
570 <dt> &lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
571 <dd><p>Stream identifier to play or to publish. This option overrides the
572 parameter specified in the URI.
573 </p>
574 </dd>
575 <dt> &lsquo;<samp>rtmp_subscribe</samp>&rsquo;</dt>
576 <dd><p>Name of live stream to subscribe to. By default no value will be sent.
577 It is only sent if the option is specified or if rtmp_live
578 is set to live.
579 </p>
580 </dd>
581 <dt> &lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
582 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
583 </p>
584 </dd>
585 <dt> &lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
586 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
587 </p>
588 </dd>
589 <dt> &lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
590 <dd><p>URL of the SWF player for the media. By default no value will be sent.
591 </p>
592 </dd>
593 <dt> &lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
594 <dd><p>URL to player swf file, compute hash/size automatically.
595 </p>
596 </dd>
597 <dt> &lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
598 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
599 </p>
600 </dd>
601 </dl>
602
603 <p>For example to read with <code>ffplay</code> a multimedia resource named
604 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
605 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
606 </pre></td></tr></table>
607
608 <p>To publish to a password protected server, passing the playpath and
609 app names separately:
610 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
611 </pre></td></tr></table>
612
613 <a name="rtmpe"></a>
614 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmpe">2.16 rtmpe</a></h2>
615
616 <p>Encrypted Real-Time Messaging Protocol.
617 </p>
618 <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
619 streaming multimedia content within standard cryptographic primitives,
620 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
621 a pair of RC4 keys.
622 </p>
623 <a name="rtmps"></a>
624 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmps">2.17 rtmps</a></h2>
625
626 <p>Real-Time Messaging Protocol over a secure SSL connection.
627 </p>
628 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
629 multimedia content across an encrypted connection.
630 </p>
631 <a name="rtmpt"></a>
632 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmpt">2.18 rtmpt</a></h2>
633
634 <p>Real-Time Messaging Protocol tunneled through HTTP.
635 </p>
636 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
637 for streaming multimedia content within HTTP requests to traverse
638 firewalls.
639 </p>
640 <a name="rtmpte"></a>
641 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmpte">2.19 rtmpte</a></h2>
642
643 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
644 </p>
645 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
646 is used for streaming multimedia content within HTTP requests to traverse
647 firewalls.
648 </p>
649 <a name="rtmpts"></a>
650 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtmpts">2.20 rtmpts</a></h2>
651
652 <p>Real-Time Messaging Protocol tunneled through HTTPS.
653 </p>
654 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
655 for streaming multimedia content within HTTPS requests to traverse
656 firewalls.
657 </p>
658 <a name="libssh"></a>
659 <h2 class="section"><a href="ffmpeg-protocols.html#toc-libssh">2.21 libssh</a></h2>
660
661 <p>Secure File Transfer Protocol via libssh
662 </p>
663 <p>Allow to read from or write to remote resources using SFTP protocol.
664 </p>
665 <p>Following syntax is required.
666 </p>
667 <table><tr><td>&nbsp;</td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
668 </pre></td></tr></table>
669
670 <p>This protocol accepts the following options.
671 </p>
672 <dl compact="compact">
673 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
674 <dd><p>Set timeout of socket I/O operations used by the underlying low level
675 operation. By default it is set to -1, which means that the timeout
676 is not specified.
677 </p>
678 </dd>
679 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
680 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
681 truncating. Default value is 1.
682 </p>
683 </dd>
684 </dl>
685
686 <p>Example: Play a file stored on remote server.
687 </p>
688 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
689 </pre></td></tr></table>
690
691 <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
692 <h2 class="section"><a href="ffmpeg-protocols.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">2.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
693
694 <p>Real-Time Messaging Protocol and its variants supported through
695 librtmp.
696 </p>
697 <p>Requires the presence of the librtmp headers and library during
698 configuration. You need to explicitly configure the build with
699 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
700 protocol.
701 </p>
702 <p>This protocol provides most client functions and a few server
703 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
704 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
705 variants of these encrypted types (RTMPTE, RTMPTS).
706 </p>
707 <p>The required syntax is:
708 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
709 </pre></td></tr></table>
710
711 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
712 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
713 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
714 meaning as specified for the RTMP native protocol.
715 <var>options</var> contains a list of space-separated options of the form
716 <var>key</var>=<var>val</var>.
717 </p>
718 <p>See the librtmp manual page (man 3 librtmp) for more information.
719 </p>
720 <p>For example, to stream a file in real-time to an RTMP server using
721 <code>ffmpeg</code>:
722 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
723 </pre></td></tr></table>
724
725 <p>To play the same stream using <code>ffplay</code>:
726 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
727 </pre></td></tr></table>
728
729 <a name="rtp"></a>
730 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtp">2.23 rtp</a></h2>
731
732 <p>Real-time Transport Protocol.
733 </p>
734 <p>The required syntax for an RTP URL is:
735 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
736 </p>
737 <p><var>port</var> specifies the RTP port to use.
738 </p>
739 <p>The following URL options are supported:
740 </p>
741 <dl compact="compact">
742 <dt> &lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
743 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
744 </p>
745 </dd>
746 <dt> &lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
747 <dd><p>Set the remote RTCP port to <var>n</var>.
748 </p>
749 </dd>
750 <dt> &lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
751 <dd><p>Set the local RTP port to <var>n</var>.
752 </p>
753 </dd>
754 <dt> &lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
755 <dd><p>Set the local RTCP port to <var>n</var>.
756 </p>
757 </dd>
758 <dt> &lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
759 <dd><p>Set max packet size (in bytes) to <var>n</var>.
760 </p>
761 </dd>
762 <dt> &lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
763 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
764 to 0).
765 </p>
766 </dd>
767 <dt> &lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
768 <dd><p>List allowed source IP addresses.
769 </p>
770 </dd>
771 <dt> &lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
772 <dd><p>List disallowed (blocked) source IP addresses.
773 </p>
774 </dd>
775 <dt> &lsquo;<samp>write_to_source=0|1</samp>&rsquo;</dt>
776 <dd><p>Send packets to the source address of the latest received packet (if
777 set to 1) or to a default remote address (if set to 0).
778 </p>
779 </dd>
780 <dt> &lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
781 <dd><p>Set the local RTP port to <var>n</var>.
782 </p>
783 <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
784 used.
785 </p>
786 </dd>
787 </dl>
788
789 <p>Important notes:
790 </p>
791 <ol>
792 <li>
793 If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
794 port value plus 1.
795
796 </li><li>
797 If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
798 port will be used for the local RTP and RTCP ports.
799
800 </li><li>
801 If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
802 set to the the local RTP port value plus 1.
803 </li></ol>
804
805 <a name="rtsp"></a>
806 <h2 class="section"><a href="ffmpeg-protocols.html#toc-rtsp">2.24 rtsp</a></h2>
807
808 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
809 and muxer. The demuxer supports both normal RTSP (with data transferred
810 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
811 data transferred over RDT).
812 </p>
813 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
814 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
815 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
816 </p>
817 <p>The required syntax for a RTSP url is:
818 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
819 </pre></td></tr></table>
820
821 <p>The following options (set on the <code>ffmpeg</code>/<code>ffplay</code> command
822 line, or set in code via <code>AVOption</code>s or in <code>avformat_open_input</code>),
823 are supported:
824 </p>
825 <p>Flags for <code>rtsp_transport</code>:
826 </p>
827 <dl compact="compact">
828 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
829 <dd><p>Use UDP as lower transport protocol.
830 </p>
831 </dd>
832 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
833 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
834 transport protocol.
835 </p>
836 </dd>
837 <dt> &lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
838 <dd><p>Use UDP multicast as lower transport protocol.
839 </p>
840 </dd>
841 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
842 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
843 passing proxies.
844 </p></dd>
845 </dl>
846
847 <p>Multiple lower transport protocols may be specified, in that case they are
848 tried one at a time (if the setup of one fails, the next one is tried).
849 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
850 </p>
851 <p>Flags for <code>rtsp_flags</code>:
852 </p>
853 <dl compact="compact">
854 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
855 <dd><p>Accept packets only from negotiated peer address and port.
856 </p></dd>
857 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
858 <dd><p>Act as a server, listening for an incoming connection.
859 </p></dd>
860 </dl>
861
862 <p>When receiving data over UDP, the demuxer tries to reorder received packets
863 (since they may arrive out of order, or packets may get lost totally). This
864 can be disabled by setting the maximum demuxing delay to zero (via
865 the <code>max_delay</code> field of AVFormatContext).
866 </p>
867 <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
868 streams to display can be chosen with <code>-vst</code> <var>n</var> and
869 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
870 on the fly by pressing <code>v</code> and <code>a</code>.
871 </p>
872 <p>Example command lines:
873 </p>
874 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
875 </p>
876 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
877 </pre></td></tr></table>
878
879 <p>To watch a stream tunneled over HTTP:
880 </p>
881 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
882 </pre></td></tr></table>
883
884 <p>To send a stream in realtime to a RTSP server, for others to watch:
885 </p>
886 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
887 </pre></td></tr></table>
888
889 <p>To receive a stream in realtime:
890 </p>
891 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
892 </pre></td></tr></table>
893
894 <dl compact="compact">
895 <dt> &lsquo;<samp>stimeout</samp>&rsquo;</dt>
896 <dd><p>Socket IO timeout in micro seconds.
897 </p></dd>
898 </dl>
899
900 <a name="sap"></a>
901 <h2 class="section"><a href="ffmpeg-protocols.html#toc-sap">2.25 sap</a></h2>
902
903 <p>Session Announcement Protocol (RFC 2974). This is not technically a
904 protocol handler in libavformat, it is a muxer and demuxer.
905 It is used for signalling of RTP streams, by announcing the SDP for the
906 streams regularly on a separate port.
907 </p>
908 <a name="Muxer"></a>
909 <h3 class="subsection"><a href="ffmpeg-protocols.html#toc-Muxer">2.25.1 Muxer</a></h3>
910
911 <p>The syntax for a SAP url given to the muxer is:
912 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
913 </pre></td></tr></table>
914
915 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
916 or to port 5004 if no port is specified.
917 <var>options</var> is a <code>&amp;</code>-separated list. The following options
918 are supported:
919 </p>
920 <dl compact="compact">
921 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
922 <dd><p>Specify the destination IP address for sending the announcements to.
923 If omitted, the announcements are sent to the commonly used SAP
924 announcement multicast address 224.2.127.254 (sap.mcast.net), or
925 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
926 </p>
927 </dd>
928 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
929 <dd><p>Specify the port to send the announcements on, defaults to
930 9875 if not specified.
931 </p>
932 </dd>
933 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
934 <dd><p>Specify the time to live value for the announcements and RTP packets,
935 defaults to 255.
936 </p>
937 </dd>
938 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
939 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
940 default), all streams are sent on unique ports, with each stream on a
941 port 2 numbers higher than the previous.
942 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
943 The RTP stack in libavformat for receiving requires all streams to be sent
944 on unique ports.
945 </p></dd>
946 </dl>
947
948 <p>Example command lines follow.
949 </p>
950 <p>To broadcast a stream on the local subnet, for watching in VLC:
951 </p>
952 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
953 </pre></td></tr></table>
954
955 <p>Similarly, for watching in <code>ffplay</code>:
956 </p>
957 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
958 </pre></td></tr></table>
959
960 <p>And for watching in <code>ffplay</code>, over IPv6:
961 </p>
962 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
963 </pre></td></tr></table>
964
965 <a name="Demuxer"></a>
966 <h3 class="subsection"><a href="ffmpeg-protocols.html#toc-Demuxer">2.25.2 Demuxer</a></h3>
967
968 <p>The syntax for a SAP url given to the demuxer is:
969 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
970 </pre></td></tr></table>
971
972 <p><var>address</var> is the multicast address to listen for announcements on,
973 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
974 is the port that is listened on, 9875 if omitted.
975 </p>
976 <p>The demuxers listens for announcements on the given address and port.
977 Once an announcement is received, it tries to receive that particular stream.
978 </p>
979 <p>Example command lines follow.
980 </p>
981 <p>To play back the first stream announced on the normal SAP multicast address:
982 </p>
983 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
984 </pre></td></tr></table>
985
986 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
987 </p>
988 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
989 </pre></td></tr></table>
990
991 <a name="sctp"></a>
992 <h2 class="section"><a href="ffmpeg-protocols.html#toc-sctp">2.26 sctp</a></h2>
993
994 <p>Stream Control Transmission Protocol.
995 </p>
996 <p>The accepted URL syntax is:
997 </p><table><tr><td>&nbsp;</td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
998 </pre></td></tr></table>
999
1000 <p>The protocol accepts the following options:
1001 </p><dl compact="compact">
1002 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
1003 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
1004 </p>
1005 </dd>
1006 <dt> &lsquo;<samp>max_streams</samp>&rsquo;</dt>
1007 <dd><p>Set the maximum number of streams. By default no limit is set.
1008 </p></dd>
1009 </dl>
1010
1011 <a name="srtp"></a>
1012 <h2 class="section"><a href="ffmpeg-protocols.html#toc-srtp">2.27 srtp</a></h2>
1013
1014 <p>Secure Real-time Transport Protocol.
1015 </p>
1016 <p>The accepted options are:
1017 </p><dl compact="compact">
1018 <dt> &lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
1019 <dt> &lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
1020 <dd><p>Select input and output encoding suites.
1021 </p>
1022 <p>Supported values:
1023 </p><dl compact="compact">
1024 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
1025 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
1026 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
1027 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
1028 </dl>
1029
1030 </dd>
1031 <dt> &lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
1032 <dt> &lsquo;<samp>srtp_out_params</samp>&rsquo;</dt>
1033 <dd><p>Set input and output encoding parameters, which are expressed by a
1034 base64-encoded representation of a binary block. The first 16 bytes of
1035 this binary block are used as master key, the following 14 bytes are
1036 used as master salt.
1037 </p></dd>
1038 </dl>
1039
1040 <a name="tcp"></a>
1041 <h2 class="section"><a href="ffmpeg-protocols.html#toc-tcp">2.28 tcp</a></h2>
1042
1043 <p>Trasmission Control Protocol.
1044 </p>
1045 <p>The required syntax for a TCP url is:
1046 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1047 </pre></td></tr></table>
1048
1049 <dl compact="compact">
1050 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
1051 <dd><p>Listen for an incoming connection
1052 </p>
1053 </dd>
1054 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
1055 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
1056 In write mode: if socket cannot be written in more than this time interval, raise error.
1057 This also sets timeout on TCP connection establishing.
1058 </p>
1059 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
1060 ffplay tcp://<var>hostname</var>:<var>port</var>
1061 </pre></td></tr></table>
1062
1063 </dd>
1064 </dl>
1065
1066 <a name="tls"></a>
1067 <h2 class="section"><a href="ffmpeg-protocols.html#toc-tls">2.29 tls</a></h2>
1068
1069 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
1070 </p>
1071 <p>The required syntax for a TLS/SSL url is:
1072 </p><table><tr><td>&nbsp;</td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1073 </pre></td></tr></table>
1074
1075 <p>The following parameters can be set via command line options
1076 (or in code via <code>AVOption</code>s):
1077 </p>
1078 <dl compact="compact">
1079 <dt> &lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</dt>
1080 <dd><p>A file containing certificate authority (CA) root certificates to treat
1081 as trusted. If the linked TLS library contains a default this might not
1082 need to be specified for verification to work, but not all libraries and
1083 setups have defaults built in.
1084 The file must be in OpenSSL PEM format.
1085 </p>
1086 </dd>
1087 <dt> &lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</dt>
1088 <dd><p>If enabled, try to verify the peer that we are communicating with.
1089 Note, if using OpenSSL, this currently only makes sure that the
1090 peer certificate is signed by one of the root certificates in the CA
1091 database, but it does not validate that the certificate actually
1092 matches the host name we are trying to connect to. (With GnuTLS,
1093 the host name is validated as well.)
1094 </p>
1095 <p>This is disabled by default since it requires a CA database to be
1096 provided by the caller in many cases.
1097 </p>
1098 </dd>
1099 <dt> &lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</dt>
1100 <dd><p>A file containing a certificate to use in the handshake with the peer.
1101 (When operating as server, in listen mode, this is more often required
1102 by the peer, while client certificates only are mandated in certain
1103 setups.)
1104 </p>
1105 </dd>
1106 <dt> &lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
1107 <dd><p>A file containing the private key for the certificate.
1108 </p>
1109 </dd>
1110 <dt> &lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
1111 <dd><p>If enabled, listen for connections on the provided port, and assume
1112 the server role in the handshake instead of the client role.
1113 </p>
1114 </dd>
1115 </dl>
1116
1117 <p>Example command lines:
1118 </p>
1119 <p>To create a TLS/SSL server that serves an input stream.
1120 </p>
1121 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&amp;cert=<var>server.crt</var>&amp;key=<var>server.key</var>
1122 </pre></td></tr></table>
1123
1124 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
1125 </p>
1126 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
1127 </pre></td></tr></table>
1128
1129 <a name="udp"></a>
1130 <h2 class="section"><a href="ffmpeg-protocols.html#toc-udp">2.30 udp</a></h2>
1131
1132 <p>User Datagram Protocol.
1133 </p>
1134 <p>The required syntax for a UDP url is:
1135 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1136 </pre></td></tr></table>
1137
1138 <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
1139 </p>
1140 <p>In case threading is enabled on the system, a circular buffer is used
1141 to store the incoming data, which allows to reduce loss of data due to
1142 UDP socket buffer overruns. The <var>fifo_size</var> and
1143 <var>overrun_nonfatal</var> options are related to this buffer.
1144 </p>
1145 <p>The list of supported options follows.
1146 </p>
1147 <dl compact="compact">
1148 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
1149 <dd><p>Set the UDP socket buffer size in bytes. This is used both for the
1150 receiving and the sending buffer size.
1151 </p>
1152 </dd>
1153 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
1154 <dd><p>Override the local UDP port to bind with.
1155 </p>
1156 </dd>
1157 <dt> &lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</dt>
1158 <dd><p>Choose the local IP address. This is useful e.g. if sending multicast
1159 and the host has multiple interfaces, where the user can choose
1160 which interface to send on by specifying the IP address of that interface.
1161 </p>
1162 </dd>
1163 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
1164 <dd><p>Set the size in bytes of UDP packets.
1165 </p>
1166 </dd>
1167 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
1168 <dd><p>Explicitly allow or disallow reusing UDP sockets.
1169 </p>
1170 </dd>
1171 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
1172 <dd><p>Set the time to live value (for multicast only).
1173 </p>
1174 </dd>
1175 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
1176 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
1177 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
1178 If the destination address isn&rsquo;t known at the start, this option can
1179 be specified in ff_udp_set_remote_url, too.
1180 This allows finding out the source address for the packets with getsockname,
1181 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
1182 unreachable&quot; is received.
1183 For receiving, this gives the benefit of only receiving packets from
1184 the specified peer address/port.
1185 </p>
1186 </dd>
1187 <dt> &lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
1188 <dd><p>Only receive packets sent to the multicast group from one of the
1189 specified sender IP addresses.
1190 </p>
1191 </dd>
1192 <dt> &lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
1193 <dd><p>Ignore packets sent to the multicast group from the specified
1194 sender IP addresses.
1195 </p>
1196 </dd>
1197 <dt> &lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</dt>
1198 <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
1199 packets with size of 188 bytes. If not specified defaults to 7*4096.
1200 </p>
1201 </dd>
1202 <dt> &lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
1203 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
1204 value is 0.
1205 </p>
1206 </dd>
1207 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
1208 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
1209 </p></dd>
1210 </dl>
1211
1212 <p>Some usage examples of the UDP protocol with <code>ffmpeg</code> follow.
1213 </p>
1214 <p>To stream over UDP to a remote endpoint:
1215 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
1216 </pre></td></tr></table>
1217
1218 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
1219 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
1220 </pre></td></tr></table>
1221
1222 <p>To receive over UDP from a remote endpoint:
1223 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
1224 </pre></td></tr></table>
1225
1226 <a name="unix"></a>
1227 <h2 class="section"><a href="ffmpeg-protocols.html#toc-unix">2.31 unix</a></h2>
1228
1229 <p>Unix local socket
1230 </p>
1231 <p>The required syntax for a Unix socket URL is:
1232 </p>
1233 <table><tr><td>&nbsp;</td><td><pre class="example">unix://<var>filepath</var>
1234 </pre></td></tr></table>
1235
1236 <p>The following parameters can be set via command line options
1237 (or in code via <code>AVOption</code>s):
1238 </p>
1239 <dl compact="compact">
1240 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
1241 <dd><p>Timeout in ms.
1242 </p></dd>
1243 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
1244 <dd><p>Create the Unix socket in listening mode.
1245 </p></dd>
1246 </dl>
1247
1248
1249 <a name="See-Also"></a>
1250 <h1 class="chapter"><a href="ffmpeg-protocols.html#toc-See-Also">3. See Also</a></h1>
1251
1252 <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
1253 <a href="libavformat.html">libavformat</a>
1254 </p>
1255
1256 <a name="Authors"></a>
1257 <h1 class="chapter"><a href="ffmpeg-protocols.html#toc-Authors">4. Authors</a></h1>
1258
1259 <p>The FFmpeg developers.
1260 </p>
1261 <p>For details about the authorship, see the Git history of the project
1262 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
1263 <code>git log</code> in the FFmpeg source directory, or browsing the
1264 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
1265 </p>
1266 <p>Maintainers for the specific components are listed in the file
1267 &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
1268 </p>
1269
1270 <footer class="footer pagination-right">
1271 <span class="label label-info">This document was generated by <em>Kyle Schwarz</em> on <em>December 14, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.</span></footer></div></div></body>