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.

221 lines
5.9KB

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