星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ffmpeg-protocols.html 79KB

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