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.

791 lines
23KB

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