ffmpeg-protocols.1 74 KB

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