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.

220 lines
5.8KB

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