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.

927 lines
26KB

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