ffmpeg-protocols.html 115 KB

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