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.

941 lines
27KB

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