ffmpeg-protocols.html 106 KB

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