Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. =encoding utf8
  2.  
  3. =head1 NAME
  4.  
  5. ffmpeg-protocols - FFmpeg protocols
  6.  
  7. =head1 DESCRIPTION
  8.  
  9.  
  10. This document describes the input and output protocols provided by the
  11. libavformat library.
  12.  
  13.  
  14.  
  15. =head1 PROTOCOLS
  16.  
  17.  
  18. Protocols are configured elements in FFmpeg that enable access to
  19. resources that require specific protocols.
  20.  
  21. When you configure your FFmpeg build, all the supported protocols are
  22. enabled by default. You can list all available ones using the
  23. configure option "--list-protocols".
  24.  
  25. You can disable all the protocols using the configure option
  26. "--disable-protocols", and selectively enable a protocol using the
  27. option "--enable-protocol=I<PROTOCOL>", or you can disable a
  28. particular protocol using the option
  29. "--disable-protocol=I<PROTOCOL>".
  30.  
  31. The option "-protocols" of the ff* tools will display the list of
  32. supported protocols.
  33.  
  34. A description of the currently available protocols follows.
  35.  
  36.  
  37. =head2 async
  38.  
  39.  
  40. Asynchronous data filling wrapper for input stream.
  41.  
  42. Fill data in a background thread, to decouple I/O operation from demux thread.
  43.  
  44.        
  45.         async:<URL>
  46.         async:http://host/resource
  47.         async:cache:http://host/resource
  48.  
  49.  
  50.  
  51. =head2 bluray
  52.  
  53.  
  54. Read BluRay playlist.
  55.  
  56. The accepted options are:
  57.  
  58. =over 4
  59.  
  60.  
  61.  
  62. =item B<angle>
  63.  
  64. BluRay angle
  65.  
  66.  
  67. =item B<chapter>
  68.  
  69. Start chapter (1...N)
  70.  
  71.  
  72. =item B<playlist>
  73.  
  74. Playlist to read (BDMV/PLAYLIST/?????.mpls)
  75.  
  76.  
  77. =back
  78.  
  79.  
  80. Examples:
  81.  
  82. Read longest playlist from BluRay mounted to /mnt/bluray:
  83.        
  84.         bluray:/mnt/bluray
  85.  
  86.  
  87. Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  88.        
  89.         -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  90.  
  91.  
  92.  
  93. =head2 cache
  94.  
  95.  
  96. Caching wrapper for input stream.
  97.  
  98. Cache the input stream to temporary file. It brings seeking capability to live streams.
  99.  
  100.        
  101.         cache:<URL>
  102.  
  103.  
  104.  
  105. =head2 concat
  106.  
  107.  
  108. Physical concatenation protocol.
  109.  
  110. Read and seek from many resources in sequence as if they were
  111. a unique resource.
  112.  
  113. A URL accepted by this protocol has the syntax:
  114.        
  115.         concat:<URL1>|<URL2>|...|<URLN>
  116.  
  117.  
  118. where I<URL1>, I<URL2>, ..., I<URLN> are the urls of the
  119. resource to be concatenated, each one possibly specifying a distinct
  120. protocol.
  121.  
  122. For example to read a sequence of files F<split1.mpeg>,
  123. F<split2.mpeg>, F<split3.mpeg> with B<ffplay> use the
  124. command:
  125.        
  126.         ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  127.  
  128.  
  129. Note that you may need to escape the character "|" which is special for
  130. many shells.
  131.  
  132.  
  133. =head2 crypto
  134.  
  135.  
  136. AES-encrypted stream reading protocol.
  137.  
  138. The accepted options are:
  139.  
  140. =over 4
  141.  
  142.  
  143. =item B<key>
  144.  
  145. Set the AES decryption key binary block from given hexadecimal representation.
  146.  
  147.  
  148. =item B<iv>
  149.  
  150. Set the AES decryption initialization vector binary block from given hexadecimal representation.
  151.  
  152. =back
  153.  
  154.  
  155. Accepted URL formats:
  156.        
  157.         crypto:<URL>
  158.         crypto+<URL>
  159.  
  160.  
  161.  
  162. =head2 data
  163.  
  164.  
  165. Data in-line in the URI. See E<lt>B<http://en.wikipedia.org/wiki/Data_URI_scheme>E<gt>.
  166.  
  167. For example, to convert a GIF file given inline with B<ffmpeg>:
  168.        
  169.         ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
  170.  
  171.  
  172.  
  173. =head2 file
  174.  
  175.  
  176. File access protocol.
  177.  
  178. Read from or write to a file.
  179.  
  180. A file URL can have the form:
  181.        
  182.         file:<filename>
  183.  
  184.  
  185. where I<filename> is the path of the file to read.
  186.  
  187. An URL that does not have a protocol prefix will be assumed to be a
  188. file URL. Depending on the build, an URL that looks like a Windows
  189. path with the drive letter at the beginning will also be assumed to be
  190. a file URL (usually not the case in builds for unix-like systems).
  191.  
  192. For example to read from a file F<input.mpeg> with B<ffmpeg>
  193. use the command:
  194.        
  195.         ffmpeg -i file:input.mpeg output.mpeg
  196.  
  197.  
  198. This protocol accepts the following options:
  199.  
  200.  
  201. =over 4
  202.  
  203.  
  204. =item B<truncate>
  205.  
  206. Truncate existing files on write, if set to 1. A value of 0 prevents
  207. truncating. Default value is 1.
  208.  
  209.  
  210. =item B<blocksize>
  211.  
  212. Set I/O operation maximum block size, in bytes. Default value is
  213. C<INT_MAX>, which results in not limiting the requested block size.
  214. Setting this value reasonably low improves user termination request reaction
  215. time, which is valuable for files on slow medium.
  216.  
  217. =back
  218.  
  219.  
  220.  
  221. =head2 ftp
  222.  
  223.  
  224. FTP (File Transfer Protocol).
  225.  
  226. Read from or write to remote resources using FTP protocol.
  227.  
  228. Following syntax is required.
  229.        
  230.         ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  231.  
  232.  
  233. This protocol accepts the following options.
  234.  
  235.  
  236. =over 4
  237.  
  238.  
  239. =item B<timeout>
  240.  
  241. Set timeout in microseconds of socket I/O operations used by the underlying low level
  242. operation. By default it is set to -1, which means that the timeout is
  243. not specified.
  244.  
  245.  
  246. =item B<ftp-anonymous-password>
  247.  
  248. Password used when login as anonymous user. Typically an e-mail address
  249. should be used.
  250.  
  251.  
  252. =item B<ftp-write-seekable>
  253.  
  254. Control seekability of connection during encoding. If set to 1 the
  255. resource is supposed to be seekable, if set to 0 it is assumed not
  256. to be seekable. Default value is 0.
  257.  
  258. =back
  259.  
  260.  
  261. NOTE: Protocol can be used as output, but it is recommended to not do
  262. it, unless special care is taken (tests, customized server configuration
  263. etc.). Different FTP servers behave in different way during seek
  264. operation. ff* tools may produce incomplete content due to server limitations.
  265.  
  266.  
  267. =head2 gopher
  268.  
  269.  
  270. Gopher protocol.
  271.  
  272.  
  273. =head2 hls
  274.  
  275.  
  276. Read Apple HTTP Live Streaming compliant segmented stream as
  277. a uniform one. The M3U8 playlists describing the segments can be
  278. remote HTTP resources or local files, accessed using the standard
  279. file protocol.
  280. The nested protocol is declared by specifying
  281. "+I<proto>" after the hls URI scheme name, where I<proto>
  282. is either "file" or "http".
  283.  
  284.        
  285.         hls+http://host/path/to/remote/resource.m3u8
  286.         hls+file://path/to/local/resource.m3u8
  287.  
  288.  
  289. Using this protocol is discouraged - the hls demuxer should work
  290. just as well (if not, please report the issues) and is more complete.
  291. To use the hls demuxer instead, simply use the direct URLs to the
  292. m3u8 files.
  293.  
  294.  
  295. =head2 http
  296.  
  297.  
  298. HTTP (Hyper Text Transfer Protocol).
  299.  
  300. This protocol accepts the following options:
  301.  
  302.  
  303. =over 4
  304.  
  305.  
  306. =item B<seekable>
  307.  
  308. Control seekability of connection. If set to 1 the resource is
  309. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  310. if set to -1 it will try to autodetect if it is seekable. Default
  311. value is -1.
  312.  
  313.  
  314. =item B<chunked_post>
  315.  
  316. If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  317.  
  318.  
  319. =item B<content_type>
  320.  
  321. Set a specific content type for the POST messages.
  322.  
  323.  
  324. =item B<headers>
  325.  
  326. Set custom HTTP headers, can override built in default headers. The
  327. value must be a string encoding the headers.
  328.  
  329.  
  330. =item B<multiple_requests>
  331.  
  332. Use persistent connections if set to 1, default is 0.
  333.  
  334.  
  335. =item B<post_data>
  336.  
  337. Set custom HTTP post data.
  338.  
  339.  
  340. =item B<user-agent>
  341.  
  342.  
  343. =item B<user_agent>
  344.  
  345. Override the User-Agent header. If not specified the protocol will use a
  346. string describing the libavformat build. ("Lavf/E<lt>versionE<gt>")
  347.  
  348.  
  349. =item B<timeout>
  350.  
  351. Set timeout in microseconds of socket I/O operations used by the underlying low level
  352. operation. By default it is set to -1, which means that the timeout is
  353. not specified.
  354.  
  355.  
  356. =item B<mime_type>
  357.  
  358. Export the MIME type.
  359.  
  360.  
  361. =item B<icy>
  362.  
  363. If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  364. supports this, the metadata has to be retrieved by the application by reading
  365. the B<icy_metadata_headers> and B<icy_metadata_packet> options.
  366. The default is 1.
  367.  
  368.  
  369. =item B<icy_metadata_headers>
  370.  
  371. If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  372. headers, separated by newline characters.
  373.  
  374.  
  375. =item B<icy_metadata_packet>
  376.  
  377. If the server supports ICY metadata, and B<icy> was set to 1, this
  378. contains the last non-empty metadata packet sent by the server. It should be
  379. polled in regular intervals by applications interested in mid-stream metadata
  380. updates.
  381.  
  382.  
  383. =item B<cookies>
  384.  
  385. Set the cookies to be sent in future requests. The format of each cookie is the
  386. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  387. delimited by a newline character.
  388.  
  389.  
  390. =item B<offset>
  391.  
  392. Set initial byte offset.
  393.  
  394.  
  395. =item B<end_offset>
  396.  
  397. Try to limit the request to bytes preceding this offset.
  398.  
  399.  
  400. =item B<method>
  401.  
  402. When used as a client option it sets the HTTP method for the request.
  403.  
  404. When used as a server option it sets the HTTP method that is going to be
  405. expected from the client(s).
  406. If the expected and the received HTTP method do not match the client will
  407. be given a Bad Request response.
  408. When unset the HTTP method is not checked for now. This will be replaced by
  409. autodetection in the future.
  410.  
  411.  
  412. =item B<listen>
  413.  
  414. If set to 1 enables experimental HTTP server. This can be used to send data when
  415. used as an output option, or read data from a client with HTTP POST when used as
  416. an input option.
  417. If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented
  418. in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
  419.        
  420.         # Server side (sending):
  421.         ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<server>:<port>
  422.        
  423.         # Client side (receiving):
  424.         ffmpeg -i http://<server>:<port> -c copy somefile.ogg
  425.        
  426.         # Client can also be done with wget:
  427.         wget http://<server>:<port> -O somefile.ogg
  428.        
  429.         # Server side (receiving):
  430.         ffmpeg -listen 1 -i http://<server>:<port> -c copy somefile.ogg
  431.        
  432.         # Client side (sending):
  433.         ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<server>:<port>
  434.        
  435.         # Client can also be done with wget:
  436.         wget --post-file=somefile.ogg http://<server>:<port>
  437.  
  438.  
  439.  
  440. =back
  441.  
  442.  
  443.  
  444. =head3 HTTP Cookies
  445.  
  446.  
  447. Some HTTP requests will be denied unless cookie values are passed in with the
  448. request. The B<cookies> option allows these cookies to be specified. At
  449. the very least, each cookie must specify a value along with a path and domain.
  450. HTTP requests that match both the domain and path will automatically include the
  451. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  452. by a newline.
  453.  
  454. The required syntax to play a stream specifying a cookie is:
  455.        
  456.         ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
  457.  
  458.  
  459.  
  460. =head2 Icecast
  461.  
  462.  
  463. Icecast protocol (stream to Icecast servers)
  464.  
  465. This protocol accepts the following options:
  466.  
  467.  
  468. =over 4
  469.  
  470.  
  471. =item B<ice_genre>
  472.  
  473. Set the stream genre.
  474.  
  475.  
  476. =item B<ice_name>
  477.  
  478. Set the stream name.
  479.  
  480.  
  481. =item B<ice_description>
  482.  
  483. Set the stream description.
  484.  
  485.  
  486. =item B<ice_url>
  487.  
  488. Set the stream website URL.
  489.  
  490.  
  491. =item B<ice_public>
  492.  
  493. Set if the stream should be public.
  494. The default is 0 (not public).
  495.  
  496.  
  497. =item B<user_agent>
  498.  
  499. Override the User-Agent header. If not specified a string of the form
  500. "Lavf/E<lt>versionE<gt>" will be used.
  501.  
  502.  
  503. =item B<password>
  504.  
  505. Set the Icecast mountpoint password.
  506.  
  507.  
  508. =item B<content_type>
  509.  
  510. Set the stream content type. This must be set if it is different from
  511. audio/mpeg.
  512.  
  513.  
  514. =item B<legacy_icecast>
  515.  
  516. This enables support for Icecast versions E<lt> 2.4.0, that do not support the
  517. HTTP PUT method but the SOURCE method.
  518.  
  519.  
  520. =back
  521.  
  522.  
  523.        
  524.         icecast://[<username>[:<password>]@]<server>:<port>/<mountpoint>
  525.  
  526.  
  527.  
  528. =head2 mmst
  529.  
  530.  
  531. MMS (Microsoft Media Server) protocol over TCP.
  532.  
  533.  
  534. =head2 mmsh
  535.  
  536.  
  537. MMS (Microsoft Media Server) protocol over HTTP.
  538.  
  539. The required syntax is:
  540.        
  541.         mmsh://<server>[:<port>][/<app>][/<playpath>]
  542.  
  543.  
  544.  
  545. =head2 md5
  546.  
  547.  
  548. MD5 output protocol.
  549.  
  550. Computes the MD5 hash of the data to be written, and on close writes
  551. this to the designated output or stdout if none is specified. It can
  552. be used to test muxers without writing an actual file.
  553.  
  554. Some examples follow.
  555.        
  556.         # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  557.         ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  558.        
  559.         # Write the MD5 hash of the encoded AVI file to stdout.
  560.         ffmpeg -i input.flv -f avi -y md5:
  561.  
  562.  
  563. Note that some formats (typically MOV) require the output protocol to
  564. be seekable, so they will fail with the MD5 output protocol.
  565.  
  566.  
  567. =head2 pipe
  568.  
  569.  
  570. UNIX pipe access protocol.
  571.  
  572. Read and write from UNIX pipes.
  573.  
  574. The accepted syntax is:
  575.        
  576.         pipe:[<number>]
  577.  
  578.  
  579. I<number> is the number corresponding to the file descriptor of the
  580. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If I<number>
  581. is not specified, by default the stdout file descriptor will be used
  582. for writing, stdin for reading.
  583.  
  584. For example to read from stdin with B<ffmpeg>:
  585.        
  586.         cat test.wav | ffmpeg -i pipe:0
  587.         # ...this is the same as...
  588.         cat test.wav | ffmpeg -i pipe:
  589.  
  590.  
  591. For writing to stdout with B<ffmpeg>:
  592.        
  593.         ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
  594.         # ...this is the same as...
  595.         ffmpeg -i test.wav -f avi pipe: | cat > test.avi
  596.  
  597.  
  598. This protocol accepts the following options:
  599.  
  600.  
  601. =over 4
  602.  
  603.  
  604. =item B<blocksize>
  605.  
  606. Set I/O operation maximum block size, in bytes. Default value is
  607. C<INT_MAX>, which results in not limiting the requested block size.
  608. Setting this value reasonably low improves user termination request reaction
  609. time, which is valuable if data transmission is slow.
  610.  
  611. =back
  612.  
  613.  
  614. Note that some formats (typically MOV), require the output protocol to
  615. be seekable, so they will fail with the pipe output protocol.
  616.  
  617.  
  618. =head2 rtmp
  619.  
  620.  
  621. Real-Time Messaging Protocol.
  622.  
  623. The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  624. content across a TCP/IP network.
  625.  
  626. The required syntax is:
  627.        
  628.         rtmp://[<username>:<password>@]<server>[:<port>][/<app>][/<instance>][/<playpath>]
  629.  
  630.  
  631. The accepted parameters are:
  632.  
  633. =over 4
  634.  
  635.  
  636.  
  637. =item B<username>
  638.  
  639. An optional username (mostly for publishing).
  640.  
  641.  
  642. =item B<password>
  643.  
  644. An optional password (mostly for publishing).
  645.  
  646.  
  647. =item B<server>
  648.  
  649. The address of the RTMP server.
  650.  
  651.  
  652. =item B<port>
  653.  
  654. The number of the TCP port to use (by default is 1935).
  655.  
  656.  
  657. =item B<app>
  658.  
  659. It is the name of the application to access. It usually corresponds to
  660. the path where the application is installed on the RTMP server
  661. (e.g. F</ondemand/>, F</flash/live/>, etc.). You can override
  662. the value parsed from the URI through the C<rtmp_app> option, too.
  663.  
  664.  
  665. =item B<playpath>
  666.  
  667. It is the path or name of the resource to play with reference to the
  668. application specified in I<app>, may be prefixed by "mp4:". You
  669. can override the value parsed from the URI through the C<rtmp_playpath>
  670. option, too.
  671.  
  672.  
  673. =item B<listen>
  674.  
  675. Act as a server, listening for an incoming connection.
  676.  
  677.  
  678. =item B<timeout>
  679.  
  680. Maximum time to wait for the incoming connection. Implies listen.
  681.  
  682. =back
  683.  
  684.  
  685. Additionally, the following parameters can be set via command line options
  686. (or in code via C<AVOption>s):
  687.  
  688. =over 4
  689.  
  690.  
  691.  
  692. =item B<rtmp_app>
  693.  
  694. Name of application to connect on the RTMP server. This option
  695. overrides the parameter specified in the URI.
  696.  
  697.  
  698. =item B<rtmp_buffer>
  699.  
  700. Set the client buffer time in milliseconds. The default is 3000.
  701.  
  702.  
  703. =item B<rtmp_conn>
  704.  
  705. Extra arbitrary AMF connection parameters, parsed from a string,
  706. e.g. like C<B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0>.
  707. Each value is prefixed by a single character denoting the type,
  708. B for Boolean, N for number, S for string, O for object, or Z for null,
  709. followed by a colon. For Booleans the data must be either 0 or 1 for
  710. FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
  711. 1 to end or begin an object, respectively. Data items in subobjects may
  712. be named, by prefixing the type with 'N' and specifying the name before
  713. the value (i.e. C<NB:myFlag:1>). This option may be used multiple
  714. times to construct arbitrary AMF sequences.
  715.  
  716.  
  717. =item B<rtmp_flashver>
  718.  
  719. Version of the Flash plugin used to run the SWF player. The default
  720. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  721. E<lt>libavformat versionE<gt>).)
  722.  
  723.  
  724. =item B<rtmp_flush_interval>
  725.  
  726. Number of packets flushed in the same request (RTMPT only). The default
  727. is 10.
  728.  
  729.  
  730. =item B<rtmp_live>
  731.  
  732. Specify that the media is a live stream. No resuming or seeking in
  733. live streams is possible. The default value is C<any>, which means the
  734. subscriber first tries to play the live stream specified in the
  735. playpath. If a live stream of that name is not found, it plays the
  736. recorded stream. The other possible values are C<live> and
  737. C<recorded>.
  738.  
  739.  
  740. =item B<rtmp_pageurl>
  741.  
  742. URL of the web page in which the media was embedded. By default no
  743. value will be sent.
  744.  
  745.  
  746. =item B<rtmp_playpath>
  747.  
  748. Stream identifier to play or to publish. This option overrides the
  749. parameter specified in the URI.
  750.  
  751.  
  752. =item B<rtmp_subscribe>
  753.  
  754. Name of live stream to subscribe to. By default no value will be sent.
  755. It is only sent if the option is specified or if rtmp_live
  756. is set to live.
  757.  
  758.  
  759. =item B<rtmp_swfhash>
  760.  
  761. SHA256 hash of the decompressed SWF file (32 bytes).
  762.  
  763.  
  764. =item B<rtmp_swfsize>
  765.  
  766. Size of the decompressed SWF file, required for SWFVerification.
  767.  
  768.  
  769. =item B<rtmp_swfurl>
  770.  
  771. URL of the SWF player for the media. By default no value will be sent.
  772.  
  773.  
  774. =item B<rtmp_swfverify>
  775.  
  776. URL to player swf file, compute hash/size automatically.
  777.  
  778.  
  779. =item B<rtmp_tcurl>
  780.  
  781. URL of the target stream. Defaults to proto://host[:port]/app.
  782.  
  783.  
  784. =back
  785.  
  786.  
  787. For example to read with B<ffplay> a multimedia resource named
  788. "sample" from the application "vod" from an RTMP server "myserver":
  789.        
  790.         ffplay rtmp://myserver/vod/sample
  791.  
  792.  
  793. To publish to a password protected server, passing the playpath and
  794. app names separately:
  795.        
  796.         ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
  797.  
  798.  
  799.  
  800. =head2 rtmpe
  801.  
  802.  
  803. Encrypted Real-Time Messaging Protocol.
  804.  
  805. The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  806. streaming multimedia content within standard cryptographic primitives,
  807. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  808. a pair of RC4 keys.
  809.  
  810.  
  811. =head2 rtmps
  812.  
  813.  
  814. Real-Time Messaging Protocol over a secure SSL connection.
  815.  
  816. The Real-Time Messaging Protocol (RTMPS) is used for streaming
  817. multimedia content across an encrypted connection.
  818.  
  819.  
  820. =head2 rtmpt
  821.  
  822.  
  823. Real-Time Messaging Protocol tunneled through HTTP.
  824.  
  825. The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  826. for streaming multimedia content within HTTP requests to traverse
  827. firewalls.
  828.  
  829.  
  830. =head2 rtmpte
  831.  
  832.  
  833. Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  834.  
  835. The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  836. is used for streaming multimedia content within HTTP requests to traverse
  837. firewalls.
  838.  
  839.  
  840. =head2 rtmpts
  841.  
  842.  
  843. Real-Time Messaging Protocol tunneled through HTTPS.
  844.  
  845. The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  846. for streaming multimedia content within HTTPS requests to traverse
  847. firewalls.
  848.  
  849.  
  850. =head2 libsmbclient
  851.  
  852.  
  853. libsmbclient permits one to manipulate CIFS/SMB network resources.
  854.  
  855. Following syntax is required.
  856.  
  857.        
  858.         smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  859.  
  860.  
  861. This protocol accepts the following options.
  862.  
  863.  
  864. =over 4
  865.  
  866.  
  867. =item B<timeout>
  868.  
  869. Set timeout in miliseconds of socket I/O operations used by the underlying
  870. low level operation. By default it is set to -1, which means that the timeout
  871. is not specified.
  872.  
  873.  
  874. =item B<truncate>
  875.  
  876. Truncate existing files on write, if set to 1. A value of 0 prevents
  877. truncating. Default value is 1.
  878.  
  879.  
  880. =item B<workgroup>
  881.  
  882. Set the workgroup used for making connections. By default workgroup is not specified.
  883.  
  884.  
  885. =back
  886.  
  887.  
  888. For more information see: E<lt>B<http://www.samba.org/>E<gt>.
  889.  
  890.  
  891. =head2 libssh
  892.  
  893.  
  894. Secure File Transfer Protocol via libssh
  895.  
  896. Read from or write to remote resources using SFTP protocol.
  897.  
  898. Following syntax is required.
  899.  
  900.        
  901.         sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  902.  
  903.  
  904. This protocol accepts the following options.
  905.  
  906.  
  907. =over 4
  908.  
  909.  
  910. =item B<timeout>
  911.  
  912. Set timeout of socket I/O operations used by the underlying low level
  913. operation. By default it is set to -1, which means that the timeout
  914. is not specified.
  915.  
  916.  
  917. =item B<truncate>
  918.  
  919. Truncate existing files on write, if set to 1. A value of 0 prevents
  920. truncating. Default value is 1.
  921.  
  922.  
  923. =item B<private_key>
  924.  
  925. Specify the path of the file containing private key to use during authorization.
  926. By default libssh searches for keys in the F<~/.ssh/> directory.
  927.  
  928.  
  929. =back
  930.  
  931.  
  932. Example: Play a file stored on remote server.
  933.  
  934.        
  935.         ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  936.  
  937.  
  938.  
  939. =head2 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
  940.  
  941.  
  942. Real-Time Messaging Protocol and its variants supported through
  943. librtmp.
  944.  
  945. Requires the presence of the librtmp headers and library during
  946. configuration. You need to explicitly configure the build with
  947. "--enable-librtmp". If enabled this will replace the native RTMP
  948. protocol.
  949.  
  950. This protocol provides most client functions and a few server
  951. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  952. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  953. variants of these encrypted types (RTMPTE, RTMPTS).
  954.  
  955. The required syntax is:
  956.        
  957.         <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
  958.  
  959.  
  960. where I<rtmp_proto> is one of the strings "rtmp", "rtmpt", "rtmpe",
  961. "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
  962. I<server>, I<port>, I<app> and I<playpath> have the same
  963. meaning as specified for the RTMP native protocol.
  964. I<options> contains a list of space-separated options of the form
  965. I<key>=I<val>.
  966.  
  967. See the librtmp manual page (man 3 librtmp) for more information.
  968.  
  969. For example, to stream a file in real-time to an RTMP server using
  970. B<ffmpeg>:
  971.        
  972.         ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  973.  
  974.  
  975. To play the same stream using B<ffplay>:
  976.        
  977.         ffplay "rtmp://myserver/live/mystream live=1"
  978.  
  979.  
  980.  
  981. =head2 rtp
  982.  
  983.  
  984. Real-time Transport Protocol.
  985.  
  986. The required syntax for an RTP URL is:
  987. rtp://I<hostname>[:I<port>][?I<option>=I<val>...]
  988.  
  989. I<port> specifies the RTP port to use.
  990.  
  991. The following URL options are supported:
  992.  
  993.  
  994. =over 4
  995.  
  996.  
  997.  
  998. =item B<ttl=>I<n>
  999.  
  1000. Set the TTL (Time-To-Live) value (for multicast only).
  1001.  
  1002.  
  1003. =item B<rtcpport=>I<n>
  1004.  
  1005. Set the remote RTCP port to I<n>.
  1006.  
  1007.  
  1008. =item B<localrtpport=>I<n>
  1009.  
  1010. Set the local RTP port to I<n>.
  1011.  
  1012.  
  1013. =item B<localrtcpport=>I<n>B<'>
  1014.  
  1015. Set the local RTCP port to I<n>.
  1016.  
  1017.  
  1018. =item B<pkt_size=>I<n>
  1019.  
  1020. Set max packet size (in bytes) to I<n>.
  1021.  
  1022.  
  1023. =item B<connect=0|1>
  1024.  
  1025. Do a C<connect()> on the UDP socket (if set to 1) or not (if set
  1026. to 0).
  1027.  
  1028.  
  1029. =item B<sources=>I<ip>B<[,>I<ip>B<]>
  1030.  
  1031. List allowed source IP addresses.
  1032.  
  1033.  
  1034. =item B<block=>I<ip>B<[,>I<ip>B<]>
  1035.  
  1036. List disallowed (blocked) source IP addresses.
  1037.  
  1038.  
  1039. =item B<write_to_source=0|1>
  1040.  
  1041. Send packets to the source address of the latest received packet (if
  1042. set to 1) or to a default remote address (if set to 0).
  1043.  
  1044.  
  1045. =item B<localport=>I<n>
  1046.  
  1047. Set the local RTP port to I<n>.
  1048.  
  1049. This is a deprecated option. Instead, B<localrtpport> should be
  1050. used.
  1051.  
  1052.  
  1053. =back
  1054.  
  1055.  
  1056. Important notes:
  1057.  
  1058.  
  1059. =over 4
  1060.  
  1061.  
  1062.  
  1063. =item 1.
  1064.  
  1065. If B<rtcpport> is not set the RTCP port will be set to the RTP
  1066. port value plus 1.
  1067.  
  1068.  
  1069. =item 2.
  1070.  
  1071. If B<localrtpport> (the local RTP port) is not set any available
  1072. port will be used for the local RTP and RTCP ports.
  1073.  
  1074.  
  1075. =item 3.
  1076.  
  1077. If B<localrtcpport> (the local RTCP port) is not set it will be
  1078. set to the local RTP port value plus 1.
  1079.  
  1080. =back
  1081.  
  1082.  
  1083.  
  1084. =head2 rtsp
  1085.  
  1086.  
  1087. Real-Time Streaming Protocol.
  1088.  
  1089. RTSP is not technically a protocol handler in libavformat, it is a demuxer
  1090. and muxer. The demuxer supports both normal RTSP (with data transferred
  1091. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  1092. data transferred over RDT).
  1093.  
  1094. The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  1095. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
  1096. E<lt>B<https://github.com/revmischa/rtsp-server>E<gt>).
  1097.  
  1098. The required syntax for a RTSP url is:
  1099.        
  1100.         rtsp://<hostname>[:<port>]/<path>
  1101.  
  1102.  
  1103. Options can be set on the B<ffmpeg>/B<ffplay> command
  1104. line, or set in code via C<AVOption>s or in
  1105. C<avformat_open_input>.
  1106.  
  1107. The following options are supported.
  1108.  
  1109.  
  1110. =over 4
  1111.  
  1112.  
  1113. =item B<initial_pause>
  1114.  
  1115. Do not start playing the stream immediately if set to 1. Default value
  1116. is 0.
  1117.  
  1118.  
  1119. =item B<rtsp_transport>
  1120.  
  1121. Set RTSP transport protocols.
  1122.  
  1123. It accepts the following values:
  1124.  
  1125. =over 4
  1126.  
  1127.  
  1128. =item B<udp>
  1129.  
  1130. Use UDP as lower transport protocol.
  1131.  
  1132.  
  1133. =item B<tcp>
  1134.  
  1135. Use TCP (interleaving within the RTSP control channel) as lower
  1136. transport protocol.
  1137.  
  1138.  
  1139. =item B<udp_multicast>
  1140.  
  1141. Use UDP multicast as lower transport protocol.
  1142.  
  1143.  
  1144. =item B<http>
  1145.  
  1146. Use HTTP tunneling as lower transport protocol, which is useful for
  1147. passing proxies.
  1148.  
  1149. =back
  1150.  
  1151.  
  1152. Multiple lower transport protocols may be specified, in that case they are
  1153. tried one at a time (if the setup of one fails, the next one is tried).
  1154. For the muxer, only the B<tcp> and B<udp> options are supported.
  1155.  
  1156.  
  1157. =item B<rtsp_flags>
  1158.  
  1159. Set RTSP flags.
  1160.  
  1161. The following values are accepted:
  1162.  
  1163. =over 4
  1164.  
  1165.  
  1166. =item B<filter_src>
  1167.  
  1168. Accept packets only from negotiated peer address and port.
  1169.  
  1170. =item B<listen>
  1171.  
  1172. Act as a server, listening for an incoming connection.
  1173.  
  1174. =item B<prefer_tcp>
  1175.  
  1176. Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  1177.  
  1178. =back
  1179.  
  1180.  
  1181. Default value is B<none>.
  1182.  
  1183.  
  1184. =item B<allowed_media_types>
  1185.  
  1186. Set media types to accept from the server.
  1187.  
  1188. The following flags are accepted:
  1189.  
  1190. =over 4
  1191.  
  1192.  
  1193. =item B<video>
  1194.  
  1195.  
  1196. =item B<audio>
  1197.  
  1198.  
  1199. =item B<data>
  1200.  
  1201.  
  1202. =back
  1203.  
  1204.  
  1205. By default it accepts all media types.
  1206.  
  1207.  
  1208. =item B<min_port>
  1209.  
  1210. Set minimum local UDP port. Default value is 5000.
  1211.  
  1212.  
  1213. =item B<max_port>
  1214.  
  1215. Set maximum local UDP port. Default value is 65000.
  1216.  
  1217.  
  1218. =item B<timeout>
  1219.  
  1220. Set maximum timeout (in seconds) to wait for incoming connections.
  1221.  
  1222. A value of -1 means infinite (default). This option implies the
  1223. B<rtsp_flags> set to B<listen>.
  1224.  
  1225.  
  1226. =item B<reorder_queue_size>
  1227.  
  1228. Set number of packets to buffer for handling of reordered packets.
  1229.  
  1230.  
  1231. =item B<stimeout>
  1232.  
  1233. Set socket TCP I/O timeout in microseconds.
  1234.  
  1235.  
  1236. =item B<user-agent>
  1237.  
  1238. Override User-Agent header. If not specified, it defaults to the
  1239. libavformat identifier string.
  1240.  
  1241. =back
  1242.  
  1243.  
  1244. When receiving data over UDP, the demuxer tries to reorder received packets
  1245. (since they may arrive out of order, or packets may get lost totally). This
  1246. can be disabled by setting the maximum demuxing delay to zero (via
  1247. the C<max_delay> field of AVFormatContext).
  1248.  
  1249. When watching multi-bitrate Real-RTSP streams with B<ffplay>, the
  1250. streams to display can be chosen with C<-vst> I<n> and
  1251. C<-ast> I<n> for video and audio respectively, and can be switched
  1252. on the fly by pressing C<v> and C<a>.
  1253.  
  1254.  
  1255. =head3 Examples
  1256.  
  1257.  
  1258. The following examples all make use of the B<ffplay> and
  1259. B<ffmpeg> tools.
  1260.  
  1261.  
  1262. =over 4
  1263.  
  1264.  
  1265. =item *
  1266.  
  1267. Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  1268.        
  1269.         ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  1270.  
  1271.  
  1272.  
  1273. =item *
  1274.  
  1275. Watch a stream tunneled over HTTP:
  1276.        
  1277.         ffplay -rtsp_transport http rtsp://server/video.mp4
  1278.  
  1279.  
  1280.  
  1281. =item *
  1282.  
  1283. Send a stream in realtime to a RTSP server, for others to watch:
  1284.        
  1285.         ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  1286.  
  1287.  
  1288.  
  1289. =item *
  1290.  
  1291. Receive a stream in realtime:
  1292.        
  1293.         ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output>
  1294.  
  1295.  
  1296. =back
  1297.  
  1298.  
  1299.  
  1300. =head2 sap
  1301.  
  1302.  
  1303. Session Announcement Protocol (RFC 2974). This is not technically a
  1304. protocol handler in libavformat, it is a muxer and demuxer.
  1305. It is used for signalling of RTP streams, by announcing the SDP for the
  1306. streams regularly on a separate port.
  1307.  
  1308.  
  1309. =head3 Muxer
  1310.  
  1311.  
  1312. The syntax for a SAP url given to the muxer is:
  1313.        
  1314.         sap://<destination>[:<port>][?<options>]
  1315.  
  1316.  
  1317. The RTP packets are sent to I<destination> on port I<port>,
  1318. or to port 5004 if no port is specified.
  1319. I<options> is a C<&>-separated list. The following options
  1320. are supported:
  1321.  
  1322.  
  1323. =over 4
  1324.  
  1325.  
  1326.  
  1327. =item B<announce_addr=>I<address>
  1328.  
  1329. Specify the destination IP address for sending the announcements to.
  1330. If omitted, the announcements are sent to the commonly used SAP
  1331. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  1332. ff0e::2:7ffe if I<destination> is an IPv6 address.
  1333.  
  1334.  
  1335. =item B<announce_port=>I<port>
  1336.  
  1337. Specify the port to send the announcements on, defaults to
  1338. 9875 if not specified.
  1339.  
  1340.  
  1341. =item B<ttl=>I<ttl>
  1342.  
  1343. Specify the time to live value for the announcements and RTP packets,
  1344. defaults to 255.
  1345.  
  1346.  
  1347. =item B<same_port=>I<0|1>
  1348.  
  1349. If set to 1, send all RTP streams on the same port pair. If zero (the
  1350. default), all streams are sent on unique ports, with each stream on a
  1351. port 2 numbers higher than the previous.
  1352. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  1353. The RTP stack in libavformat for receiving requires all streams to be sent
  1354. on unique ports.
  1355.  
  1356. =back
  1357.  
  1358.  
  1359. Example command lines follow.
  1360.  
  1361. To broadcast a stream on the local subnet, for watching in VLC:
  1362.  
  1363.        
  1364.         ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1
  1365.  
  1366.  
  1367. Similarly, for watching in B<ffplay>:
  1368.  
  1369.        
  1370.         ffmpeg -re -i <input> -f sap sap://224.0.0.255
  1371.  
  1372.  
  1373. And for watching in B<ffplay>, over IPv6:
  1374.  
  1375.        
  1376.         ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4]
  1377.  
  1378.  
  1379.  
  1380. =head3 Demuxer
  1381.  
  1382.  
  1383. The syntax for a SAP url given to the demuxer is:
  1384.        
  1385.         sap://[<address>][:<port>]
  1386.  
  1387.  
  1388. I<address> is the multicast address to listen for announcements on,
  1389. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. I<port>
  1390. is the port that is listened on, 9875 if omitted.
  1391.  
  1392. The demuxers listens for announcements on the given address and port.
  1393. Once an announcement is received, it tries to receive that particular stream.
  1394.  
  1395. Example command lines follow.
  1396.  
  1397. To play back the first stream announced on the normal SAP multicast address:
  1398.  
  1399.        
  1400.         ffplay sap://
  1401.  
  1402.  
  1403. To play back the first stream announced on one the default IPv6 SAP multicast address:
  1404.  
  1405.        
  1406.         ffplay sap://[ff0e::2:7ffe]
  1407.  
  1408.  
  1409.  
  1410. =head2 sctp
  1411.  
  1412.  
  1413. Stream Control Transmission Protocol.
  1414.  
  1415. The accepted URL syntax is:
  1416.        
  1417.         sctp://<host>:<port>[?<options>]
  1418.  
  1419.  
  1420. The protocol accepts the following options:
  1421.  
  1422. =over 4
  1423.  
  1424.  
  1425. =item B<listen>
  1426.  
  1427. If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  1428.  
  1429.  
  1430. =item B<max_streams>
  1431.  
  1432. Set the maximum number of streams. By default no limit is set.
  1433.  
  1434. =back
  1435.  
  1436.  
  1437.  
  1438. =head2 srtp
  1439.  
  1440.  
  1441. Secure Real-time Transport Protocol.
  1442.  
  1443. The accepted options are:
  1444.  
  1445. =over 4
  1446.  
  1447.  
  1448. =item B<srtp_in_suite>
  1449.  
  1450.  
  1451. =item B<srtp_out_suite>
  1452.  
  1453. Select input and output encoding suites.
  1454.  
  1455. Supported values:
  1456.  
  1457. =over 4
  1458.  
  1459.  
  1460. =item B<AES_CM_128_HMAC_SHA1_80>
  1461.  
  1462.  
  1463. =item B<SRTP_AES128_CM_HMAC_SHA1_80>
  1464.  
  1465.  
  1466. =item B<AES_CM_128_HMAC_SHA1_32>
  1467.  
  1468.  
  1469. =item B<SRTP_AES128_CM_HMAC_SHA1_32>
  1470.  
  1471.  
  1472. =back
  1473.  
  1474.  
  1475.  
  1476. =item B<srtp_in_params>
  1477.  
  1478.  
  1479. =item B<srtp_out_params>
  1480.  
  1481. Set input and output encoding parameters, which are expressed by a
  1482. base64-encoded representation of a binary block. The first 16 bytes of
  1483. this binary block are used as master key, the following 14 bytes are
  1484. used as master salt.
  1485.  
  1486. =back
  1487.  
  1488.  
  1489.  
  1490. =head2 subfile
  1491.  
  1492.  
  1493. Virtually extract a segment of a file or another stream.
  1494. The underlying stream must be seekable.
  1495.  
  1496. Accepted options:
  1497.  
  1498. =over 4
  1499.  
  1500.  
  1501. =item B<start>
  1502.  
  1503. Start offset of the extracted segment, in bytes.
  1504.  
  1505. =item B<end>
  1506.  
  1507. End offset of the extracted segment, in bytes.
  1508.  
  1509. =back
  1510.  
  1511.  
  1512. Examples:
  1513.  
  1514. Extract a chapter from a DVD VOB file (start and end sectors obtained
  1515. externally and multiplied by 2048):
  1516.        
  1517.         subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  1518.  
  1519.  
  1520. Play an AVI file directly from a TAR archive:
  1521.        
  1522.         subfile,,start,183241728,end,366490624,,:archive.tar
  1523.  
  1524.  
  1525.  
  1526. =head2 tcp
  1527.  
  1528.  
  1529. Transmission Control Protocol.
  1530.  
  1531. The required syntax for a TCP url is:
  1532.        
  1533.         tcp://<hostname>:<port>[?<options>]
  1534.  
  1535.  
  1536. I<options> contains a list of &-separated options of the form
  1537. I<key>=I<val>.
  1538.  
  1539. The list of supported options follows.
  1540.  
  1541.  
  1542. =over 4
  1543.  
  1544.  
  1545. =item B<listen=>I<1|0>
  1546.  
  1547. Listen for an incoming connection. Default value is 0.
  1548.  
  1549.  
  1550. =item B<timeout=>I<microseconds>
  1551.  
  1552. Set raise error timeout, expressed in microseconds.
  1553.  
  1554. This option is only relevant in read mode: if no data arrived in more
  1555. than this time interval, raise error.
  1556.  
  1557.  
  1558. =item B<listen_timeout=>I<milliseconds>
  1559.  
  1560. Set listen timeout, expressed in milliseconds.
  1561.  
  1562. =back
  1563.  
  1564.  
  1565. The following example shows how to setup a listening TCP connection
  1566. with B<ffmpeg>, which is then accessed with B<ffplay>:
  1567.        
  1568.         ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen
  1569.         ffplay tcp://<hostname>:<port>
  1570.  
  1571.  
  1572.  
  1573. =head2 tls
  1574.  
  1575.  
  1576. Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  1577.  
  1578. The required syntax for a TLS/SSL url is:
  1579.        
  1580.         tls://<hostname>:<port>[?<options>]
  1581.  
  1582.  
  1583. The following parameters can be set via command line options
  1584. (or in code via C<AVOption>s):
  1585.  
  1586.  
  1587. =over 4
  1588.  
  1589.  
  1590.  
  1591. =item B<ca_file, cafile=>I<filename>
  1592.  
  1593. A file containing certificate authority (CA) root certificates to treat
  1594. as trusted. If the linked TLS library contains a default this might not
  1595. need to be specified for verification to work, but not all libraries and
  1596. setups have defaults built in.
  1597. The file must be in OpenSSL PEM format.
  1598.  
  1599.  
  1600. =item B<tls_verify=>I<1|0>
  1601.  
  1602. If enabled, try to verify the peer that we are communicating with.
  1603. Note, if using OpenSSL, this currently only makes sure that the
  1604. peer certificate is signed by one of the root certificates in the CA
  1605. database, but it does not validate that the certificate actually
  1606. matches the host name we are trying to connect to. (With GnuTLS,
  1607. the host name is validated as well.)
  1608.  
  1609. This is disabled by default since it requires a CA database to be
  1610. provided by the caller in many cases.
  1611.  
  1612.  
  1613. =item B<cert_file, cert=>I<filename>
  1614.  
  1615. A file containing a certificate to use in the handshake with the peer.
  1616. (When operating as server, in listen mode, this is more often required
  1617. by the peer, while client certificates only are mandated in certain
  1618. setups.)
  1619.  
  1620.  
  1621. =item B<key_file, key=>I<filename>
  1622.  
  1623. A file containing the private key for the certificate.
  1624.  
  1625.  
  1626. =item B<listen=>I<1|0>
  1627.  
  1628. If enabled, listen for connections on the provided port, and assume
  1629. the server role in the handshake instead of the client role.
  1630.  
  1631.  
  1632. =back
  1633.  
  1634.  
  1635. Example command lines:
  1636.  
  1637. To create a TLS/SSL server that serves an input stream.
  1638.  
  1639.        
  1640.         ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
  1641.  
  1642.  
  1643. To play back a stream from the TLS/SSL server using B<ffplay>:
  1644.  
  1645.        
  1646.         ffplay tls://<hostname>:<port>
  1647.  
  1648.  
  1649.  
  1650. =head2 udp
  1651.  
  1652.  
  1653. User Datagram Protocol.
  1654.  
  1655. The required syntax for an UDP URL is:
  1656.        
  1657.         udp://<hostname>:<port>[?<options>]
  1658.  
  1659.  
  1660. I<options> contains a list of &-separated options of the form I<key>=I<val>.
  1661.  
  1662. In case threading is enabled on the system, a circular buffer is used
  1663. to store the incoming data, which allows one to reduce loss of data due to
  1664. UDP socket buffer overruns. The I<fifo_size> and
  1665. I<overrun_nonfatal> options are related to this buffer.
  1666.  
  1667. The list of supported options follows.
  1668.  
  1669.  
  1670. =over 4
  1671.  
  1672.  
  1673. =item B<buffer_size=>I<size>
  1674.  
  1675. Set the UDP maximum socket buffer size in bytes. This is used to set either
  1676. the receive or send buffer size, depending on what the socket is used for.
  1677. Default is 64KB.  See also I<fifo_size>.
  1678.  
  1679.  
  1680. =item B<localport=>I<port>
  1681.  
  1682. Override the local UDP port to bind with.
  1683.  
  1684.  
  1685. =item B<localaddr=>I<addr>
  1686.  
  1687. Choose the local IP address. This is useful e.g. if sending multicast
  1688. and the host has multiple interfaces, where the user can choose
  1689. which interface to send on by specifying the IP address of that interface.
  1690.  
  1691.  
  1692. =item B<pkt_size=>I<size>
  1693.  
  1694. Set the size in bytes of UDP packets.
  1695.  
  1696.  
  1697. =item B<reuse=>I<1|0>
  1698.  
  1699. Explicitly allow or disallow reusing UDP sockets.
  1700.  
  1701.  
  1702. =item B<ttl=>I<ttl>
  1703.  
  1704. Set the time to live value (for multicast only).
  1705.  
  1706.  
  1707. =item B<connect=>I<1|0>
  1708.  
  1709. Initialize the UDP socket with C<connect()>. In this case, the
  1710. destination address can't be changed with ff_udp_set_remote_url later.
  1711. If the destination address isn't known at the start, this option can
  1712. be specified in ff_udp_set_remote_url, too.
  1713. This allows finding out the source address for the packets with getsockname,
  1714. and makes writes return with AVERROR(ECONNREFUSED) if "destination
  1715. unreachable" is received.
  1716. For receiving, this gives the benefit of only receiving packets from
  1717. the specified peer address/port.
  1718.  
  1719.  
  1720. =item B<sources=>I<address>B<[,>I<address>B<]>
  1721.  
  1722. Only receive packets sent to the multicast group from one of the
  1723. specified sender IP addresses.
  1724.  
  1725.  
  1726. =item B<block=>I<address>B<[,>I<address>B<]>
  1727.  
  1728. Ignore packets sent to the multicast group from the specified
  1729. sender IP addresses.
  1730.  
  1731.  
  1732. =item B<fifo_size=>I<units>
  1733.  
  1734. Set the UDP receiving circular buffer size, expressed as a number of
  1735. packets with size of 188 bytes. If not specified defaults to 7*4096.
  1736.  
  1737.  
  1738. =item B<overrun_nonfatal=>I<1|0>
  1739.  
  1740. Survive in case of UDP receiving circular buffer overrun. Default
  1741. value is 0.
  1742.  
  1743.  
  1744. =item B<timeout=>I<microseconds>
  1745.  
  1746. Set raise error timeout, expressed in microseconds.
  1747.  
  1748. This option is only relevant in read mode: if no data arrived in more
  1749. than this time interval, raise error.
  1750.  
  1751.  
  1752. =item B<broadcast=>I<1|0>
  1753.  
  1754. Explicitly allow or disallow UDP broadcasting.
  1755.  
  1756. Note that broadcasting may not work properly on networks having
  1757. a broadcast storm protection.
  1758.  
  1759. =back
  1760.  
  1761.  
  1762.  
  1763. =head3 Examples
  1764.  
  1765.  
  1766.  
  1767. =over 4
  1768.  
  1769.  
  1770. =item *
  1771.  
  1772. Use B<ffmpeg> to stream over UDP to a remote endpoint:
  1773.        
  1774.         ffmpeg -i <input> -f <format> udp://<hostname>:<port>
  1775.  
  1776.  
  1777.  
  1778. =item *
  1779.  
  1780. Use B<ffmpeg> to stream in mpegts format over UDP using 188
  1781. sized UDP packets, using a large input buffer:
  1782.        
  1783.         ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
  1784.  
  1785.  
  1786.  
  1787. =item *
  1788.  
  1789. Use B<ffmpeg> to receive over UDP from a remote endpoint:
  1790.        
  1791.         ffmpeg -i udp://[<multicast-address>]:<port> ...
  1792.  
  1793.  
  1794. =back
  1795.  
  1796.  
  1797.  
  1798. =head2 unix
  1799.  
  1800.  
  1801. Unix local socket
  1802.  
  1803. The required syntax for a Unix socket URL is:
  1804.  
  1805.        
  1806.         unix://<filepath>
  1807.  
  1808.  
  1809. The following parameters can be set via command line options
  1810. (or in code via C<AVOption>s):
  1811.  
  1812.  
  1813. =over 4
  1814.  
  1815.  
  1816. =item B<timeout>
  1817.  
  1818. Timeout in ms.
  1819.  
  1820. =item B<listen>
  1821.  
  1822. Create the Unix socket in listening mode.
  1823.  
  1824. =back
  1825.  
  1826.  
  1827.  
  1828.  
  1829. =head1 SEE ALSO
  1830.  
  1831.  
  1832.  
  1833. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavformat(3)
  1834.  
  1835.  
  1836. =head1 AUTHORS
  1837.  
  1838.  
  1839. The FFmpeg developers.
  1840.  
  1841. For details about the authorship, see the Git history of the project
  1842. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  1843. B<git log> in the FFmpeg source directory, or browsing the
  1844. online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
  1845.  
  1846. Maintainers for the specific components are listed in the file
  1847. F<MAINTAINERS> in the source code tree.
  1848.  
  1849.  
  1850.  
  1851.