Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2553 lines
100KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Protocols Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg Protocols Documentation
  17. </h1>
  18. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <div class="Contents_element" id="SEC_Contents">
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  26. <li><a id="toc-Protocol-Options" href="#Protocol-Options">2 Protocol Options</a></li>
  27. <li><a id="toc-Protocols" href="#Protocols">3 Protocols</a>
  28. <ul class="no-bullet">
  29. <li><a id="toc-amqp" href="#amqp">3.1 amqp</a></li>
  30. <li><a id="toc-async" href="#async">3.2 async</a></li>
  31. <li><a id="toc-bluray" href="#bluray">3.3 bluray</a></li>
  32. <li><a id="toc-cache" href="#cache">3.4 cache</a></li>
  33. <li><a id="toc-concat" href="#concat">3.5 concat</a></li>
  34. <li><a id="toc-concatf" href="#concatf">3.6 concatf</a></li>
  35. <li><a id="toc-crypto" href="#crypto">3.7 crypto</a></li>
  36. <li><a id="toc-data" href="#data">3.8 data</a></li>
  37. <li><a id="toc-fd" href="#fd">3.9 fd</a></li>
  38. <li><a id="toc-file" href="#file">3.10 file</a></li>
  39. <li><a id="toc-ftp" href="#ftp">3.11 ftp</a></li>
  40. <li><a id="toc-gopher" href="#gopher">3.12 gopher</a></li>
  41. <li><a id="toc-gophers" href="#gophers">3.13 gophers</a></li>
  42. <li><a id="toc-hls" href="#hls">3.14 hls</a></li>
  43. <li><a id="toc-http" href="#http">3.15 http</a>
  44. <ul class="no-bullet">
  45. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">3.15.1 HTTP Cookies</a></li>
  46. </ul></li>
  47. <li><a id="toc-Icecast" href="#Icecast">3.16 Icecast</a></li>
  48. <li><a id="toc-ipfs" href="#ipfs">3.17 ipfs</a></li>
  49. <li><a id="toc-mmst" href="#mmst">3.18 mmst</a></li>
  50. <li><a id="toc-mmsh" href="#mmsh">3.19 mmsh</a></li>
  51. <li><a id="toc-md5" href="#md5">3.20 md5</a></li>
  52. <li><a id="toc-pipe" href="#pipe">3.21 pipe</a></li>
  53. <li><a id="toc-prompeg" href="#prompeg">3.22 prompeg</a></li>
  54. <li><a id="toc-rist" href="#rist">3.23 rist</a></li>
  55. <li><a id="toc-rtmp" href="#rtmp">3.24 rtmp</a></li>
  56. <li><a id="toc-rtmpe" href="#rtmpe">3.25 rtmpe</a></li>
  57. <li><a id="toc-rtmps" href="#rtmps">3.26 rtmps</a></li>
  58. <li><a id="toc-rtmpt" href="#rtmpt">3.27 rtmpt</a></li>
  59. <li><a id="toc-rtmpte" href="#rtmpte">3.28 rtmpte</a></li>
  60. <li><a id="toc-rtmpts" href="#rtmpts">3.29 rtmpts</a></li>
  61. <li><a id="toc-libsmbclient" href="#libsmbclient">3.30 libsmbclient</a></li>
  62. <li><a id="toc-libssh" href="#libssh">3.31 libssh</a></li>
  63. <li><a id="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">3.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  64. <li><a id="toc-rtp" href="#rtp">3.33 rtp</a></li>
  65. <li><a id="toc-rtsp" href="#rtsp">3.34 rtsp</a>
  66. <ul class="no-bullet">
  67. <li><a id="toc-Muxer" href="#Muxer">3.34.1 Muxer</a></li>
  68. <li><a id="toc-Demuxer" href="#Demuxer">3.34.2 Demuxer</a></li>
  69. <li><a id="toc-Examples" href="#Examples">3.34.3 Examples</a></li>
  70. </ul></li>
  71. <li><a id="toc-sap" href="#sap">3.35 sap</a>
  72. <ul class="no-bullet">
  73. <li><a id="toc-Muxer-1" href="#Muxer-1">3.35.1 Muxer</a></li>
  74. <li><a id="toc-Demuxer-1" href="#Demuxer-1">3.35.2 Demuxer</a></li>
  75. </ul></li>
  76. <li><a id="toc-sctp" href="#sctp">3.36 sctp</a></li>
  77. <li><a id="toc-srt" href="#srt">3.37 srt</a></li>
  78. <li><a id="toc-srtp" href="#srtp">3.38 srtp</a></li>
  79. <li><a id="toc-subfile" href="#subfile">3.39 subfile</a></li>
  80. <li><a id="toc-tee" href="#tee">3.40 tee</a></li>
  81. <li><a id="toc-tcp" href="#tcp">3.41 tcp</a></li>
  82. <li><a id="toc-tls" href="#tls">3.42 tls</a></li>
  83. <li><a id="toc-udp" href="#udp">3.43 udp</a>
  84. <ul class="no-bullet">
  85. <li><a id="toc-Examples-1" href="#Examples-1">3.43.1 Examples</a></li>
  86. </ul></li>
  87. <li><a id="toc-unix" href="#unix">3.44 unix</a></li>
  88. <li><a id="toc-zmq" href="#zmq">3.45 zmq</a></li>
  89. </ul></li>
  90. <li><a id="toc-See-Also" href="#See-Also">4 See Also</a></li>
  91. <li><a id="toc-Authors" href="#Authors">5 Authors</a></li>
  92. </ul>
  93. </div>
  94. </div>
  95. <a name="Description"></a>
  96. <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  97. <p>This document describes the input and output protocols provided by the
  98. libavformat library.
  99. </p>
  100. <a name="Protocol-Options"></a>
  101. <h2 class="chapter">2 Protocol Options<span class="pull-right"><a class="anchor hidden-xs" href="#Protocol-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocol-Options" aria-hidden="true">TOC</a></span></h2>
  102. <p>The libavformat library provides some generic global options, which
  103. can be set on all the protocols. In addition each protocol may support
  104. so-called private options, which are specific for that component.
  105. </p>
  106. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  107. FFmpeg tools, or by setting the value explicitly in the
  108. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  109. for programmatic use.
  110. </p>
  111. <p>The list of supported options follows:
  112. </p>
  113. <dl compact="compact">
  114. <dt><span><samp>protocol_whitelist <var>list</var> (<em>input</em>)</samp></span></dt>
  115. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  116. prefixed by &quot;-&quot; are disabled.
  117. All protocols are allowed by default but protocols used by an another
  118. protocol (nested protocols) are restricted to a per protocol subset.
  119. </p></dd>
  120. </dl>
  121. <a name="Protocols"></a>
  122. <h2 class="chapter">3 Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocols" aria-hidden="true">TOC</a></span></h2>
  123. <p>Protocols are configured elements in FFmpeg that enable access to
  124. resources that require specific protocols.
  125. </p>
  126. <p>When you configure your FFmpeg build, all the supported protocols are
  127. enabled by default. You can list all available ones using the
  128. configure option &quot;&ndash;list-protocols&quot;.
  129. </p>
  130. <p>You can disable all the protocols using the configure option
  131. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  132. option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
  133. particular protocol using the option
  134. &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
  135. </p>
  136. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  137. supported protocols.
  138. </p>
  139. <p>All protocols accept the following options:
  140. </p>
  141. <dl compact="compact">
  142. <dt><span><samp>rw_timeout</samp></span></dt>
  143. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  144. in microseconds.
  145. </p></dd>
  146. </dl>
  147. <p>A description of the currently available protocols follows.
  148. </p>
  149. <a name="amqp"></a>
  150. <h3 class="section">3.1 amqp<span class="pull-right"><a class="anchor hidden-xs" href="#amqp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amqp" aria-hidden="true">TOC</a></span></h3>
  151. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  152. publish-subscribe communication protocol.
  153. </p>
  154. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  155. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  156. </p>
  157. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  158. the command:
  159. </p>
  160. <div class="example">
  161. <pre class="example">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  162. </pre></div>
  163. <p>Where hostname and port (default is 5672) is the address of the broker. The
  164. client may also set a user/password for authentication. The default for both
  165. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  166. default value is &quot;/&quot;.
  167. </p>
  168. <p>Muliple subscribers may stream from the broker using the command:
  169. </p><div class="example">
  170. <pre class="example">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  171. </pre></div>
  172. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  173. and each subscribing client has an assigned queue/buffer. When a packet arrives
  174. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  175. and routing_key fields.
  176. </p>
  177. <p>The following options are supported:
  178. </p>
  179. <dl compact="compact">
  180. <dt><span><samp>exchange</samp></span></dt>
  181. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  182. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  183. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  184. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  185. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  186. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  187. documentation).
  188. </p>
  189. </dd>
  190. <dt><span><samp>routing_key</samp></span></dt>
  191. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  192. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  193. to the queue of a subscriber.
  194. </p>
  195. </dd>
  196. <dt><span><samp>pkt_size</samp></span></dt>
  197. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  198. Minimum is 4096 and max is any large value (representable by an int). When
  199. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  200. equal to or greater than the size of the published packets to the broker. Otherwise
  201. the received message may be truncated causing decoding errors.
  202. </p>
  203. </dd>
  204. <dt><span><samp>connection_timeout</samp></span></dt>
  205. <dd><p>The timeout in seconds during the initial connection to the broker. The
  206. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  207. </p>
  208. </dd>
  209. <dt><span><samp>delivery_mode <var>mode</var></samp></span></dt>
  210. <dd><p>Sets the delivery mode of each message sent to broker.
  211. The following values are accepted:
  212. </p><dl compact="compact">
  213. <dt><span>&lsquo;<samp>persistent</samp>&rsquo;</span></dt>
  214. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  215. Messages may be written to the broker&rsquo;s disk depending on its setup.
  216. </p>
  217. </dd>
  218. <dt><span>&lsquo;<samp>non-persistent</samp>&rsquo;</span></dt>
  219. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  220. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  221. pressure.
  222. </p>
  223. </dd>
  224. </dl>
  225. </dd>
  226. </dl>
  227. <a name="async"></a>
  228. <h3 class="section">3.2 async<span class="pull-right"><a class="anchor hidden-xs" href="#async" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-async" aria-hidden="true">TOC</a></span></h3>
  229. <p>Asynchronous data filling wrapper for input stream.
  230. </p>
  231. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  232. </p>
  233. <div class="example">
  234. <pre class="example">async:<var>URL</var>
  235. async:http://host/resource
  236. async:cache:http://host/resource
  237. </pre></div>
  238. <a name="bluray"></a>
  239. <h3 class="section">3.3 bluray<span class="pull-right"><a class="anchor hidden-xs" href="#bluray" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bluray" aria-hidden="true">TOC</a></span></h3>
  240. <p>Read BluRay playlist.
  241. </p>
  242. <p>The accepted options are:
  243. </p><dl compact="compact">
  244. <dt><span><samp>angle</samp></span></dt>
  245. <dd><p>BluRay angle
  246. </p>
  247. </dd>
  248. <dt><span><samp>chapter</samp></span></dt>
  249. <dd><p>Start chapter (1...N)
  250. </p>
  251. </dd>
  252. <dt><span><samp>playlist</samp></span></dt>
  253. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  254. </p>
  255. </dd>
  256. </dl>
  257. <p>Examples:
  258. </p>
  259. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  260. </p><div class="example">
  261. <pre class="example">bluray:/mnt/bluray
  262. </pre></div>
  263. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  264. </p><div class="example">
  265. <pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  266. </pre></div>
  267. <a name="cache"></a>
  268. <h3 class="section">3.4 cache<span class="pull-right"><a class="anchor hidden-xs" href="#cache" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cache" aria-hidden="true">TOC</a></span></h3>
  269. <p>Caching wrapper for input stream.
  270. </p>
  271. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  272. </p>
  273. <p>The accepted options are:
  274. </p><dl compact="compact">
  275. <dt><span><samp>read_ahead_limit</samp></span></dt>
  276. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  277. -1 for unlimited. Default is 65536.
  278. </p>
  279. </dd>
  280. </dl>
  281. <p>URL Syntax is
  282. </p><div class="example">
  283. <pre class="example">cache:<var>URL</var>
  284. </pre></div>
  285. <a name="concat"></a>
  286. <h3 class="section">3.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat" aria-hidden="true">TOC</a></span></h3>
  287. <p>Physical concatenation protocol.
  288. </p>
  289. <p>Read and seek from many resources in sequence as if they were
  290. a unique resource.
  291. </p>
  292. <p>A URL accepted by this protocol has the syntax:
  293. </p><div class="example">
  294. <pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
  295. </pre></div>
  296. <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
  297. resource to be concatenated, each one possibly specifying a distinct
  298. protocol.
  299. </p>
  300. <p>For example to read a sequence of files <samp>split1.mpeg</samp>,
  301. <samp>split2.mpeg</samp>, <samp>split3.mpeg</samp> with <code>ffplay</code> use the
  302. command:
  303. </p><div class="example">
  304. <pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  305. </pre></div>
  306. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  307. many shells.
  308. </p>
  309. <a name="concatf"></a>
  310. <h3 class="section">3.6 concatf<span class="pull-right"><a class="anchor hidden-xs" href="#concatf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concatf" aria-hidden="true">TOC</a></span></h3>
  311. <p>Physical concatenation protocol using a line break delimited list of
  312. resources.
  313. </p>
  314. <p>Read and seek from many resources in sequence as if they were
  315. a unique resource.
  316. </p>
  317. <p>A URL accepted by this protocol has the syntax:
  318. </p><div class="example">
  319. <pre class="example">concatf:<var>URL</var>
  320. </pre></div>
  321. <p>where <var>URL</var> is the url containing a line break delimited list of
  322. resources to be concatenated, each one possibly specifying a distinct
  323. protocol. Special characters must be escaped with backslash or single
  324. quotes. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
  325. section in the ffmpeg-utils(1) manual</a>.
  326. </p>
  327. <p>For example to read a sequence of files <samp>split1.mpeg</samp>,
  328. <samp>split2.mpeg</samp>, <samp>split3.mpeg</samp> listed in separate lines within
  329. a file <samp>split.txt</samp> with <code>ffplay</code> use the command:
  330. </p><div class="example">
  331. <pre class="example">ffplay concatf:split.txt
  332. </pre></div>
  333. <p>Where <samp>split.txt</samp> contains the lines:
  334. </p><div class="example">
  335. <pre class="example">split1.mpeg
  336. split2.mpeg
  337. split3.mpeg
  338. </pre></div>
  339. <a name="crypto"></a>
  340. <h3 class="section">3.7 crypto<span class="pull-right"><a class="anchor hidden-xs" href="#crypto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crypto" aria-hidden="true">TOC</a></span></h3>
  341. <p>AES-encrypted stream reading protocol.
  342. </p>
  343. <p>The accepted options are:
  344. </p><dl compact="compact">
  345. <dt><span><samp>key</samp></span></dt>
  346. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  347. </p>
  348. </dd>
  349. <dt><span><samp>iv</samp></span></dt>
  350. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  351. </p></dd>
  352. </dl>
  353. <p>Accepted URL formats:
  354. </p><div class="example">
  355. <pre class="example">crypto:<var>URL</var>
  356. crypto+<var>URL</var>
  357. </pre></div>
  358. <a name="data"></a>
  359. <h3 class="section">3.8 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h3>
  360. <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>.
  361. </p>
  362. <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
  363. </p><div class="example">
  364. <pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  365. </pre></div>
  366. <a name="fd"></a>
  367. <h3 class="section">3.9 fd<span class="pull-right"><a class="anchor hidden-xs" href="#fd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fd" aria-hidden="true">TOC</a></span></h3>
  368. <p>File descriptor access protocol.
  369. </p>
  370. <p>The accepted syntax is:
  371. </p><div class="example">
  372. <pre class="example">fd: -fd <var>file_descriptor</var>
  373. </pre></div>
  374. <p>If <samp>fd</samp> is not specified, by default the stdout file descriptor will be
  375. used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has
  376. seek support if it corresponding to a regular file. fd protocol doesn&rsquo;t support
  377. pass file descriptor via URL for security.
  378. </p>
  379. <p>This protocol accepts the following options:
  380. </p>
  381. <dl compact="compact">
  382. <dt><span><samp>blocksize</samp></span></dt>
  383. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  384. <code>INT_MAX</code>, which results in not limiting the requested block size.
  385. Setting this value reasonably low improves user termination request reaction
  386. time, which is valuable if data transmission is slow.
  387. </p>
  388. </dd>
  389. <dt><span><samp>fd</samp></span></dt>
  390. <dd><p>Set file descriptor.
  391. </p></dd>
  392. </dl>
  393. <a name="file"></a>
  394. <h3 class="section">3.10 file<span class="pull-right"><a class="anchor hidden-xs" href="#file" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-file" aria-hidden="true">TOC</a></span></h3>
  395. <p>File access protocol.
  396. </p>
  397. <p>Read from or write to a file.
  398. </p>
  399. <p>A file URL can have the form:
  400. </p><div class="example">
  401. <pre class="example">file:<var>filename</var>
  402. </pre></div>
  403. <p>where <var>filename</var> is the path of the file to read.
  404. </p>
  405. <p>An URL that does not have a protocol prefix will be assumed to be a
  406. file URL. Depending on the build, an URL that looks like a Windows
  407. path with the drive letter at the beginning will also be assumed to be
  408. a file URL (usually not the case in builds for unix-like systems).
  409. </p>
  410. <p>For example to read from a file <samp>input.mpeg</samp> with <code>ffmpeg</code>
  411. use the command:
  412. </p><div class="example">
  413. <pre class="example">ffmpeg -i file:input.mpeg output.mpeg
  414. </pre></div>
  415. <p>This protocol accepts the following options:
  416. </p>
  417. <dl compact="compact">
  418. <dt><span><samp>truncate</samp></span></dt>
  419. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  420. truncating. Default value is 1.
  421. </p>
  422. </dd>
  423. <dt><span><samp>blocksize</samp></span></dt>
  424. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  425. <code>INT_MAX</code>, which results in not limiting the requested block size.
  426. Setting this value reasonably low improves user termination request reaction
  427. time, which is valuable for files on slow medium.
  428. </p>
  429. </dd>
  430. <dt><span><samp>follow</samp></span></dt>
  431. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  432. reading files that still are being written. In order for this to terminate,
  433. you either need to use the rw_timeout option, or use the interrupt callback
  434. (for API users).
  435. </p>
  436. </dd>
  437. <dt><span><samp>seekable</samp></span></dt>
  438. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  439. means auto (seekable for normal files, non-seekable for named pipes).
  440. </p>
  441. <p>Many demuxers handle seekable and non-seekable resources differently,
  442. overriding this might speed up opening certain files at the cost of losing some
  443. features (e.g. accurate seeking).
  444. </p></dd>
  445. </dl>
  446. <a name="ftp"></a>
  447. <h3 class="section">3.11 ftp<span class="pull-right"><a class="anchor hidden-xs" href="#ftp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ftp" aria-hidden="true">TOC</a></span></h3>
  448. <p>FTP (File Transfer Protocol).
  449. </p>
  450. <p>Read from or write to remote resources using FTP protocol.
  451. </p>
  452. <p>Following syntax is required.
  453. </p><div class="example">
  454. <pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  455. </pre></div>
  456. <p>This protocol accepts the following options.
  457. </p>
  458. <dl compact="compact">
  459. <dt><span><samp>timeout</samp></span></dt>
  460. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  461. operation. By default it is set to -1, which means that the timeout is
  462. not specified.
  463. </p>
  464. </dd>
  465. <dt><span><samp>ftp-user</samp></span></dt>
  466. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  467. user in the FTP URL.
  468. </p>
  469. </dd>
  470. <dt><span><samp>ftp-password</samp></span></dt>
  471. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  472. the password in the FTP URL, or by <samp>ftp-anonymous-password</samp> if no user is set.
  473. </p>
  474. </dd>
  475. <dt><span><samp>ftp-anonymous-password</samp></span></dt>
  476. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  477. should be used.
  478. </p>
  479. </dd>
  480. <dt><span><samp>ftp-write-seekable</samp></span></dt>
  481. <dd><p>Control seekability of connection during encoding. If set to 1 the
  482. resource is supposed to be seekable, if set to 0 it is assumed not
  483. to be seekable. Default value is 0.
  484. </p></dd>
  485. </dl>
  486. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  487. it, unless special care is taken (tests, customized server configuration
  488. etc.). Different FTP servers behave in different way during seek
  489. operation. ff* tools may produce incomplete content due to server limitations.
  490. </p>
  491. <a name="gopher"></a>
  492. <h3 class="section">3.12 gopher<span class="pull-right"><a class="anchor hidden-xs" href="#gopher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gopher" aria-hidden="true">TOC</a></span></h3>
  493. <p>Gopher protocol.
  494. </p>
  495. <a name="gophers"></a>
  496. <h3 class="section">3.13 gophers<span class="pull-right"><a class="anchor hidden-xs" href="#gophers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gophers" aria-hidden="true">TOC</a></span></h3>
  497. <p>Gophers protocol.
  498. </p>
  499. <p>The Gopher protocol with TLS encapsulation.
  500. </p>
  501. <a name="hls"></a>
  502. <h3 class="section">3.14 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls" aria-hidden="true">TOC</a></span></h3>
  503. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  504. a uniform one. The M3U8 playlists describing the segments can be
  505. remote HTTP resources or local files, accessed using the standard
  506. file protocol.
  507. The nested protocol is declared by specifying
  508. &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
  509. is either &quot;file&quot; or &quot;http&quot;.
  510. </p>
  511. <div class="example">
  512. <pre class="example">hls+http://host/path/to/remote/resource.m3u8
  513. hls+file://path/to/local/resource.m3u8
  514. </pre></div>
  515. <p>Using this protocol is discouraged - the hls demuxer should work
  516. just as well (if not, please report the issues) and is more complete.
  517. To use the hls demuxer instead, simply use the direct URLs to the
  518. m3u8 files.
  519. </p>
  520. <a name="http"></a>
  521. <h3 class="section">3.15 http<span class="pull-right"><a class="anchor hidden-xs" href="#http" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-http" aria-hidden="true">TOC</a></span></h3>
  522. <p>HTTP (Hyper Text Transfer Protocol).
  523. </p>
  524. <p>This protocol accepts the following options:
  525. </p>
  526. <dl compact="compact">
  527. <dt><span><samp>seekable</samp></span></dt>
  528. <dd><p>Control seekability of connection. If set to 1 the resource is
  529. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  530. if set to -1 it will try to autodetect if it is seekable. Default
  531. value is -1.
  532. </p>
  533. </dd>
  534. <dt><span><samp>chunked_post</samp></span></dt>
  535. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  536. </p>
  537. </dd>
  538. <dt><span><samp>content_type</samp></span></dt>
  539. <dd><p>Set a specific content type for the POST messages or for listen mode.
  540. </p>
  541. </dd>
  542. <dt><span><samp>http_proxy</samp></span></dt>
  543. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  544. </p>
  545. </dd>
  546. <dt><span><samp>headers</samp></span></dt>
  547. <dd><p>Set custom HTTP headers, can override built in default headers. The
  548. value must be a string encoding the headers.
  549. </p>
  550. </dd>
  551. <dt><span><samp>multiple_requests</samp></span></dt>
  552. <dd><p>Use persistent connections if set to 1, default is 0.
  553. </p>
  554. </dd>
  555. <dt><span><samp>post_data</samp></span></dt>
  556. <dd><p>Set custom HTTP post data.
  557. </p>
  558. </dd>
  559. <dt><span><samp>referer</samp></span></dt>
  560. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  561. </p>
  562. </dd>
  563. <dt><span><samp>user_agent</samp></span></dt>
  564. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  565. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  566. </p>
  567. </dd>
  568. <dt><span><samp>reconnect_at_eof</samp></span></dt>
  569. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  570. for live / endless streams.
  571. </p>
  572. </dd>
  573. <dt><span><samp>reconnect_streamed</samp></span></dt>
  574. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  575. </p>
  576. </dd>
  577. <dt><span><samp>reconnect_on_network_error</samp></span></dt>
  578. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  579. </p>
  580. </dd>
  581. <dt><span><samp>reconnect_on_http_error</samp></span></dt>
  582. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  583. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  584. </p>
  585. </dd>
  586. <dt><span><samp>reconnect_delay_max</samp></span></dt>
  587. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  588. </p>
  589. </dd>
  590. <dt><span><samp>mime_type</samp></span></dt>
  591. <dd><p>Export the MIME type.
  592. </p>
  593. </dd>
  594. <dt><span><samp>http_version</samp></span></dt>
  595. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  596. </p>
  597. </dd>
  598. <dt><span><samp>icy</samp></span></dt>
  599. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  600. supports this, the metadata has to be retrieved by the application by reading
  601. the <samp>icy_metadata_headers</samp> and <samp>icy_metadata_packet</samp> options.
  602. The default is 1.
  603. </p>
  604. </dd>
  605. <dt><span><samp>icy_metadata_headers</samp></span></dt>
  606. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  607. headers, separated by newline characters.
  608. </p>
  609. </dd>
  610. <dt><span><samp>icy_metadata_packet</samp></span></dt>
  611. <dd><p>If the server supports ICY metadata, and <samp>icy</samp> was set to 1, this
  612. contains the last non-empty metadata packet sent by the server. It should be
  613. polled in regular intervals by applications interested in mid-stream metadata
  614. updates.
  615. </p>
  616. </dd>
  617. <dt><span><samp>cookies</samp></span></dt>
  618. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  619. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  620. delimited by a newline character.
  621. </p>
  622. </dd>
  623. <dt><span><samp>offset</samp></span></dt>
  624. <dd><p>Set initial byte offset.
  625. </p>
  626. </dd>
  627. <dt><span><samp>end_offset</samp></span></dt>
  628. <dd><p>Try to limit the request to bytes preceding this offset.
  629. </p>
  630. </dd>
  631. <dt><span><samp>method</samp></span></dt>
  632. <dd><p>When used as a client option it sets the HTTP method for the request.
  633. </p>
  634. <p>When used as a server option it sets the HTTP method that is going to be
  635. expected from the client(s).
  636. If the expected and the received HTTP method do not match the client will
  637. be given a Bad Request response.
  638. When unset the HTTP method is not checked for now. This will be replaced by
  639. autodetection in the future.
  640. </p>
  641. </dd>
  642. <dt><span><samp>listen</samp></span></dt>
  643. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  644. used as an output option, or read data from a client with HTTP POST when used as
  645. an input option.
  646. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  647. in ffmpeg.c and thus must not be used as a command line option.
  648. </p><div class="example">
  649. <pre class="example"># Server side (sending):
  650. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var>server</var>:<var>port</var>
  651. # Client side (receiving):
  652. ffmpeg -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  653. # Client can also be done with wget:
  654. wget http://<var>server</var>:<var>port</var> -O somefile.ogg
  655. # Server side (receiving):
  656. ffmpeg -listen 1 -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  657. # Client side (sending):
  658. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var>server</var>:<var>port</var>
  659. # Client can also be done with wget:
  660. wget --post-file=somefile.ogg http://<var>server</var>:<var>port</var>
  661. </pre></div>
  662. </dd>
  663. <dt><span><samp>send_expect_100</samp></span></dt>
  664. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  665. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  666. value is -1.
  667. </p>
  668. </dd>
  669. <dt><span><samp>auth_type</samp></span></dt>
  670. <dd>
  671. <p>Set HTTP authentication type. No option for Digest, since this method requires
  672. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  673. Basic.
  674. </p>
  675. <dl compact="compact">
  676. <dt><span><samp>none</samp></span></dt>
  677. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  678. </p></dd>
  679. <dt><span><samp>basic</samp></span></dt>
  680. <dd>
  681. <p>Choose the HTTP basic authentication.
  682. </p>
  683. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  684. for the client. Base64 is not a form of encryption and should be considered the same as
  685. sending the user name and password in clear text (Base64 is a reversible encoding).
  686. If a resource needs to be protected, strongly consider using an authentication scheme
  687. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  688. Without these additional security enhancements, basic authentication should not be used
  689. to protect sensitive or valuable information.
  690. </p></dd>
  691. </dl>
  692. </dd>
  693. </dl>
  694. <a name="HTTP-Cookies"></a>
  695. <h4 class="subsection">3.15.1 HTTP Cookies<span class="pull-right"><a class="anchor hidden-xs" href="#HTTP-Cookies" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HTTP-Cookies" aria-hidden="true">TOC</a></span></h4>
  696. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  697. request. The <samp>cookies</samp> option allows these cookies to be specified. At
  698. the very least, each cookie must specify a value along with a path and domain.
  699. HTTP requests that match both the domain and path will automatically include the
  700. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  701. by a newline.
  702. </p>
  703. <p>The required syntax to play a stream specifying a cookie is:
  704. </p><div class="example">
  705. <pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  706. </pre></div>
  707. <a name="Icecast"></a>
  708. <h3 class="section">3.16 Icecast<span class="pull-right"><a class="anchor hidden-xs" href="#Icecast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Icecast" aria-hidden="true">TOC</a></span></h3>
  709. <p>Icecast protocol (stream to Icecast servers)
  710. </p>
  711. <p>This protocol accepts the following options:
  712. </p>
  713. <dl compact="compact">
  714. <dt><span><samp>ice_genre</samp></span></dt>
  715. <dd><p>Set the stream genre.
  716. </p>
  717. </dd>
  718. <dt><span><samp>ice_name</samp></span></dt>
  719. <dd><p>Set the stream name.
  720. </p>
  721. </dd>
  722. <dt><span><samp>ice_description</samp></span></dt>
  723. <dd><p>Set the stream description.
  724. </p>
  725. </dd>
  726. <dt><span><samp>ice_url</samp></span></dt>
  727. <dd><p>Set the stream website URL.
  728. </p>
  729. </dd>
  730. <dt><span><samp>ice_public</samp></span></dt>
  731. <dd><p>Set if the stream should be public.
  732. The default is 0 (not public).
  733. </p>
  734. </dd>
  735. <dt><span><samp>user_agent</samp></span></dt>
  736. <dd><p>Override the User-Agent header. If not specified a string of the form
  737. &quot;Lavf/&lt;version&gt;&quot; will be used.
  738. </p>
  739. </dd>
  740. <dt><span><samp>password</samp></span></dt>
  741. <dd><p>Set the Icecast mountpoint password.
  742. </p>
  743. </dd>
  744. <dt><span><samp>content_type</samp></span></dt>
  745. <dd><p>Set the stream content type. This must be set if it is different from
  746. audio/mpeg.
  747. </p>
  748. </dd>
  749. <dt><span><samp>legacy_icecast</samp></span></dt>
  750. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  751. HTTP PUT method but the SOURCE method.
  752. </p>
  753. </dd>
  754. <dt><span><samp>tls</samp></span></dt>
  755. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  756. </p>
  757. </dd>
  758. </dl>
  759. <div class="example">
  760. <pre class="example">icecast://[<var>username</var>[:<var>password</var>]@]<var>server</var>:<var>port</var>/<var>mountpoint</var>
  761. </pre></div>
  762. <a name="ipfs"></a>
  763. <h3 class="section">3.17 ipfs<span class="pull-right"><a class="anchor hidden-xs" href="#ipfs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ipfs" aria-hidden="true">TOC</a></span></h3>
  764. <p>InterPlanetary File System (IPFS) protocol support. One can access files stored
  765. on the IPFS network through so-called gateways. These are http(s) endpoints.
  766. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
  767. to such a gateway. Users can (and should) host their own node which means this
  768. protocol will use one&rsquo;s local gateway to access files on the IPFS network.
  769. </p>
  770. <p>This protocol accepts the following options:
  771. </p>
  772. <dl compact="compact">
  773. <dt><span><samp>gateway</samp></span></dt>
  774. <dd><p>Defines the gateway to use. When not set, the protocol will first try
  775. locating the local gateway by looking at <code>$IPFS_GATEWAY</code>, <code>$IPFS_PATH</code>
  776. and <code>$HOME/.ipfs/</code>, in that order.
  777. </p>
  778. </dd>
  779. </dl>
  780. <p>One can use this protocol in 2 ways. Using IPFS:
  781. </p><div class="example">
  782. <pre class="example">ffplay ipfs://&lt;hash&gt;
  783. </pre></div>
  784. <p>Or the IPNS protocol (IPNS is mutable IPFS):
  785. </p><div class="example">
  786. <pre class="example">ffplay ipns://&lt;hash&gt;
  787. </pre></div>
  788. <a name="mmst"></a>
  789. <h3 class="section">3.18 mmst<span class="pull-right"><a class="anchor hidden-xs" href="#mmst" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmst" aria-hidden="true">TOC</a></span></h3>
  790. <p>MMS (Microsoft Media Server) protocol over TCP.
  791. </p>
  792. <a name="mmsh"></a>
  793. <h3 class="section">3.19 mmsh<span class="pull-right"><a class="anchor hidden-xs" href="#mmsh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmsh" aria-hidden="true">TOC</a></span></h3>
  794. <p>MMS (Microsoft Media Server) protocol over HTTP.
  795. </p>
  796. <p>The required syntax is:
  797. </p><div class="example">
  798. <pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
  799. </pre></div>
  800. <a name="md5"></a>
  801. <h3 class="section">3.20 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5" aria-hidden="true">TOC</a></span></h3>
  802. <p>MD5 output protocol.
  803. </p>
  804. <p>Computes the MD5 hash of the data to be written, and on close writes
  805. this to the designated output or stdout if none is specified. It can
  806. be used to test muxers without writing an actual file.
  807. </p>
  808. <p>Some examples follow.
  809. </p><div class="example">
  810. <pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  811. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  812. # Write the MD5 hash of the encoded AVI file to stdout.
  813. ffmpeg -i input.flv -f avi -y md5:
  814. </pre></div>
  815. <p>Note that some formats (typically MOV) require the output protocol to
  816. be seekable, so they will fail with the MD5 output protocol.
  817. </p>
  818. <a name="pipe"></a>
  819. <h3 class="section">3.21 pipe<span class="pull-right"><a class="anchor hidden-xs" href="#pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pipe" aria-hidden="true">TOC</a></span></h3>
  820. <p>UNIX pipe access protocol.
  821. </p>
  822. <p>Read and write from UNIX pipes.
  823. </p>
  824. <p>The accepted syntax is:
  825. </p><div class="example">
  826. <pre class="example">pipe:[<var>number</var>]
  827. </pre></div>
  828. <p>If <samp>fd</samp> isn&rsquo;t specified, <var>number</var> is the number corresponding to the file descriptor of the
  829. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
  830. is not specified, by default the stdout file descriptor will be used
  831. for writing, stdin for reading.
  832. </p>
  833. <p>For example to read from stdin with <code>ffmpeg</code>:
  834. </p><div class="example">
  835. <pre class="example">cat test.wav | ffmpeg -i pipe:0
  836. # ...this is the same as...
  837. cat test.wav | ffmpeg -i pipe:
  838. </pre></div>
  839. <p>For writing to stdout with <code>ffmpeg</code>:
  840. </p><div class="example">
  841. <pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  842. # ...this is the same as...
  843. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  844. </pre></div>
  845. <p>This protocol accepts the following options:
  846. </p>
  847. <dl compact="compact">
  848. <dt><span><samp>blocksize</samp></span></dt>
  849. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  850. <code>INT_MAX</code>, which results in not limiting the requested block size.
  851. Setting this value reasonably low improves user termination request reaction
  852. time, which is valuable if data transmission is slow.
  853. </p></dd>
  854. <dt><span><samp>fd</samp></span></dt>
  855. <dd><p>Set file descriptor.
  856. </p></dd>
  857. </dl>
  858. <p>Note that some formats (typically MOV), require the output protocol to
  859. be seekable, so they will fail with the pipe output protocol.
  860. </p>
  861. <a name="prompeg"></a>
  862. <h3 class="section">3.22 prompeg<span class="pull-right"><a class="anchor hidden-xs" href="#prompeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prompeg" aria-hidden="true">TOC</a></span></h3>
  863. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  864. </p>
  865. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  866. for MPEG-2 Transport Streams sent over RTP.
  867. </p>
  868. <p>This protocol must be used in conjunction with the <code>rtp_mpegts</code> muxer and
  869. the <code>rtp</code> protocol.
  870. </p>
  871. <p>The required syntax is:
  872. </p><div class="example">
  873. <pre class="example">-f rtp_mpegts -fec prompeg=<var>option</var>=<var>val</var>... rtp://<var>hostname</var>:<var>port</var>
  874. </pre></div>
  875. <p>The destination UDP ports are <code>port + 2</code> for the column FEC stream
  876. and <code>port + 4</code> for the row FEC stream.
  877. </p>
  878. <p>This protocol accepts the following options:
  879. </p><dl compact="compact">
  880. <dt><span><samp>l=<var>n</var></samp></span></dt>
  881. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  882. </p>
  883. </dd>
  884. <dt><span><samp>d=<var>n</var></samp></span></dt>
  885. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  886. </p>
  887. </dd>
  888. </dl>
  889. <p>Example usage:
  890. </p>
  891. <div class="example">
  892. <pre class="example">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var>hostname</var>:<var>port</var>
  893. </pre></div>
  894. <a name="rist"></a>
  895. <h3 class="section">3.23 rist<span class="pull-right"><a class="anchor hidden-xs" href="#rist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rist" aria-hidden="true">TOC</a></span></h3>
  896. <p>Reliable Internet Streaming Transport protocol
  897. </p>
  898. <p>The accepted options are:
  899. </p><dl compact="compact">
  900. <dt><span><samp>rist_profile</samp></span></dt>
  901. <dd><p>Supported values:
  902. </p><dl compact="compact">
  903. <dt><span>&lsquo;<samp>simple</samp>&rsquo;</span></dt>
  904. <dt><span>&lsquo;<samp>main</samp>&rsquo;</span></dt>
  905. <dd><p>This one is default.
  906. </p></dd>
  907. <dt><span>&lsquo;<samp>advanced</samp>&rsquo;</span></dt>
  908. </dl>
  909. </dd>
  910. <dt><span><samp>buffer_size</samp></span></dt>
  911. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  912. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  913. seconds.
  914. </p>
  915. </dd>
  916. <dt><span><samp>fifo_size</samp></span></dt>
  917. <dd><p>Size of the librist receiver output fifo in number of packets. This must be a
  918. power of 2.
  919. Defaults to 8192 (vs the librist default of 1024).
  920. </p>
  921. </dd>
  922. <dt><span><samp>overrun_nonfatal=<var>1|0</var></samp></span></dt>
  923. <dd><p>Survive in case of librist fifo buffer overrun. Default value is 0.
  924. </p>
  925. </dd>
  926. <dt><span><samp>pkt_size</samp></span></dt>
  927. <dd><p>Set maximum packet size for sending data. 1316 by default.
  928. </p>
  929. </dd>
  930. <dt><span><samp>log_level</samp></span></dt>
  931. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  932. explicitly want to enable debug level messages or packet loss simulation,
  933. otherwise the regular loglevel is respected.
  934. </p>
  935. </dd>
  936. <dt><span><samp>secret</samp></span></dt>
  937. <dd><p>Set override of encryption secret, by default is unset.
  938. </p>
  939. </dd>
  940. <dt><span><samp>encryption</samp></span></dt>
  941. <dd><p>Set encryption type, by default is disabled.
  942. Acceptable values are 128 and 256.
  943. </p></dd>
  944. </dl>
  945. <a name="rtmp"></a>
  946. <h3 class="section">3.24 rtmp<span class="pull-right"><a class="anchor hidden-xs" href="#rtmp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmp" aria-hidden="true">TOC</a></span></h3>
  947. <p>Real-Time Messaging Protocol.
  948. </p>
  949. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  950. content across a TCP/IP network.
  951. </p>
  952. <p>The required syntax is:
  953. </p><div class="example">
  954. <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>]
  955. </pre></div>
  956. <p>The accepted parameters are:
  957. </p><dl compact="compact">
  958. <dt><span><samp>username</samp></span></dt>
  959. <dd><p>An optional username (mostly for publishing).
  960. </p>
  961. </dd>
  962. <dt><span><samp>password</samp></span></dt>
  963. <dd><p>An optional password (mostly for publishing).
  964. </p>
  965. </dd>
  966. <dt><span><samp>server</samp></span></dt>
  967. <dd><p>The address of the RTMP server.
  968. </p>
  969. </dd>
  970. <dt><span><samp>port</samp></span></dt>
  971. <dd><p>The number of the TCP port to use (by default is 1935).
  972. </p>
  973. </dd>
  974. <dt><span><samp>app</samp></span></dt>
  975. <dd><p>It is the name of the application to access. It usually corresponds to
  976. the path where the application is installed on the RTMP server
  977. (e.g. <samp>/ondemand/</samp>, <samp>/flash/live/</samp>, etc.). You can override
  978. the value parsed from the URI through the <code>rtmp_app</code> option, too.
  979. </p>
  980. </dd>
  981. <dt><span><samp>playpath</samp></span></dt>
  982. <dd><p>It is the path or name of the resource to play with reference to the
  983. application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
  984. can override the value parsed from the URI through the <code>rtmp_playpath</code>
  985. option, too.
  986. </p>
  987. </dd>
  988. <dt><span><samp>listen</samp></span></dt>
  989. <dd><p>Act as a server, listening for an incoming connection.
  990. </p>
  991. </dd>
  992. <dt><span><samp>timeout</samp></span></dt>
  993. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  994. </p></dd>
  995. </dl>
  996. <p>Additionally, the following parameters can be set via command line options
  997. (or in code via <code>AVOption</code>s):
  998. </p><dl compact="compact">
  999. <dt><span><samp>rtmp_app</samp></span></dt>
  1000. <dd><p>Name of application to connect on the RTMP server. This option
  1001. overrides the parameter specified in the URI.
  1002. </p>
  1003. </dd>
  1004. <dt><span><samp>rtmp_buffer</samp></span></dt>
  1005. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  1006. </p>
  1007. </dd>
  1008. <dt><span><samp>rtmp_conn</samp></span></dt>
  1009. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  1010. e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  1011. Each value is prefixed by a single character denoting the type,
  1012. B for Boolean, N for number, S for string, O for object, or Z for null,
  1013. followed by a colon. For Booleans the data must be either 0 or 1 for
  1014. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  1015. 1 to end or begin an object, respectively. Data items in subobjects may
  1016. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  1017. the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
  1018. times to construct arbitrary AMF sequences.
  1019. </p>
  1020. </dd>
  1021. <dt><span><samp>rtmp_flashver</samp></span></dt>
  1022. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  1023. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  1024. &lt;libavformat version&gt;).)
  1025. </p>
  1026. </dd>
  1027. <dt><span><samp>rtmp_flush_interval</samp></span></dt>
  1028. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  1029. is 10.
  1030. </p>
  1031. </dd>
  1032. <dt><span><samp>rtmp_live</samp></span></dt>
  1033. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  1034. live streams is possible. The default value is <code>any</code>, which means the
  1035. subscriber first tries to play the live stream specified in the
  1036. playpath. If a live stream of that name is not found, it plays the
  1037. recorded stream. The other possible values are <code>live</code> and
  1038. <code>recorded</code>.
  1039. </p>
  1040. </dd>
  1041. <dt><span><samp>rtmp_pageurl</samp></span></dt>
  1042. <dd><p>URL of the web page in which the media was embedded. By default no
  1043. value will be sent.
  1044. </p>
  1045. </dd>
  1046. <dt><span><samp>rtmp_playpath</samp></span></dt>
  1047. <dd><p>Stream identifier to play or to publish. This option overrides the
  1048. parameter specified in the URI.
  1049. </p>
  1050. </dd>
  1051. <dt><span><samp>rtmp_subscribe</samp></span></dt>
  1052. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  1053. It is only sent if the option is specified or if rtmp_live
  1054. is set to live.
  1055. </p>
  1056. </dd>
  1057. <dt><span><samp>rtmp_swfhash</samp></span></dt>
  1058. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  1059. </p>
  1060. </dd>
  1061. <dt><span><samp>rtmp_swfsize</samp></span></dt>
  1062. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  1063. </p>
  1064. </dd>
  1065. <dt><span><samp>rtmp_swfurl</samp></span></dt>
  1066. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  1067. </p>
  1068. </dd>
  1069. <dt><span><samp>rtmp_swfverify</samp></span></dt>
  1070. <dd><p>URL to player swf file, compute hash/size automatically.
  1071. </p>
  1072. </dd>
  1073. <dt><span><samp>rtmp_tcurl</samp></span></dt>
  1074. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  1075. </p>
  1076. </dd>
  1077. <dt><span><samp>tcp_nodelay=<var>1|0</var></samp></span></dt>
  1078. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  1079. </p>
  1080. <p><em>Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.</em>
  1081. </p>
  1082. </dd>
  1083. </dl>
  1084. <p>For example to read with <code>ffplay</code> a multimedia resource named
  1085. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  1086. </p><div class="example">
  1087. <pre class="example">ffplay rtmp://myserver/vod/sample
  1088. </pre></div>
  1089. <p>To publish to a password protected server, passing the playpath and
  1090. app names separately:
  1091. </p><div class="example">
  1092. <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/
  1093. </pre></div>
  1094. <a name="rtmpe"></a>
  1095. <h3 class="section">3.25 rtmpe<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpe" aria-hidden="true">TOC</a></span></h3>
  1096. <p>Encrypted Real-Time Messaging Protocol.
  1097. </p>
  1098. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  1099. streaming multimedia content within standard cryptographic primitives,
  1100. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  1101. a pair of RC4 keys.
  1102. </p>
  1103. <a name="rtmps"></a>
  1104. <h3 class="section">3.26 rtmps<span class="pull-right"><a class="anchor hidden-xs" href="#rtmps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmps" aria-hidden="true">TOC</a></span></h3>
  1105. <p>Real-Time Messaging Protocol over a secure SSL connection.
  1106. </p>
  1107. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  1108. multimedia content across an encrypted connection.
  1109. </p>
  1110. <a name="rtmpt"></a>
  1111. <h3 class="section">3.27 rtmpt<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpt" aria-hidden="true">TOC</a></span></h3>
  1112. <p>Real-Time Messaging Protocol tunneled through HTTP.
  1113. </p>
  1114. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  1115. for streaming multimedia content within HTTP requests to traverse
  1116. firewalls.
  1117. </p>
  1118. <a name="rtmpte"></a>
  1119. <h3 class="section">3.28 rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpte" aria-hidden="true">TOC</a></span></h3>
  1120. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  1121. </p>
  1122. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  1123. is used for streaming multimedia content within HTTP requests to traverse
  1124. firewalls.
  1125. </p>
  1126. <a name="rtmpts"></a>
  1127. <h3 class="section">3.29 rtmpts<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpts" aria-hidden="true">TOC</a></span></h3>
  1128. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  1129. </p>
  1130. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  1131. for streaming multimedia content within HTTPS requests to traverse
  1132. firewalls.
  1133. </p>
  1134. <a name="libsmbclient"></a>
  1135. <h3 class="section">3.30 libsmbclient<span class="pull-right"><a class="anchor hidden-xs" href="#libsmbclient" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsmbclient" aria-hidden="true">TOC</a></span></h3>
  1136. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  1137. </p>
  1138. <p>Following syntax is required.
  1139. </p>
  1140. <div class="example">
  1141. <pre class="example">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  1142. </pre></div>
  1143. <p>This protocol accepts the following options.
  1144. </p>
  1145. <dl compact="compact">
  1146. <dt><span><samp>timeout</samp></span></dt>
  1147. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  1148. low level operation. By default it is set to -1, which means that the timeout
  1149. is not specified.
  1150. </p>
  1151. </dd>
  1152. <dt><span><samp>truncate</samp></span></dt>
  1153. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  1154. truncating. Default value is 1.
  1155. </p>
  1156. </dd>
  1157. <dt><span><samp>workgroup</samp></span></dt>
  1158. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  1159. </p>
  1160. </dd>
  1161. </dl>
  1162. <p>For more information see: <a href="http://www.samba.org/">http://www.samba.org/</a>.
  1163. </p>
  1164. <a name="libssh"></a>
  1165. <h3 class="section">3.31 libssh<span class="pull-right"><a class="anchor hidden-xs" href="#libssh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libssh" aria-hidden="true">TOC</a></span></h3>
  1166. <p>Secure File Transfer Protocol via libssh
  1167. </p>
  1168. <p>Read from or write to remote resources using SFTP protocol.
  1169. </p>
  1170. <p>Following syntax is required.
  1171. </p>
  1172. <div class="example">
  1173. <pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  1174. </pre></div>
  1175. <p>This protocol accepts the following options.
  1176. </p>
  1177. <dl compact="compact">
  1178. <dt><span><samp>timeout</samp></span></dt>
  1179. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  1180. operation. By default it is set to -1, which means that the timeout
  1181. is not specified.
  1182. </p>
  1183. </dd>
  1184. <dt><span><samp>truncate</samp></span></dt>
  1185. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  1186. truncating. Default value is 1.
  1187. </p>
  1188. </dd>
  1189. <dt><span><samp>private_key</samp></span></dt>
  1190. <dd><p>Specify the path of the file containing private key to use during authorization.
  1191. By default libssh searches for keys in the <samp>~/.ssh/</samp> directory.
  1192. </p>
  1193. </dd>
  1194. </dl>
  1195. <p>Example: Play a file stored on remote server.
  1196. </p>
  1197. <div class="example">
  1198. <pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  1199. </pre></div>
  1200. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  1201. <h3 class="section">3.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">TOC</a></span></h3>
  1202. <p>Real-Time Messaging Protocol and its variants supported through
  1203. librtmp.
  1204. </p>
  1205. <p>Requires the presence of the librtmp headers and library during
  1206. configuration. You need to explicitly configure the build with
  1207. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  1208. protocol.
  1209. </p>
  1210. <p>This protocol provides most client functions and a few server
  1211. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  1212. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  1213. variants of these encrypted types (RTMPTE, RTMPTS).
  1214. </p>
  1215. <p>The required syntax is:
  1216. </p><div class="example">
  1217. <pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
  1218. </pre></div>
  1219. <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  1220. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  1221. <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
  1222. meaning as specified for the RTMP native protocol.
  1223. <var>options</var> contains a list of space-separated options of the form
  1224. <var>key</var>=<var>val</var>.
  1225. </p>
  1226. <p>See the librtmp manual page (man 3 librtmp) for more information.
  1227. </p>
  1228. <p>For example, to stream a file in real-time to an RTMP server using
  1229. <code>ffmpeg</code>:
  1230. </p><div class="example">
  1231. <pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  1232. </pre></div>
  1233. <p>To play the same stream using <code>ffplay</code>:
  1234. </p><div class="example">
  1235. <pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  1236. </pre></div>
  1237. <a name="rtp"></a>
  1238. <h3 class="section">3.33 rtp<span class="pull-right"><a class="anchor hidden-xs" href="#rtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtp" aria-hidden="true">TOC</a></span></h3>
  1239. <p>Real-time Transport Protocol.
  1240. </p>
  1241. <p>The required syntax for an RTP URL is:
  1242. rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
  1243. </p>
  1244. <p><var>port</var> specifies the RTP port to use.
  1245. </p>
  1246. <p>The following URL options are supported:
  1247. </p>
  1248. <dl compact="compact">
  1249. <dt><span><samp>ttl=<var>n</var></samp></span></dt>
  1250. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  1251. </p>
  1252. </dd>
  1253. <dt><span><samp>rtcpport=<var>n</var></samp></span></dt>
  1254. <dd><p>Set the remote RTCP port to <var>n</var>.
  1255. </p>
  1256. </dd>
  1257. <dt><span><samp>localrtpport=<var>n</var></samp></span></dt>
  1258. <dd><p>Set the local RTP port to <var>n</var>.
  1259. </p>
  1260. </dd>
  1261. <dt><span><samp>localrtcpport=<var>n</var>'</samp></span></dt>
  1262. <dd><p>Set the local RTCP port to <var>n</var>.
  1263. </p>
  1264. </dd>
  1265. <dt><span><samp>pkt_size=<var>n</var></samp></span></dt>
  1266. <dd><p>Set max packet size (in bytes) to <var>n</var>.
  1267. </p>
  1268. </dd>
  1269. <dt><span><samp>buffer_size=<var>size</var></samp></span></dt>
  1270. <dd><p>Set the maximum UDP socket buffer size in bytes.
  1271. </p>
  1272. </dd>
  1273. <dt><span><samp>connect=0|1</samp></span></dt>
  1274. <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
  1275. to 0).
  1276. </p>
  1277. </dd>
  1278. <dt><span><samp>sources=<var>ip</var>[,<var>ip</var>]</samp></span></dt>
  1279. <dd><p>List allowed source IP addresses.
  1280. </p>
  1281. </dd>
  1282. <dt><span><samp>block=<var>ip</var>[,<var>ip</var>]</samp></span></dt>
  1283. <dd><p>List disallowed (blocked) source IP addresses.
  1284. </p>
  1285. </dd>
  1286. <dt><span><samp>write_to_source=0|1</samp></span></dt>
  1287. <dd><p>Send packets to the source address of the latest received packet (if
  1288. set to 1) or to a default remote address (if set to 0).
  1289. </p>
  1290. </dd>
  1291. <dt><span><samp>localport=<var>n</var></samp></span></dt>
  1292. <dd><p>Set the local RTP port to <var>n</var>.
  1293. </p>
  1294. </dd>
  1295. <dt><span><samp>localaddr=<var>addr</var></samp></span></dt>
  1296. <dd><p>Local IP address of a network interface used for sending packets or joining
  1297. multicast groups.
  1298. </p>
  1299. </dd>
  1300. <dt><span><samp>timeout=<var>n</var></samp></span></dt>
  1301. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var>n</var>.
  1302. </p>
  1303. <p>This is a deprecated option. Instead, <samp>localrtpport</samp> should be
  1304. used.
  1305. </p>
  1306. </dd>
  1307. </dl>
  1308. <p>Important notes:
  1309. </p>
  1310. <ol>
  1311. <li> If <samp>rtcpport</samp> is not set the RTCP port will be set to the RTP
  1312. port value plus 1.
  1313. </li><li> If <samp>localrtpport</samp> (the local RTP port) is not set any available
  1314. port will be used for the local RTP and RTCP ports.
  1315. </li><li> If <samp>localrtcpport</samp> (the local RTCP port) is not set it will be
  1316. set to the local RTP port value plus 1.
  1317. </li></ol>
  1318. <a name="rtsp"></a>
  1319. <h3 class="section">3.34 rtsp<span class="pull-right"><a class="anchor hidden-xs" href="#rtsp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtsp" aria-hidden="true">TOC</a></span></h3>
  1320. <p>Real-Time Streaming Protocol.
  1321. </p>
  1322. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  1323. and muxer. The demuxer supports both normal RTSP (with data transferred
  1324. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  1325. data transferred over RDT).
  1326. </p>
  1327. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  1328. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  1329. <a href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  1330. </p>
  1331. <p>The required syntax for a RTSP url is:
  1332. </p><div class="example">
  1333. <pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
  1334. </pre></div>
  1335. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  1336. line, or set in code via <code>AVOption</code>s or in
  1337. <code>avformat_open_input</code>.
  1338. </p>
  1339. <a name="Muxer"></a>
  1340. <h4 class="subsection">3.34.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer" aria-hidden="true">TOC</a></span></h4>
  1341. <p>The following options are supported.
  1342. </p>
  1343. <dl compact="compact">
  1344. <dt><span><samp>rtsp_transport</samp></span></dt>
  1345. <dd><p>Set RTSP transport protocols.
  1346. </p>
  1347. <p>It accepts the following values:
  1348. </p><dl compact="compact">
  1349. <dt><span>&lsquo;<samp>udp</samp>&rsquo;</span></dt>
  1350. <dd><p>Use UDP as lower transport protocol.
  1351. </p>
  1352. </dd>
  1353. <dt><span>&lsquo;<samp>tcp</samp>&rsquo;</span></dt>
  1354. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  1355. transport protocol.
  1356. </p></dd>
  1357. </dl>
  1358. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  1359. </p>
  1360. </dd>
  1361. <dt><span><samp>rtsp_flags</samp></span></dt>
  1362. <dd><p>Set RTSP flags.
  1363. </p>
  1364. <p>The following values are accepted:
  1365. </p><dl compact="compact">
  1366. <dt><span>&lsquo;<samp>latm</samp>&rsquo;</span></dt>
  1367. <dd><p>Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
  1368. </p></dd>
  1369. <dt><span>&lsquo;<samp>rfc2190</samp>&rsquo;</span></dt>
  1370. <dd><p>Use RFC 2190 packetization instead of RFC 4629 for H.263.
  1371. </p></dd>
  1372. <dt><span>&lsquo;<samp>skip_rtcp</samp>&rsquo;</span></dt>
  1373. <dd><p>Don&rsquo;t send RTCP sender reports.
  1374. </p></dd>
  1375. <dt><span>&lsquo;<samp>h264_mode0</samp>&rsquo;</span></dt>
  1376. <dd><p>Use mode 0 for H.264 in RTP.
  1377. </p></dd>
  1378. <dt><span>&lsquo;<samp>send_bye</samp>&rsquo;</span></dt>
  1379. <dd><p>Send RTCP BYE packets when finishing.
  1380. </p></dd>
  1381. </dl>
  1382. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  1383. </p>
  1384. </dd>
  1385. <dt><span><samp>min_port</samp></span></dt>
  1386. <dd><p>Set minimum local UDP port. Default value is 5000.
  1387. </p>
  1388. </dd>
  1389. <dt><span><samp>max_port</samp></span></dt>
  1390. <dd><p>Set maximum local UDP port. Default value is 65000.
  1391. </p>
  1392. </dd>
  1393. <dt><span><samp>buffer_size</samp></span></dt>
  1394. <dd><p>Set the maximum socket buffer size in bytes.
  1395. </p>
  1396. </dd>
  1397. <dt><span><samp>pkt_size</samp></span></dt>
  1398. <dd><p>Set max send packet size (in bytes). Default value is 1472.
  1399. </p></dd>
  1400. </dl>
  1401. <a name="Demuxer"></a>
  1402. <h4 class="subsection">3.34.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer" aria-hidden="true">TOC</a></span></h4>
  1403. <p>The following options are supported.
  1404. </p>
  1405. <dl compact="compact">
  1406. <dt><span><samp>initial_pause</samp></span></dt>
  1407. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  1408. is 0.
  1409. </p>
  1410. </dd>
  1411. <dt><span><samp>rtsp_transport</samp></span></dt>
  1412. <dd><p>Set RTSP transport protocols.
  1413. </p>
  1414. <p>It accepts the following values:
  1415. </p><dl compact="compact">
  1416. <dt><span>&lsquo;<samp>udp</samp>&rsquo;</span></dt>
  1417. <dd><p>Use UDP as lower transport protocol.
  1418. </p>
  1419. </dd>
  1420. <dt><span>&lsquo;<samp>tcp</samp>&rsquo;</span></dt>
  1421. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  1422. transport protocol.
  1423. </p>
  1424. </dd>
  1425. <dt><span>&lsquo;<samp>udp_multicast</samp>&rsquo;</span></dt>
  1426. <dd><p>Use UDP multicast as lower transport protocol.
  1427. </p>
  1428. </dd>
  1429. <dt><span>&lsquo;<samp>http</samp>&rsquo;</span></dt>
  1430. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  1431. passing proxies.
  1432. </p>
  1433. </dd>
  1434. <dt><span>&lsquo;<samp>https</samp>&rsquo;</span></dt>
  1435. <dd><p>Use HTTPs tunneling as lower transport protocol, which is useful for
  1436. passing proxies and widely used for security consideration.
  1437. </p></dd>
  1438. </dl>
  1439. <p>Multiple lower transport protocols may be specified, in that case they are
  1440. tried one at a time (if the setup of one fails, the next one is tried).
  1441. For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
  1442. </p>
  1443. </dd>
  1444. <dt><span><samp>rtsp_flags</samp></span></dt>
  1445. <dd><p>Set RTSP flags.
  1446. </p>
  1447. <p>The following values are accepted:
  1448. </p><dl compact="compact">
  1449. <dt><span>&lsquo;<samp>filter_src</samp>&rsquo;</span></dt>
  1450. <dd><p>Accept packets only from negotiated peer address and port.
  1451. </p></dd>
  1452. <dt><span>&lsquo;<samp>listen</samp>&rsquo;</span></dt>
  1453. <dd><p>Act as a server, listening for an incoming connection.
  1454. </p></dd>
  1455. <dt><span>&lsquo;<samp>prefer_tcp</samp>&rsquo;</span></dt>
  1456. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  1457. </p></dd>
  1458. <dt><span>&lsquo;<samp>satip_raw</samp>&rsquo;</span></dt>
  1459. <dd><p>Export raw MPEG-TS stream instead of demuxing. The flag will simply write out
  1460. the raw stream, with the original PAT/PMT/PIDs intact.
  1461. </p></dd>
  1462. </dl>
  1463. <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
  1464. </p>
  1465. </dd>
  1466. <dt><span><samp>allowed_media_types</samp></span></dt>
  1467. <dd><p>Set media types to accept from the server.
  1468. </p>
  1469. <p>The following flags are accepted:
  1470. </p><dl compact="compact">
  1471. <dt><span>&lsquo;<samp>video</samp>&rsquo;</span></dt>
  1472. <dt><span>&lsquo;<samp>audio</samp>&rsquo;</span></dt>
  1473. <dt><span>&lsquo;<samp>data</samp>&rsquo;</span></dt>
  1474. <dt><span>&lsquo;<samp>subtitle</samp>&rsquo;</span></dt>
  1475. </dl>
  1476. <p>By default it accepts all media types.
  1477. </p>
  1478. </dd>
  1479. <dt><span><samp>min_port</samp></span></dt>
  1480. <dd><p>Set minimum local UDP port. Default value is 5000.
  1481. </p>
  1482. </dd>
  1483. <dt><span><samp>max_port</samp></span></dt>
  1484. <dd><p>Set maximum local UDP port. Default value is 65000.
  1485. </p>
  1486. </dd>
  1487. <dt><span><samp>listen_timeout</samp></span></dt>
  1488. <dd><p>Set maximum timeout (in seconds) to establish an initial connection. Setting
  1489. <samp>listen_timeout</samp> &gt; 0 sets <samp>rtsp_flags</samp> to &lsquo;<samp>listen</samp>&rsquo;. Default is -1
  1490. which means an infinite timeout when &lsquo;<samp>listen</samp>&rsquo; mode is set.
  1491. </p>
  1492. </dd>
  1493. <dt><span><samp>reorder_queue_size</samp></span></dt>
  1494. <dd><p>Set number of packets to buffer for handling of reordered packets.
  1495. </p>
  1496. </dd>
  1497. <dt><span><samp>timeout</samp></span></dt>
  1498. <dd><p>Set socket TCP I/O timeout in microseconds.
  1499. </p>
  1500. </dd>
  1501. <dt><span><samp>user_agent</samp></span></dt>
  1502. <dd><p>Override User-Agent header. If not specified, it defaults to the
  1503. libavformat identifier string.
  1504. </p>
  1505. </dd>
  1506. <dt><span><samp>buffer_size</samp></span></dt>
  1507. <dd><p>Set the maximum socket buffer size in bytes.
  1508. </p></dd>
  1509. </dl>
  1510. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  1511. (since they may arrive out of order, or packets may get lost totally). This
  1512. can be disabled by setting the maximum demuxing delay to zero (via
  1513. the <code>max_delay</code> field of AVFormatContext).
  1514. </p>
  1515. <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
  1516. streams to display can be chosen with <code>-vst</code> <var>n</var> and
  1517. <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
  1518. on the fly by pressing <code>v</code> and <code>a</code>.
  1519. </p>
  1520. <a name="Examples"></a>
  1521. <h4 class="subsection">3.34.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
  1522. <p>The following examples all make use of the <code>ffplay</code> and
  1523. <code>ffmpeg</code> tools.
  1524. </p>
  1525. <ul>
  1526. <li> Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  1527. <div class="example">
  1528. <pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  1529. </pre></div>
  1530. </li><li> Watch a stream tunneled over HTTP:
  1531. <div class="example">
  1532. <pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
  1533. </pre></div>
  1534. </li><li> Send a stream in realtime to a RTSP server, for others to watch:
  1535. <div class="example">
  1536. <pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  1537. </pre></div>
  1538. </li><li> Receive a stream in realtime:
  1539. <div class="example">
  1540. <pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
  1541. </pre></div>
  1542. </li></ul>
  1543. <a name="sap"></a>
  1544. <h3 class="section">3.35 sap<span class="pull-right"><a class="anchor hidden-xs" href="#sap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sap" aria-hidden="true">TOC</a></span></h3>
  1545. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  1546. protocol handler in libavformat, it is a muxer and demuxer.
  1547. It is used for signalling of RTP streams, by announcing the SDP for the
  1548. streams regularly on a separate port.
  1549. </p>
  1550. <a name="Muxer-1"></a>
  1551. <h4 class="subsection">3.35.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer-1" aria-hidden="true">TOC</a></span></h4>
  1552. <p>The syntax for a SAP url given to the muxer is:
  1553. </p><div class="example">
  1554. <pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
  1555. </pre></div>
  1556. <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
  1557. or to port 5004 if no port is specified.
  1558. <var>options</var> is a <code>&amp;</code>-separated list. The following options
  1559. are supported:
  1560. </p>
  1561. <dl compact="compact">
  1562. <dt><span><samp>announce_addr=<var>address</var></samp></span></dt>
  1563. <dd><p>Specify the destination IP address for sending the announcements to.
  1564. If omitted, the announcements are sent to the commonly used SAP
  1565. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  1566. ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
  1567. </p>
  1568. </dd>
  1569. <dt><span><samp>announce_port=<var>port</var></samp></span></dt>
  1570. <dd><p>Specify the port to send the announcements on, defaults to
  1571. 9875 if not specified.
  1572. </p>
  1573. </dd>
  1574. <dt><span><samp>ttl=<var>ttl</var></samp></span></dt>
  1575. <dd><p>Specify the time to live value for the announcements and RTP packets,
  1576. defaults to 255.
  1577. </p>
  1578. </dd>
  1579. <dt><span><samp>same_port=<var>0|1</var></samp></span></dt>
  1580. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  1581. default), all streams are sent on unique ports, with each stream on a
  1582. port 2 numbers higher than the previous.
  1583. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  1584. The RTP stack in libavformat for receiving requires all streams to be sent
  1585. on unique ports.
  1586. </p></dd>
  1587. </dl>
  1588. <p>Example command lines follow.
  1589. </p>
  1590. <p>To broadcast a stream on the local subnet, for watching in VLC:
  1591. </p>
  1592. <div class="example">
  1593. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
  1594. </pre></div>
  1595. <p>Similarly, for watching in <code>ffplay</code>:
  1596. </p>
  1597. <div class="example">
  1598. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
  1599. </pre></div>
  1600. <p>And for watching in <code>ffplay</code>, over IPv6:
  1601. </p>
  1602. <div class="example">
  1603. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
  1604. </pre></div>
  1605. <a name="Demuxer-1"></a>
  1606. <h4 class="subsection">3.35.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer-1" aria-hidden="true">TOC</a></span></h4>
  1607. <p>The syntax for a SAP url given to the demuxer is:
  1608. </p><div class="example">
  1609. <pre class="example">sap://[<var>address</var>][:<var>port</var>]
  1610. </pre></div>
  1611. <p><var>address</var> is the multicast address to listen for announcements on,
  1612. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
  1613. is the port that is listened on, 9875 if omitted.
  1614. </p>
  1615. <p>The demuxers listens for announcements on the given address and port.
  1616. Once an announcement is received, it tries to receive that particular stream.
  1617. </p>
  1618. <p>Example command lines follow.
  1619. </p>
  1620. <p>To play back the first stream announced on the normal SAP multicast address:
  1621. </p>
  1622. <div class="example">
  1623. <pre class="example">ffplay sap://
  1624. </pre></div>
  1625. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  1626. </p>
  1627. <div class="example">
  1628. <pre class="example">ffplay sap://[ff0e::2:7ffe]
  1629. </pre></div>
  1630. <a name="sctp"></a>
  1631. <h3 class="section">3.36 sctp<span class="pull-right"><a class="anchor hidden-xs" href="#sctp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sctp" aria-hidden="true">TOC</a></span></h3>
  1632. <p>Stream Control Transmission Protocol.
  1633. </p>
  1634. <p>The accepted URL syntax is:
  1635. </p><div class="example">
  1636. <pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
  1637. </pre></div>
  1638. <p>The protocol accepts the following options:
  1639. </p><dl compact="compact">
  1640. <dt><span><samp>listen</samp></span></dt>
  1641. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  1642. </p>
  1643. </dd>
  1644. <dt><span><samp>max_streams</samp></span></dt>
  1645. <dd><p>Set the maximum number of streams. By default no limit is set.
  1646. </p></dd>
  1647. </dl>
  1648. <a name="srt"></a>
  1649. <h3 class="section">3.37 srt<span class="pull-right"><a class="anchor hidden-xs" href="#srt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srt" aria-hidden="true">TOC</a></span></h3>
  1650. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  1651. </p>
  1652. <p>The supported syntax for a SRT URL is:
  1653. </p><div class="example">
  1654. <pre class="example">srt://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  1655. </pre></div>
  1656. <p><var>options</var> contains a list of &amp;-separated options of the form
  1657. <var>key</var>=<var>val</var>.
  1658. </p>
  1659. <p>or
  1660. </p>
  1661. <div class="example">
  1662. <pre class="example"><var>options</var> srt://<var>hostname</var>:<var>port</var>
  1663. </pre></div>
  1664. <p><var>options</var> contains a list of &rsquo;-<var>key</var> <var>val</var>&rsquo;
  1665. options.
  1666. </p>
  1667. <p>This protocol accepts the following options.
  1668. </p>
  1669. <dl compact="compact">
  1670. <dt><span><samp>connect_timeout=<var>milliseconds</var></samp></span></dt>
  1671. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  1672. (2 handshake exchanges) with the default connect timeout of
  1673. 3 seconds. This option applies to the caller and rendezvous
  1674. connection modes. The connect timeout is 10 times the value
  1675. set for the rendezvous mode (which can be used as a
  1676. workaround for this connection problem with earlier versions).
  1677. </p>
  1678. </dd>
  1679. <dt><span><samp>ffs=<var>bytes</var></samp></span></dt>
  1680. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  1681. internal parameter and you should set it to not less than
  1682. <samp>recv_buffer_size</samp> and <samp>mss</samp>. The default value
  1683. is relatively large, therefore unless you set a very large receiver buffer,
  1684. you do not need to change this option. Default value is 25600.
  1685. </p>
  1686. </dd>
  1687. <dt><span><samp>inputbw=<var>bytes/seconds</var></samp></span></dt>
  1688. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  1689. <samp>oheadbw</samp>, when <samp>maxbw</samp> is set to relative (0), to
  1690. calculate maximum sending rate when recovery packets are sent
  1691. along with the main media stream:
  1692. <samp>inputbw</samp> * (100 + <samp>oheadbw</samp>) / 100
  1693. if <samp>inputbw</samp> is not set while <samp>maxbw</samp> is set to
  1694. relative (0), the actual input rate is evaluated inside
  1695. the library. Default value is 0.
  1696. </p>
  1697. </dd>
  1698. <dt><span><samp>iptos=<var>tos</var></samp></span></dt>
  1699. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  1700. </p>
  1701. </dd>
  1702. <dt><span><samp>ipttl=<var>ttl</var></samp></span></dt>
  1703. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  1704. </p>
  1705. </dd>
  1706. <dt><span><samp>latency=<var>microseconds</var></samp></span></dt>
  1707. <dd><p>Timestamp-based Packet Delivery Delay.
  1708. Used to absorb bursts of missed packet retransmissions.
  1709. This flag sets both <samp>rcvlatency</samp> and <samp>peerlatency</samp>
  1710. to the same value. Note that prior to version 1.3.0
  1711. this is the only flag to set the latency, however
  1712. this is effectively equivalent to setting <samp>peerlatency</samp>,
  1713. when side is sender and <samp>rcvlatency</samp>
  1714. when side is receiver, and the bidirectional stream
  1715. sending is not supported.
  1716. </p>
  1717. </dd>
  1718. <dt><span><samp>listen_timeout=<var>microseconds</var></samp></span></dt>
  1719. <dd><p>Set socket listen timeout.
  1720. </p>
  1721. </dd>
  1722. <dt><span><samp>maxbw=<var>bytes/seconds</var></samp></span></dt>
  1723. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  1724. -1 infinite (CSRTCC limit is 30mbps)
  1725. 0 relative to input rate (see <samp>inputbw</samp>)
  1726. &gt;0 absolute limit value
  1727. Default value is 0 (relative)
  1728. </p>
  1729. </dd>
  1730. <dt><span><samp>mode=<var>caller|listener|rendezvous</var></samp></span></dt>
  1731. <dd><p>Connection mode.
  1732. <samp>caller</samp> opens client connection.
  1733. <samp>listener</samp> starts server to listen for incoming connections.
  1734. <samp>rendezvous</samp> use Rendez-Vous connection mode.
  1735. Default value is caller.
  1736. </p>
  1737. </dd>
  1738. <dt><span><samp>mss=<var>bytes</var></samp></span></dt>
  1739. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  1740. and rate calculation using a packet counter assuming fully
  1741. filled packets. The smallest MSS between the peers is
  1742. used. This is 1500 by default in the overall internet.
  1743. This is the maximum size of the UDP packet and can be
  1744. only decreased, unless you have some unusual dedicated
  1745. network settings. Default value is 1500.
  1746. </p>
  1747. </dd>
  1748. <dt><span><samp>nakreport=<var>1|0</var></samp></span></dt>
  1749. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  1750. periodically until a lost packet is retransmitted or
  1751. intentionally dropped. Default value is 1.
  1752. </p>
  1753. </dd>
  1754. <dt><span><samp>oheadbw=<var>percents</var></samp></span></dt>
  1755. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  1756. See <samp>inputbw</samp>. Default value is 25%.
  1757. </p>
  1758. </dd>
  1759. <dt><span><samp>passphrase=<var>string</var></samp></span></dt>
  1760. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  1761. from 10 to 79 characters. The passphrase is the shared
  1762. secret between the sender and the receiver. It is used
  1763. to generate the Key Encrypting Key using PBKDF2
  1764. (Password-Based Key Derivation Function). It is used
  1765. only if <samp>pbkeylen</samp> is non-zero. It is used on
  1766. the receiver only if the received data is encrypted.
  1767. The configured passphrase cannot be recovered (write-only).
  1768. </p>
  1769. </dd>
  1770. <dt><span><samp>enforced_encryption=<var>1|0</var></samp></span></dt>
  1771. <dd><p>If true, both connection parties must have the same password
  1772. set (including empty, that is, with no encryption). If the
  1773. password doesn&rsquo;t match or only one side is unencrypted,
  1774. the connection is rejected. Default is true.
  1775. </p>
  1776. </dd>
  1777. <dt><span><samp>kmrefreshrate=<var>packets</var></samp></span></dt>
  1778. <dd><p>The number of packets to be transmitted after which the
  1779. encryption key is switched to a new key. Default is -1.
  1780. -1 means auto (0x1000000 in srt library). The range for
  1781. this option is integers in the 0 - <code>INT_MAX</code>.
  1782. </p>
  1783. </dd>
  1784. <dt><span><samp>kmpreannounce=<var>packets</var></samp></span></dt>
  1785. <dd><p>The interval between when a new encryption key is sent and
  1786. when switchover occurs. This value also applies to the
  1787. subsequent interval between when switchover occurs and
  1788. when the old encryption key is decommissioned. Default is -1.
  1789. -1 means auto (0x1000 in srt library). The range for
  1790. this option is integers in the 0 - <code>INT_MAX</code>.
  1791. </p>
  1792. </dd>
  1793. <dt><span><samp>snddropdelay=<var>microseconds</var></samp></span></dt>
  1794. <dd><p>The sender&rsquo;s extra delay before dropping packets. This delay is
  1795. added to the default drop delay time interval value.
  1796. </p>
  1797. <p>Special value -1: Do not drop packets on the sender at all.
  1798. </p>
  1799. </dd>
  1800. <dt><span><samp>payload_size=<var>bytes</var></samp></span></dt>
  1801. <dd><p>Sets the maximum declared size of a packet transferred
  1802. during the single call to the sending function in Live
  1803. mode. Use 0 if this value isn&rsquo;t used (which is default in
  1804. file mode).
  1805. Default is -1 (automatic), which typically means MPEG-TS;
  1806. if you are going to use SRT
  1807. to send any different kind of payload, such as, for example,
  1808. wrapping a live stream in very small frames, then you can
  1809. use a bigger maximum frame size, though not greater than
  1810. 1456 bytes.
  1811. </p>
  1812. </dd>
  1813. <dt><span><samp>pkt_size=<var>bytes</var></samp></span></dt>
  1814. <dd><p>Alias for &lsquo;<samp>payload_size</samp>&rsquo;.
  1815. </p>
  1816. </dd>
  1817. <dt><span><samp>peerlatency=<var>microseconds</var></samp></span></dt>
  1818. <dd><p>The latency value (as described in <samp>rcvlatency</samp>) that is
  1819. set by the sender side as a minimum value for the receiver.
  1820. </p>
  1821. </dd>
  1822. <dt><span><samp>pbkeylen=<var>bytes</var></samp></span></dt>
  1823. <dd><p>Sender encryption key length, in bytes.
  1824. Only can be set to 0, 16, 24 and 32.
  1825. Enable sender encryption if not 0.
  1826. Not required on receiver (set to 0),
  1827. key size obtained from sender in HaiCrypt handshake.
  1828. Default value is 0.
  1829. </p>
  1830. </dd>
  1831. <dt><span><samp>rcvlatency=<var>microseconds</var></samp></span></dt>
  1832. <dd><p>The time that should elapse since the moment when the
  1833. packet was sent and the moment when it&rsquo;s delivered to
  1834. the receiver application in the receiving function.
  1835. This time should be a buffer time large enough to cover
  1836. the time spent for sending, unexpectedly extended RTT
  1837. time, and the time needed to retransmit the lost UDP
  1838. packet. The effective latency value will be the maximum
  1839. of this options&rsquo; value and the value of <samp>peerlatency</samp>
  1840. set by the peer side. Before version 1.3.0 this option
  1841. is only available as <samp>latency</samp>.
  1842. </p>
  1843. </dd>
  1844. <dt><span><samp>recv_buffer_size=<var>bytes</var></samp></span></dt>
  1845. <dd><p>Set UDP receive buffer size, expressed in bytes.
  1846. </p>
  1847. </dd>
  1848. <dt><span><samp>send_buffer_size=<var>bytes</var></samp></span></dt>
  1849. <dd><p>Set UDP send buffer size, expressed in bytes.
  1850. </p>
  1851. </dd>
  1852. <dt><span><samp>timeout=<var>microseconds</var></samp></span></dt>
  1853. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  1854. SRT library has internal timeouts which can be controlled separately, the
  1855. value set here is only a cap on those.
  1856. </p>
  1857. </dd>
  1858. <dt><span><samp>tlpktdrop=<var>1|0</var></samp></span></dt>
  1859. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  1860. missing packets that have not been delivered in time and
  1861. delivers the following packets to the application when
  1862. their time-to-play has come. It also sends a fake ACK to
  1863. the sender. When enabled on sender and enabled on the
  1864. receiving peer, the sender drops the older packets that
  1865. have no chance of being delivered in time. It was
  1866. automatically enabled in the sender if the receiver
  1867. supports it.
  1868. </p>
  1869. </dd>
  1870. <dt><span><samp>sndbuf=<var>bytes</var></samp></span></dt>
  1871. <dd><p>Set send buffer size, expressed in bytes.
  1872. </p>
  1873. </dd>
  1874. <dt><span><samp>rcvbuf=<var>bytes</var></samp></span></dt>
  1875. <dd><p>Set receive buffer size, expressed in bytes.
  1876. </p>
  1877. <p>Receive buffer must not be greater than <samp>ffs</samp>.
  1878. </p>
  1879. </dd>
  1880. <dt><span><samp>lossmaxttl=<var>packets</var></samp></span></dt>
  1881. <dd><p>The value up to which the Reorder Tolerance may grow. When
  1882. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  1883. until that number of packets come in. Reorder Tolerance
  1884. increases every time a &quot;belated&quot; packet has come, but it
  1885. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  1886. to come out of order), with the difference between the latest
  1887. sequence and this packet&rsquo;s sequence, and not more than the
  1888. value of this option. By default it&rsquo;s 0, which means that this
  1889. mechanism is turned off, and the loss report is always sent
  1890. immediately upon experiencing a &quot;gap&quot; in sequences.
  1891. </p>
  1892. </dd>
  1893. <dt><span><samp>minversion</samp></span></dt>
  1894. <dd><p>The minimum SRT version that is required from the peer. A connection
  1895. to a peer that does not satisfy the minimum version requirement
  1896. will be rejected.
  1897. </p>
  1898. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  1899. form.
  1900. </p>
  1901. </dd>
  1902. <dt><span><samp>streamid=<var>string</var></samp></span></dt>
  1903. <dd><p>A string limited to 512 characters that can be set on the socket prior
  1904. to connecting. This stream ID will be able to be retrieved by the
  1905. listener side from the socket that is returned from srt_accept and
  1906. was connected by a socket with that set stream ID. SRT does not enforce
  1907. any special interpretation of the contents of this string.
  1908. This option doesn’t make sense in Rendezvous connection; the result
  1909. might be that simply one side will override the value from the other
  1910. side and it’s the matter of luck which one would win
  1911. </p>
  1912. </dd>
  1913. <dt><span><samp>srt_streamid=<var>string</var></samp></span></dt>
  1914. <dd><p>Alias for &lsquo;<samp>streamid</samp>&rsquo; to avoid conflict with ffmpeg command line option.
  1915. </p>
  1916. </dd>
  1917. <dt><span><samp>smoother=<var>live|file</var></samp></span></dt>
  1918. <dd><p>The type of Smoother used for the transmission for that socket, which
  1919. is responsible for the transmission and congestion control. The Smoother
  1920. type must be exactly the same on both connecting parties, otherwise
  1921. the connection is rejected.
  1922. </p>
  1923. </dd>
  1924. <dt><span><samp>messageapi=<var>1|0</var></samp></span></dt>
  1925. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  1926. API. Note that in live mode (see <samp>transtype</samp>) there’s only
  1927. message API available. In File mode you can chose to use one of two modes:
  1928. </p>
  1929. <p>Stream API (default, when this option is false). In this mode you may
  1930. send as many data as you wish with one sending instruction, or even use
  1931. dedicated functions that read directly from a file. The internal facility
  1932. will take care of any speed and congestion control. When receiving, you
  1933. can also receive as many data as desired, the data not extracted will be
  1934. waiting for the next call. There is no boundary between data portions in
  1935. the Stream mode.
  1936. </p>
  1937. <p>Message API. In this mode your single sending instruction passes exactly
  1938. one piece of data that has boundaries (a message). Contrary to Live mode,
  1939. this message may span across multiple UDP packets and the only size
  1940. limitation is that it shall fit as a whole in the sending buffer. The
  1941. receiver shall use as large buffer as necessary to receive the message,
  1942. otherwise the message will not be given up. When the message is not
  1943. complete (not all packets received or there was a packet loss) it will
  1944. not be given up.
  1945. </p>
  1946. </dd>
  1947. <dt><span><samp>transtype=<var>live|file</var></samp></span></dt>
  1948. <dd><p>Sets the transmission type for the socket, in particular, setting this
  1949. option sets multiple other parameters to their default values as required
  1950. for a particular transmission type.
  1951. </p>
  1952. <p>live: Set options as for live transmission. In this mode, you should
  1953. send by one sending instruction only so many data that fit in one UDP packet,
  1954. and limited to the value defined first in <samp>payload_size</samp> (1316 is
  1955. default in this mode). There is no speed control in this mode, only the
  1956. bandwidth control, if configured, in order to not exceed the bandwidth with
  1957. the overhead transmission (retransmitted and control packets).
  1958. </p>
  1959. <p>file: Set options as for non-live transmission. See <samp>messageapi</samp>
  1960. for further explanations
  1961. </p>
  1962. </dd>
  1963. <dt><span><samp>linger=<var>seconds</var></samp></span></dt>
  1964. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  1965. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  1966. seconds in file mode). The range for this option is integers in the
  1967. 0 - <code>INT_MAX</code>.
  1968. </p>
  1969. </dd>
  1970. <dt><span><samp>tsbpd=<var>1|0</var></samp></span></dt>
  1971. <dd><p>When true, use Timestamp-based Packet Delivery mode. The default behavior
  1972. depends on the transmission type: enabled in live mode, disabled in file
  1973. mode.
  1974. </p>
  1975. </dd>
  1976. </dl>
  1977. <p>For more information see: <a href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  1978. </p>
  1979. <a name="srtp"></a>
  1980. <h3 class="section">3.38 srtp<span class="pull-right"><a class="anchor hidden-xs" href="#srtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srtp" aria-hidden="true">TOC</a></span></h3>
  1981. <p>Secure Real-time Transport Protocol.
  1982. </p>
  1983. <p>The accepted options are:
  1984. </p><dl compact="compact">
  1985. <dt><span><samp>srtp_in_suite</samp></span></dt>
  1986. <dt><span><samp>srtp_out_suite</samp></span></dt>
  1987. <dd><p>Select input and output encoding suites.
  1988. </p>
  1989. <p>Supported values:
  1990. </p><dl compact="compact">
  1991. <dt><span>&lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</span></dt>
  1992. <dt><span>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</span></dt>
  1993. <dt><span>&lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</span></dt>
  1994. <dt><span>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</span></dt>
  1995. </dl>
  1996. </dd>
  1997. <dt><span><samp>srtp_in_params</samp></span></dt>
  1998. <dt><span><samp>srtp_out_params</samp></span></dt>
  1999. <dd><p>Set input and output encoding parameters, which are expressed by a
  2000. base64-encoded representation of a binary block. The first 16 bytes of
  2001. this binary block are used as master key, the following 14 bytes are
  2002. used as master salt.
  2003. </p></dd>
  2004. </dl>
  2005. <a name="subfile"></a>
  2006. <h3 class="section">3.39 subfile<span class="pull-right"><a class="anchor hidden-xs" href="#subfile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subfile" aria-hidden="true">TOC</a></span></h3>
  2007. <p>Virtually extract a segment of a file or another stream.
  2008. The underlying stream must be seekable.
  2009. </p>
  2010. <p>Accepted options:
  2011. </p><dl compact="compact">
  2012. <dt><span><samp>start</samp></span></dt>
  2013. <dd><p>Start offset of the extracted segment, in bytes.
  2014. </p></dd>
  2015. <dt><span><samp>end</samp></span></dt>
  2016. <dd><p>End offset of the extracted segment, in bytes.
  2017. If set to 0, extract till end of file.
  2018. </p></dd>
  2019. </dl>
  2020. <p>Examples:
  2021. </p>
  2022. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  2023. externally and multiplied by 2048):
  2024. </p><div class="example">
  2025. <pre class="example">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  2026. </pre></div>
  2027. <p>Play an AVI file directly from a TAR archive:
  2028. </p><div class="example">
  2029. <pre class="example">subfile,,start,183241728,end,366490624,,:archive.tar
  2030. </pre></div>
  2031. <p>Play a MPEG-TS file from start offset till end:
  2032. </p><div class="example">
  2033. <pre class="example">subfile,,start,32815239,end,0,,:video.ts
  2034. </pre></div>
  2035. <a name="tee"></a>
  2036. <h3 class="section">3.40 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee" aria-hidden="true">TOC</a></span></h3>
  2037. <p>Writes the output to multiple protocols. The individual outputs are separated
  2038. by |
  2039. </p>
  2040. <div class="example">
  2041. <pre class="example">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  2042. </pre></div>
  2043. <a name="tcp"></a>
  2044. <h3 class="section">3.41 tcp<span class="pull-right"><a class="anchor hidden-xs" href="#tcp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tcp" aria-hidden="true">TOC</a></span></h3>
  2045. <p>Transmission Control Protocol.
  2046. </p>
  2047. <p>The required syntax for a TCP url is:
  2048. </p><div class="example">
  2049. <pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  2050. </pre></div>
  2051. <p><var>options</var> contains a list of &amp;-separated options of the form
  2052. <var>key</var>=<var>val</var>.
  2053. </p>
  2054. <p>The list of supported options follows.
  2055. </p>
  2056. <dl compact="compact">
  2057. <dt><span><samp>listen=<var>2|1|0</var></samp></span></dt>
  2058. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  2059. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  2060. </p>
  2061. </dd>
  2062. <dt><span><samp>timeout=<var>microseconds</var></samp></span></dt>
  2063. <dd><p>Set raise error timeout, expressed in microseconds.
  2064. </p>
  2065. <p>This option is only relevant in read mode: if no data arrived in more
  2066. than this time interval, raise error.
  2067. </p>
  2068. </dd>
  2069. <dt><span><samp>listen_timeout=<var>milliseconds</var></samp></span></dt>
  2070. <dd><p>Set listen timeout, expressed in milliseconds.
  2071. </p>
  2072. </dd>
  2073. <dt><span><samp>recv_buffer_size=<var>bytes</var></samp></span></dt>
  2074. <dd><p>Set receive buffer size, expressed bytes.
  2075. </p>
  2076. </dd>
  2077. <dt><span><samp>send_buffer_size=<var>bytes</var></samp></span></dt>
  2078. <dd><p>Set send buffer size, expressed bytes.
  2079. </p>
  2080. </dd>
  2081. <dt><span><samp>tcp_nodelay=<var>1|0</var></samp></span></dt>
  2082. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  2083. </p>
  2084. <p><em>Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY.</em>
  2085. </p>
  2086. </dd>
  2087. <dt><span><samp>tcp_mss=<var>bytes</var></samp></span></dt>
  2088. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  2089. </p></dd>
  2090. </dl>
  2091. <p>The following example shows how to setup a listening TCP connection
  2092. with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
  2093. </p><div class="example">
  2094. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
  2095. ffplay tcp://<var>hostname</var>:<var>port</var>
  2096. </pre></div>
  2097. <a name="tls"></a>
  2098. <h3 class="section">3.42 tls<span class="pull-right"><a class="anchor hidden-xs" href="#tls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tls" aria-hidden="true">TOC</a></span></h3>
  2099. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  2100. </p>
  2101. <p>The required syntax for a TLS/SSL url is:
  2102. </p><div class="example">
  2103. <pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  2104. </pre></div>
  2105. <p>The following parameters can be set via command line options
  2106. (or in code via <code>AVOption</code>s):
  2107. </p>
  2108. <dl compact="compact">
  2109. <dt><span><samp>ca_file, cafile=<var>filename</var></samp></span></dt>
  2110. <dd><p>A file containing certificate authority (CA) root certificates to treat
  2111. as trusted. If the linked TLS library contains a default this might not
  2112. need to be specified for verification to work, but not all libraries and
  2113. setups have defaults built in.
  2114. The file must be in OpenSSL PEM format.
  2115. </p>
  2116. </dd>
  2117. <dt><span><samp>tls_verify=<var>1|0</var></samp></span></dt>
  2118. <dd><p>If enabled, try to verify the peer that we are communicating with.
  2119. Note, if using OpenSSL, this currently only makes sure that the
  2120. peer certificate is signed by one of the root certificates in the CA
  2121. database, but it does not validate that the certificate actually
  2122. matches the host name we are trying to connect to. (With other backends,
  2123. the host name is validated as well.)
  2124. </p>
  2125. <p>This is disabled by default since it requires a CA database to be
  2126. provided by the caller in many cases.
  2127. </p>
  2128. </dd>
  2129. <dt><span><samp>cert_file, cert=<var>filename</var></samp></span></dt>
  2130. <dd><p>A file containing a certificate to use in the handshake with the peer.
  2131. (When operating as server, in listen mode, this is more often required
  2132. by the peer, while client certificates only are mandated in certain
  2133. setups.)
  2134. </p>
  2135. </dd>
  2136. <dt><span><samp>key_file, key=<var>filename</var></samp></span></dt>
  2137. <dd><p>A file containing the private key for the certificate.
  2138. </p>
  2139. </dd>
  2140. <dt><span><samp>listen=<var>1|0</var></samp></span></dt>
  2141. <dd><p>If enabled, listen for connections on the provided port, and assume
  2142. the server role in the handshake instead of the client role.
  2143. </p>
  2144. </dd>
  2145. <dt><span><samp>http_proxy</samp></span></dt>
  2146. <dd><p>The HTTP proxy to tunnel through, e.g. <code>http://example.com:1234</code>.
  2147. The proxy must support the CONNECT method.
  2148. </p>
  2149. </dd>
  2150. </dl>
  2151. <p>Example command lines:
  2152. </p>
  2153. <p>To create a TLS/SSL server that serves an input stream.
  2154. </p>
  2155. <div class="example">
  2156. <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>
  2157. </pre></div>
  2158. <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
  2159. </p>
  2160. <div class="example">
  2161. <pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
  2162. </pre></div>
  2163. <a name="udp"></a>
  2164. <h3 class="section">3.43 udp<span class="pull-right"><a class="anchor hidden-xs" href="#udp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-udp" aria-hidden="true">TOC</a></span></h3>
  2165. <p>User Datagram Protocol.
  2166. </p>
  2167. <p>The required syntax for an UDP URL is:
  2168. </p><div class="example">
  2169. <pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  2170. </pre></div>
  2171. <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
  2172. </p>
  2173. <p>In case threading is enabled on the system, a circular buffer is used
  2174. to store the incoming data, which allows one to reduce loss of data due to
  2175. UDP socket buffer overruns. The <var>fifo_size</var> and
  2176. <var>overrun_nonfatal</var> options are related to this buffer.
  2177. </p>
  2178. <p>The list of supported options follows.
  2179. </p>
  2180. <dl compact="compact">
  2181. <dt><span><samp>buffer_size=<var>size</var></samp></span></dt>
  2182. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  2183. the receive or send buffer size, depending on what the socket is used for.
  2184. Default is 32 KB for output, 384 KB for input. See also <var>fifo_size</var>.
  2185. </p>
  2186. </dd>
  2187. <dt><span><samp>bitrate=<var>bitrate</var></samp></span></dt>
  2188. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  2189. input has enough packets to sustain it.
  2190. </p>
  2191. </dd>
  2192. <dt><span><samp>burst_bits=<var>bits</var></samp></span></dt>
  2193. <dd><p>When using <var>bitrate</var> this specifies the maximum number of bits in
  2194. packet bursts.
  2195. </p>
  2196. </dd>
  2197. <dt><span><samp>localport=<var>port</var></samp></span></dt>
  2198. <dd><p>Override the local UDP port to bind with.
  2199. </p>
  2200. </dd>
  2201. <dt><span><samp>localaddr=<var>addr</var></samp></span></dt>
  2202. <dd><p>Local IP address of a network interface used for sending packets or joining
  2203. multicast groups.
  2204. </p>
  2205. </dd>
  2206. <dt><span><samp>pkt_size=<var>size</var></samp></span></dt>
  2207. <dd><p>Set the size in bytes of UDP packets.
  2208. </p>
  2209. </dd>
  2210. <dt><span><samp>reuse=<var>1|0</var></samp></span></dt>
  2211. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  2212. </p>
  2213. </dd>
  2214. <dt><span><samp>ttl=<var>ttl</var></samp></span></dt>
  2215. <dd><p>Set the time to live value (for multicast only).
  2216. </p>
  2217. </dd>
  2218. <dt><span><samp>connect=<var>1|0</var></samp></span></dt>
  2219. <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
  2220. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  2221. If the destination address isn&rsquo;t known at the start, this option can
  2222. be specified in ff_udp_set_remote_url, too.
  2223. This allows finding out the source address for the packets with getsockname,
  2224. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  2225. unreachable&quot; is received.
  2226. For receiving, this gives the benefit of only receiving packets from
  2227. the specified peer address/port.
  2228. </p>
  2229. </dd>
  2230. <dt><span><samp>sources=<var>address</var>[,<var>address</var>]</samp></span></dt>
  2231. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  2232. also subscribe to multicast traffic coming from these addresses only.
  2233. </p>
  2234. </dd>
  2235. <dt><span><samp>block=<var>address</var>[,<var>address</var>]</samp></span></dt>
  2236. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  2237. exclude the source addresses in the multicast subscription.
  2238. </p>
  2239. </dd>
  2240. <dt><span><samp>fifo_size=<var>units</var></samp></span></dt>
  2241. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  2242. packets with size of 188 bytes. If not specified defaults to 7*4096.
  2243. </p>
  2244. </dd>
  2245. <dt><span><samp>overrun_nonfatal=<var>1|0</var></samp></span></dt>
  2246. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  2247. value is 0.
  2248. </p>
  2249. </dd>
  2250. <dt><span><samp>timeout=<var>microseconds</var></samp></span></dt>
  2251. <dd><p>Set raise error timeout, expressed in microseconds.
  2252. </p>
  2253. <p>This option is only relevant in read mode: if no data arrived in more
  2254. than this time interval, raise error.
  2255. </p>
  2256. </dd>
  2257. <dt><span><samp>broadcast=<var>1|0</var></samp></span></dt>
  2258. <dd><p>Explicitly allow or disallow UDP broadcasting.
  2259. </p>
  2260. <p>Note that broadcasting may not work properly on networks having
  2261. a broadcast storm protection.
  2262. </p></dd>
  2263. </dl>
  2264. <a name="Examples-1"></a>
  2265. <h4 class="subsection">3.43.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
  2266. <ul>
  2267. <li> Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
  2268. <div class="example">
  2269. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
  2270. </pre></div>
  2271. </li><li> Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
  2272. sized UDP packets, using a large input buffer:
  2273. <div class="example">
  2274. <pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
  2275. </pre></div>
  2276. </li><li> Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
  2277. <div class="example">
  2278. <pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
  2279. </pre></div>
  2280. </li></ul>
  2281. <a name="unix"></a>
  2282. <h3 class="section">3.44 unix<span class="pull-right"><a class="anchor hidden-xs" href="#unix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unix" aria-hidden="true">TOC</a></span></h3>
  2283. <p>Unix local socket
  2284. </p>
  2285. <p>The required syntax for a Unix socket URL is:
  2286. </p>
  2287. <div class="example">
  2288. <pre class="example">unix://<var>filepath</var>
  2289. </pre></div>
  2290. <p>The following parameters can be set via command line options
  2291. (or in code via <code>AVOption</code>s):
  2292. </p>
  2293. <dl compact="compact">
  2294. <dt><span><samp>timeout</samp></span></dt>
  2295. <dd><p>Timeout in ms.
  2296. </p></dd>
  2297. <dt><span><samp>listen</samp></span></dt>
  2298. <dd><p>Create the Unix socket in listening mode.
  2299. </p></dd>
  2300. </dl>
  2301. <a name="zmq"></a>
  2302. <h3 class="section">3.45 zmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq" aria-hidden="true">TOC</a></span></h3>
  2303. <p>ZeroMQ asynchronous messaging using the libzmq library.
  2304. </p>
  2305. <p>This library supports unicast streaming to multiple clients without relying on
  2306. an external server.
  2307. </p>
  2308. <p>The required syntax for streaming or connecting to a stream is:
  2309. </p><div class="example">
  2310. <pre class="example">zmq:tcp://ip-address:port
  2311. </pre></div>
  2312. <p>Example:
  2313. Create a localhost stream on port 5555:
  2314. </p><div class="example">
  2315. <pre class="example">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  2316. </pre></div>
  2317. <p>Multiple clients may connect to the stream using:
  2318. </p><div class="example">
  2319. <pre class="example">ffplay zmq:tcp://127.0.0.1:5555
  2320. </pre></div>
  2321. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  2322. The server side binds to a port and publishes data. Clients connect to the
  2323. server (via IP address/port) and subscribe to the stream. The order in which
  2324. the server and client start generally does not matter.
  2325. </p>
  2326. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  2327. this protocol.
  2328. </p>
  2329. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  2330. line. The following options are supported:
  2331. </p>
  2332. <dl compact="compact">
  2333. <dt><span><samp>pkt_size</samp></span></dt>
  2334. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  2335. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  2336. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  2337. packets. Note that pkt_size on the clients should be equal to or greater than
  2338. pkt_size on the server. Otherwise the received message may be truncated causing
  2339. decoding errors.
  2340. </p>
  2341. </dd>
  2342. </dl>
  2343. <a name="See-Also"></a>
  2344. <h2 class="chapter">4 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  2345. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  2346. <a href="libavformat.html">libavformat</a>
  2347. </p>
  2348. <a name="Authors"></a>
  2349. <h2 class="chapter">5 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  2350. <p>The FFmpeg developers.
  2351. </p>
  2352. <p>For details about the authorship, see the Git history of the project
  2353. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  2354. <code>git log</code> in the FFmpeg source directory, or browsing the
  2355. online repository at <a href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  2356. </p>
  2357. <p>Maintainers for the specific components are listed in the file
  2358. <samp>MAINTAINERS</samp> in the source code tree.
  2359. </p>
  2360. <p style="font-size: small;">
  2361. This document was generated using <a href="https://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  2362. </p>
  2363. </div>
  2364. </body>
  2365. </html>