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.

229 lines
6.0KB

  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 concat
  17. Physical concatenation protocol.
  18. Allow to read and seek from many resource in sequence as if they were
  19. a unique resource.
  20. A URL accepted by this protocol has the syntax:
  21. @example
  22. concat:@var{URL1}|@var{URL2}|...|@var{URLN}
  23. @end example
  24. where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
  25. resource to be concatenated, each one possibly specifying a distinct
  26. protocol.
  27. For example to read a sequence of files @file{split1.mpeg},
  28. @file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the
  29. command:
  30. @example
  31. ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  32. @end example
  33. Note that you may need to escape the character "|" which is special for
  34. many shells.
  35. @section file
  36. File access protocol.
  37. Allow to read from or read to a file.
  38. For example to read from a file @file{input.mpeg} with @file{ffmpeg}
  39. use the command:
  40. @example
  41. ffmpeg -i file:input.mpeg output.mpeg
  42. @end example
  43. The ff* tools default to the file protocol, that is a resource
  44. specified with the name "FILE.mpeg" is interpreted as the URL
  45. "file:FILE.mpeg".
  46. @section gopher
  47. Gopher protocol.
  48. @section http
  49. HTTP (Hyper Text Transfer Protocol).
  50. @section mmst
  51. MMS (Microsoft Media Server) protocol over TCP.
  52. @section mmsh
  53. MMS (Microsoft Media Server) protocol over HTTP.
  54. The required syntax is:
  55. @example
  56. mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
  57. @end example
  58. @section md5
  59. MD5 output protocol.
  60. Computes the MD5 hash of the data to be written, and on close writes
  61. this to the designated output or stdout if none is specified. It can
  62. be used to test muxers without writing an actual file.
  63. Some examples follow.
  64. @example
  65. # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  66. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  67. # Write the MD5 hash of the encoded AVI file to stdout.
  68. ffmpeg -i input.flv -f avi -y md5:
  69. @end example
  70. Note that some formats (typically MOV) require the output protocol to
  71. be seekable, so they will fail with the MD5 output protocol.
  72. @section pipe
  73. UNIX pipe access protocol.
  74. Allow to read and write from UNIX pipes.
  75. The accepted syntax is:
  76. @example
  77. pipe:[@var{number}]
  78. @end example
  79. @var{number} is the number corresponding to the file descriptor of the
  80. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number}
  81. is not specified, by default the stdout file descriptor will be used
  82. for writing, stdin for reading.
  83. For example to read from stdin with @file{ffmpeg}:
  84. @example
  85. cat test.wav | ffmpeg -i pipe:0
  86. # ...this is the same as...
  87. cat test.wav | ffmpeg -i pipe:
  88. @end example
  89. For writing to stdout with @file{ffmpeg}:
  90. @example
  91. ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
  92. # ...this is the same as...
  93. ffmpeg -i test.wav -f avi pipe: | cat > test.avi
  94. @end example
  95. Note that some formats (typically MOV), require the output protocol to
  96. be seekable, so they will fail with the pipe output protocol.
  97. @section rtmp
  98. Real-Time Messaging Protocol.
  99. The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
  100. dia content across a TCP/IP network.
  101. The required syntax is:
  102. @example
  103. rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
  104. @end example
  105. The accepted parameters are:
  106. @table @option
  107. @item server
  108. The address of the RTMP server.
  109. @item port
  110. The number of the TCP port to use (by default is 1935).
  111. @item app
  112. It is the name of the application to access. It usually corresponds to
  113. the path where the application is installed on the RTMP server
  114. (e.g. @file{/ondemand/}, @file{/flash/live/}, etc.).
  115. @item playpath
  116. It is the path or name of the resource to play with reference to the
  117. application specified in @var{app}, may be prefixed by "mp4:".
  118. @end table
  119. For example to read with @file{ffplay} a multimedia resource named
  120. "sample" from the application "vod" from an RTMP server "myserver":
  121. @example
  122. ffplay rtmp://myserver/vod/sample
  123. @end example
  124. @section rtmp, rtmpe, rtmps, rtmpt, rtmpte
  125. Real-Time Messaging Protocol and its variants supported through
  126. librtmp.
  127. Requires the presence of the librtmp headers and library during
  128. configuration. You need to explicitely configure the build with
  129. "--enable-librtmp". If enabled this will replace the native RTMP
  130. protocol.
  131. This protocol provides most client functions and a few server
  132. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  133. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  134. variants of these encrypted types (RTMPTE, RTMPTS).
  135. The required syntax is:
  136. @example
  137. @var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
  138. @end example
  139. where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
  140. "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
  141. @var{server}, @var{port}, @var{app} and @var{playpath} have the same
  142. meaning as specified for the RTMP native protocol.
  143. @var{options} contains a list of space-separated options of the form
  144. @var{key}=@var{val}.
  145. See the librtmp manual page (man 3 librtmp) for more information.
  146. For example, to stream a file in real-time to an RTMP server using
  147. @file{ffmpeg}:
  148. @example
  149. ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  150. @end example
  151. To play the same stream using @file{ffplay}:
  152. @example
  153. ffplay "rtmp://myserver/live/mystream live=1"
  154. @end example
  155. @section rtp
  156. Real-Time Protocol.
  157. @section tcp
  158. Trasmission Control Protocol.
  159. @section udp
  160. User Datagram Protocol.
  161. @c man end PROTOCOLS