You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

830 lines
24KB

  1. @chapter Protocols
  2. @c man begin PROTOCOLS
  3. Protocols are configured elements in FFmpeg which allow to access
  4. resources which require the use of a particular protocol.
  5. When you configure your FFmpeg build, all the supported protocols are
  6. enabled by default. You can list all available ones using the
  7. configure option "--list-protocols".
  8. You can disable all the protocols using the configure option
  9. "--disable-protocols", and selectively enable a protocol using the
  10. option "--enable-protocol=@var{PROTOCOL}", or you can disable a
  11. particular protocol using the option
  12. "--disable-protocol=@var{PROTOCOL}".
  13. The option "-protocols" of the ff* tools will display the list of
  14. supported protocols.
  15. A description of the currently available protocols follows.
  16. @section bluray
  17. Read BluRay playlist.
  18. The accepted options are:
  19. @table @option
  20. @item angle
  21. BluRay angle
  22. @item chapter
  23. Start chapter (1...N)
  24. @item playlist
  25. Playlist to read (BDMV/PLAYLIST/?????.mpls)
  26. @end table
  27. Examples:
  28. Read longest playlist from BluRay mounted to /mnt/bluray:
  29. @example
  30. bluray:/mnt/bluray
  31. @end example
  32. Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  33. @example
  34. -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  35. @end example
  36. @section concat
  37. Physical concatenation protocol.
  38. Allow to read and seek from many resource in sequence as if they were
  39. a unique resource.
  40. A URL accepted by this protocol has the syntax:
  41. @example
  42. concat:@var{URL1}|@var{URL2}|...|@var{URLN}
  43. @end example
  44. where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
  45. resource to be concatenated, each one possibly specifying a distinct
  46. protocol.
  47. For example to read a sequence of files @file{split1.mpeg},
  48. @file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the
  49. command:
  50. @example
  51. ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  52. @end example
  53. Note that you may need to escape the character "|" which is special for
  54. many shells.
  55. @section data
  56. Data in-line in the URI. See @url{http://en.wikipedia.org/wiki/Data_URI_scheme}.
  57. For example, to convert a GIF file given inline with @command{ffmpeg}:
  58. @example
  59. ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
  60. @end example
  61. @section file
  62. File access protocol.
  63. Allow to read from or read to a file.
  64. For example to read from a file @file{input.mpeg} with @command{ffmpeg}
  65. use the command:
  66. @example
  67. ffmpeg -i file:input.mpeg output.mpeg
  68. @end example
  69. The ff* tools default to the file protocol, that is a resource
  70. specified with the name "FILE.mpeg" is interpreted as the URL
  71. "file:FILE.mpeg".
  72. @section ftp
  73. FTP (File Transfer Protocol)
  74. Allow to read from or write to remote resources using FTP protocol.
  75. Following syntax is required.
  76. @example
  77. ftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg
  78. @end example
  79. This protocol accepts the following options.
  80. @table @option
  81. @item timeout
  82. Set timeout of socket I/O operations used by the underlying low level
  83. operation. By default it is set to -1, which means that the timeout is
  84. not specified.
  85. @item ftp-anonymous-password
  86. Password used when login as anonymous user. Typically an e-mail address
  87. should be used.
  88. @item ftp-write-seekable
  89. Control seekability of connection during encoding. If set to 1 the
  90. resource is supposed to be seekable, if set to 0 it is assumed not
  91. to be seekable. Default value is 0.
  92. @end table
  93. NOTE: Protocol can be used as output, but it is recommended to not do
  94. it, unless special care is taken (tests, customized server configuration
  95. etc.). Different FTP servers behave in different way during seek
  96. operation. ff* tools may produce incomplete content due to server limitations.
  97. @section gopher
  98. Gopher protocol.
  99. @section hls
  100. Read Apple HTTP Live Streaming compliant segmented stream as
  101. a uniform one. The M3U8 playlists describing the segments can be
  102. remote HTTP resources or local files, accessed using the standard
  103. file protocol.
  104. The nested protocol is declared by specifying
  105. "+@var{proto}" after the hls URI scheme name, where @var{proto}
  106. is either "file" or "http".
  107. @example
  108. hls+http://host/path/to/remote/resource.m3u8
  109. hls+file://path/to/local/resource.m3u8
  110. @end example
  111. Using this protocol is discouraged - the hls demuxer should work
  112. just as well (if not, please report the issues) and is more complete.
  113. To use the hls demuxer instead, simply use the direct URLs to the
  114. m3u8 files.
  115. @section http
  116. HTTP (Hyper Text Transfer Protocol).
  117. This protocol accepts the following options.
  118. @table @option
  119. @item seekable
  120. Control seekability of connection. If set to 1 the resource is
  121. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  122. if set to -1 it will try to autodetect if it is seekable. Default
  123. value is -1.
  124. @item chunked_post
  125. If set to 1 use chunked transfer-encoding for posts, default is 1.
  126. @item headers
  127. Set custom HTTP headers, can override built in default headers. The
  128. value must be a string encoding the headers.
  129. @item content_type
  130. Force a content type.
  131. @item user-agent
  132. Override User-Agent header. If not specified the protocol will use a
  133. string describing the libavformat build.
  134. @item multiple_requests
  135. Use persistent connections if set to 1. By default it is 0.
  136. @item post_data
  137. Set custom HTTP post data.
  138. @item timeout
  139. Set timeout of socket I/O operations used by the underlying low level
  140. operation. By default it is set to -1, which means that the timeout is
  141. not specified.
  142. @item mime_type
  143. Set MIME type.
  144. @item cookies
  145. Set the cookies to be sent in future requests. The format of each cookie is the
  146. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  147. delimited by a newline character.
  148. @end table
  149. @subsection HTTP Cookies
  150. Some HTTP requests will be denied unless cookie values are passed in with the
  151. request. The @option{cookies} option allows these cookies to be specified. At
  152. the very least, each cookie must specify a value along with a path and domain.
  153. HTTP requests that match both the domain and path will automatically include the
  154. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  155. by a newline.
  156. The required syntax to play a stream specifying a cookie is:
  157. @example
  158. ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
  159. @end example
  160. @section mmst
  161. MMS (Microsoft Media Server) protocol over TCP.
  162. @section mmsh
  163. MMS (Microsoft Media Server) protocol over HTTP.
  164. The required syntax is:
  165. @example
  166. mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
  167. @end example
  168. @section md5
  169. MD5 output protocol.
  170. Computes the MD5 hash of the data to be written, and on close writes
  171. this to the designated output or stdout if none is specified. It can
  172. be used to test muxers without writing an actual file.
  173. Some examples follow.
  174. @example
  175. # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  176. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  177. # Write the MD5 hash of the encoded AVI file to stdout.
  178. ffmpeg -i input.flv -f avi -y md5:
  179. @end example
  180. Note that some formats (typically MOV) require the output protocol to
  181. be seekable, so they will fail with the MD5 output protocol.
  182. @section pipe
  183. UNIX pipe access protocol.
  184. Allow to read and write from UNIX pipes.
  185. The accepted syntax is:
  186. @example
  187. pipe:[@var{number}]
  188. @end example
  189. @var{number} is the number corresponding to the file descriptor of the
  190. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number}
  191. is not specified, by default the stdout file descriptor will be used
  192. for writing, stdin for reading.
  193. For example to read from stdin with @command{ffmpeg}:
  194. @example
  195. cat test.wav | ffmpeg -i pipe:0
  196. # ...this is the same as...
  197. cat test.wav | ffmpeg -i pipe:
  198. @end example
  199. For writing to stdout with @command{ffmpeg}:
  200. @example
  201. ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
  202. # ...this is the same as...
  203. ffmpeg -i test.wav -f avi pipe: | cat > test.avi
  204. @end example
  205. Note that some formats (typically MOV), require the output protocol to
  206. be seekable, so they will fail with the pipe output protocol.
  207. @section rtmp
  208. Real-Time Messaging Protocol.
  209. The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  210. content across a TCP/IP network.
  211. The required syntax is:
  212. @example
  213. rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
  214. @end example
  215. The accepted parameters are:
  216. @table @option
  217. @item server
  218. The address of the RTMP server.
  219. @item port
  220. The number of the TCP port to use (by default is 1935).
  221. @item app
  222. It is the name of the application to access. It usually corresponds to
  223. the path where the application is installed on the RTMP server
  224. (e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
  225. the value parsed from the URI through the @code{rtmp_app} option, too.
  226. @item playpath
  227. It is the path or name of the resource to play with reference to the
  228. application specified in @var{app}, may be prefixed by "mp4:". You
  229. can override the value parsed from the URI through the @code{rtmp_playpath}
  230. option, too.
  231. @item listen
  232. Act as a server, listening for an incoming connection.
  233. @item timeout
  234. Maximum time to wait for the incoming connection. Implies listen.
  235. @end table
  236. Additionally, the following parameters can be set via command line options
  237. (or in code via @code{AVOption}s):
  238. @table @option
  239. @item rtmp_app
  240. Name of application to connect on the RTMP server. This option
  241. overrides the parameter specified in the URI.
  242. @item rtmp_buffer
  243. Set the client buffer time in milliseconds. The default is 3000.
  244. @item rtmp_conn
  245. Extra arbitrary AMF connection parameters, parsed from a string,
  246. e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
  247. Each value is prefixed by a single character denoting the type,
  248. B for Boolean, N for number, S for string, O for object, or Z for null,
  249. followed by a colon. For Booleans the data must be either 0 or 1 for
  250. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  251. 1 to end or begin an object, respectively. Data items in subobjects may
  252. be named, by prefixing the type with 'N' and specifying the name before
  253. the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
  254. times to construct arbitrary AMF sequences.
  255. @item rtmp_flashver
  256. Version of the Flash plugin used to run the SWF player. The default
  257. is LNX 9,0,124,2.
  258. @item rtmp_flush_interval
  259. Number of packets flushed in the same request (RTMPT only). The default
  260. is 10.
  261. @item rtmp_live
  262. Specify that the media is a live stream. No resuming or seeking in
  263. live streams is possible. The default value is @code{any}, which means the
  264. subscriber first tries to play the live stream specified in the
  265. playpath. If a live stream of that name is not found, it plays the
  266. recorded stream. The other possible values are @code{live} and
  267. @code{recorded}.
  268. @item rtmp_pageurl
  269. URL of the web page in which the media was embedded. By default no
  270. value will be sent.
  271. @item rtmp_playpath
  272. Stream identifier to play or to publish. This option overrides the
  273. parameter specified in the URI.
  274. @item rtmp_subscribe
  275. Name of live stream to subscribe to. By default no value will be sent.
  276. It is only sent if the option is specified or if rtmp_live
  277. is set to live.
  278. @item rtmp_swfhash
  279. SHA256 hash of the decompressed SWF file (32 bytes).
  280. @item rtmp_swfsize
  281. Size of the decompressed SWF file, required for SWFVerification.
  282. @item rtmp_swfurl
  283. URL of the SWF player for the media. By default no value will be sent.
  284. @item rtmp_swfverify
  285. URL to player swf file, compute hash/size automatically.
  286. @item rtmp_tcurl
  287. URL of the target stream. Defaults to proto://host[:port]/app.
  288. @end table
  289. For example to read with @command{ffplay} a multimedia resource named
  290. "sample" from the application "vod" from an RTMP server "myserver":
  291. @example
  292. ffplay rtmp://myserver/vod/sample
  293. @end example
  294. @section rtmpe
  295. Encrypted Real-Time Messaging Protocol.
  296. The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  297. streaming multimedia content within standard cryptographic primitives,
  298. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  299. a pair of RC4 keys.
  300. @section rtmps
  301. Real-Time Messaging Protocol over a secure SSL connection.
  302. The Real-Time Messaging Protocol (RTMPS) is used for streaming
  303. multimedia content across an encrypted connection.
  304. @section rtmpt
  305. Real-Time Messaging Protocol tunneled through HTTP.
  306. The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  307. for streaming multimedia content within HTTP requests to traverse
  308. firewalls.
  309. @section rtmpte
  310. Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  311. The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  312. is used for streaming multimedia content within HTTP requests to traverse
  313. firewalls.
  314. @section rtmpts
  315. Real-Time Messaging Protocol tunneled through HTTPS.
  316. The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  317. for streaming multimedia content within HTTPS requests to traverse
  318. firewalls.
  319. @section rtmp, rtmpe, rtmps, rtmpt, rtmpte
  320. Real-Time Messaging Protocol and its variants supported through
  321. librtmp.
  322. Requires the presence of the librtmp headers and library during
  323. configuration. You need to explicitly configure the build with
  324. "--enable-librtmp". If enabled this will replace the native RTMP
  325. protocol.
  326. This protocol provides most client functions and a few server
  327. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  328. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  329. variants of these encrypted types (RTMPTE, RTMPTS).
  330. The required syntax is:
  331. @example
  332. @var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
  333. @end example
  334. where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
  335. "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
  336. @var{server}, @var{port}, @var{app} and @var{playpath} have the same
  337. meaning as specified for the RTMP native protocol.
  338. @var{options} contains a list of space-separated options of the form
  339. @var{key}=@var{val}.
  340. See the librtmp manual page (man 3 librtmp) for more information.
  341. For example, to stream a file in real-time to an RTMP server using
  342. @command{ffmpeg}:
  343. @example
  344. ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  345. @end example
  346. To play the same stream using @command{ffplay}:
  347. @example
  348. ffplay "rtmp://myserver/live/mystream live=1"
  349. @end example
  350. @section rtp
  351. Real-Time Protocol.
  352. @section rtsp
  353. RTSP is not technically a protocol handler in libavformat, it is a demuxer
  354. and muxer. The demuxer supports both normal RTSP (with data transferred
  355. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  356. data transferred over RDT).
  357. The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  358. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
  359. @uref{http://github.com/revmischa/rtsp-server, RTSP server}).
  360. The required syntax for a RTSP url is:
  361. @example
  362. rtsp://@var{hostname}[:@var{port}]/@var{path}
  363. @end example
  364. The following options (set on the @command{ffmpeg}/@command{ffplay} command
  365. line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
  366. are supported:
  367. Flags for @code{rtsp_transport}:
  368. @table @option
  369. @item udp
  370. Use UDP as lower transport protocol.
  371. @item tcp
  372. Use TCP (interleaving within the RTSP control channel) as lower
  373. transport protocol.
  374. @item udp_multicast
  375. Use UDP multicast as lower transport protocol.
  376. @item http
  377. Use HTTP tunneling as lower transport protocol, which is useful for
  378. passing proxies.
  379. @end table
  380. Multiple lower transport protocols may be specified, in that case they are
  381. tried one at a time (if the setup of one fails, the next one is tried).
  382. For the muxer, only the @code{tcp} and @code{udp} options are supported.
  383. Flags for @code{rtsp_flags}:
  384. @table @option
  385. @item filter_src
  386. Accept packets only from negotiated peer address and port.
  387. @item listen
  388. Act as a server, listening for an incoming connection.
  389. @end table
  390. When receiving data over UDP, the demuxer tries to reorder received packets
  391. (since they may arrive out of order, or packets may get lost totally). This
  392. can be disabled by setting the maximum demuxing delay to zero (via
  393. the @code{max_delay} field of AVFormatContext).
  394. When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the
  395. streams to display can be chosen with @code{-vst} @var{n} and
  396. @code{-ast} @var{n} for video and audio respectively, and can be switched
  397. on the fly by pressing @code{v} and @code{a}.
  398. Example command lines:
  399. To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  400. @example
  401. ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  402. @end example
  403. To watch a stream tunneled over HTTP:
  404. @example
  405. ffplay -rtsp_transport http rtsp://server/video.mp4
  406. @end example
  407. To send a stream in realtime to a RTSP server, for others to watch:
  408. @example
  409. ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  410. @end example
  411. To receive a stream in realtime:
  412. @example
  413. ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
  414. @end example
  415. @table @option
  416. @item stimeout
  417. Socket IO timeout in micro seconds.
  418. @end table
  419. @section sap
  420. Session Announcement Protocol (RFC 2974). This is not technically a
  421. protocol handler in libavformat, it is a muxer and demuxer.
  422. It is used for signalling of RTP streams, by announcing the SDP for the
  423. streams regularly on a separate port.
  424. @subsection Muxer
  425. The syntax for a SAP url given to the muxer is:
  426. @example
  427. sap://@var{destination}[:@var{port}][?@var{options}]
  428. @end example
  429. The RTP packets are sent to @var{destination} on port @var{port},
  430. or to port 5004 if no port is specified.
  431. @var{options} is a @code{&}-separated list. The following options
  432. are supported:
  433. @table @option
  434. @item announce_addr=@var{address}
  435. Specify the destination IP address for sending the announcements to.
  436. If omitted, the announcements are sent to the commonly used SAP
  437. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  438. ff0e::2:7ffe if @var{destination} is an IPv6 address.
  439. @item announce_port=@var{port}
  440. Specify the port to send the announcements on, defaults to
  441. 9875 if not specified.
  442. @item ttl=@var{ttl}
  443. Specify the time to live value for the announcements and RTP packets,
  444. defaults to 255.
  445. @item same_port=@var{0|1}
  446. If set to 1, send all RTP streams on the same port pair. If zero (the
  447. default), all streams are sent on unique ports, with each stream on a
  448. port 2 numbers higher than the previous.
  449. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  450. The RTP stack in libavformat for receiving requires all streams to be sent
  451. on unique ports.
  452. @end table
  453. Example command lines follow.
  454. To broadcast a stream on the local subnet, for watching in VLC:
  455. @example
  456. ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
  457. @end example
  458. Similarly, for watching in @command{ffplay}:
  459. @example
  460. ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
  461. @end example
  462. And for watching in @command{ffplay}, over IPv6:
  463. @example
  464. ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
  465. @end example
  466. @subsection Demuxer
  467. The syntax for a SAP url given to the demuxer is:
  468. @example
  469. sap://[@var{address}][:@var{port}]
  470. @end example
  471. @var{address} is the multicast address to listen for announcements on,
  472. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port}
  473. is the port that is listened on, 9875 if omitted.
  474. The demuxers listens for announcements on the given address and port.
  475. Once an announcement is received, it tries to receive that particular stream.
  476. Example command lines follow.
  477. To play back the first stream announced on the normal SAP multicast address:
  478. @example
  479. ffplay sap://
  480. @end example
  481. To play back the first stream announced on one the default IPv6 SAP multicast address:
  482. @example
  483. ffplay sap://[ff0e::2:7ffe]
  484. @end example
  485. @section tcp
  486. Trasmission Control Protocol.
  487. The required syntax for a TCP url is:
  488. @example
  489. tcp://@var{hostname}:@var{port}[?@var{options}]
  490. @end example
  491. @table @option
  492. @item listen
  493. Listen for an incoming connection
  494. @item timeout=@var{microseconds}
  495. In read mode: if no data arrived in more than this time interval, raise error.
  496. In write mode: if socket cannot be written in more than this time interval, raise error.
  497. This also sets timeout on TCP connection establishing.
  498. @example
  499. ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
  500. ffplay tcp://@var{hostname}:@var{port}
  501. @end example
  502. @end table
  503. @section tls
  504. Transport Layer Security/Secure Sockets Layer
  505. The required syntax for a TLS/SSL url is:
  506. @example
  507. tls://@var{hostname}:@var{port}[?@var{options}]
  508. @end example
  509. @table @option
  510. @item listen
  511. Act as a server, listening for an incoming connection.
  512. @item cafile=@var{filename}
  513. Certificate authority file. The file must be in OpenSSL PEM format.
  514. @item cert=@var{filename}
  515. Certificate file. The file must be in OpenSSL PEM format.
  516. @item key=@var{filename}
  517. Private key file.
  518. @item verify=@var{0|1}
  519. Verify the peer's certificate.
  520. @end table
  521. Example command lines:
  522. To create a TLS/SSL server that serves an input stream.
  523. @example
  524. ffmpeg -i @var{input} -f @var{format} tls://@var{hostname}:@var{port}?listen&cert=@var{server.crt}&key=@var{server.key}
  525. @end example
  526. To play back a stream from the TLS/SSL server using @command{ffplay}:
  527. @example
  528. ffplay tls://@var{hostname}:@var{port}
  529. @end example
  530. @section udp
  531. User Datagram Protocol.
  532. The required syntax for a UDP url is:
  533. @example
  534. udp://@var{hostname}:@var{port}[?@var{options}]
  535. @end example
  536. @var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
  537. In case threading is enabled on the system, a circular buffer is used
  538. to store the incoming data, which allows to reduce loss of data due to
  539. UDP socket buffer overruns. The @var{fifo_size} and
  540. @var{overrun_nonfatal} options are related to this buffer.
  541. The list of supported options follows.
  542. @table @option
  543. @item buffer_size=@var{size}
  544. Set the UDP socket buffer size in bytes. This is used both for the
  545. receiving and the sending buffer size.
  546. @item localport=@var{port}
  547. Override the local UDP port to bind with.
  548. @item localaddr=@var{addr}
  549. Choose the local IP address. This is useful e.g. if sending multicast
  550. and the host has multiple interfaces, where the user can choose
  551. which interface to send on by specifying the IP address of that interface.
  552. @item pkt_size=@var{size}
  553. Set the size in bytes of UDP packets.
  554. @item reuse=@var{1|0}
  555. Explicitly allow or disallow reusing UDP sockets.
  556. @item ttl=@var{ttl}
  557. Set the time to live value (for multicast only).
  558. @item connect=@var{1|0}
  559. Initialize the UDP socket with @code{connect()}. In this case, the
  560. destination address can't be changed with ff_udp_set_remote_url later.
  561. If the destination address isn't known at the start, this option can
  562. be specified in ff_udp_set_remote_url, too.
  563. This allows finding out the source address for the packets with getsockname,
  564. and makes writes return with AVERROR(ECONNREFUSED) if "destination
  565. unreachable" is received.
  566. For receiving, this gives the benefit of only receiving packets from
  567. the specified peer address/port.
  568. @item sources=@var{address}[,@var{address}]
  569. Only receive packets sent to the multicast group from one of the
  570. specified sender IP addresses.
  571. @item block=@var{address}[,@var{address}]
  572. Ignore packets sent to the multicast group from the specified
  573. sender IP addresses.
  574. @item fifo_size=@var{units}
  575. Set the UDP receiving circular buffer size, expressed as a number of
  576. packets with size of 188 bytes. If not specified defaults to 7*4096.
  577. @item overrun_nonfatal=@var{1|0}
  578. Survive in case of UDP receiving circular buffer overrun. Default
  579. value is 0.
  580. @item timeout=@var{microseconds}
  581. In read mode: if no data arrived in more than this time interval, raise error.
  582. @end table
  583. Some usage examples of the UDP protocol with @command{ffmpeg} follow.
  584. To stream over UDP to a remote endpoint:
  585. @example
  586. ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
  587. @end example
  588. To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
  589. @example
  590. ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
  591. @end example
  592. To receive over UDP from a remote endpoint:
  593. @example
  594. ffmpeg -i udp://[@var{multicast-address}]:@var{port}
  595. @end example
  596. @c man end PROTOCOLS