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.

400 lines
11KB

  1. @chapter Audio Filters
  2. @c man begin AUDIO FILTERS
  3. When you configure your FFmpeg build, you can disable any of the
  4. existing filters using --disable-filters.
  5. The configure output will show the audio filters included in your
  6. build.
  7. Below is a description of the currently available audio filters.
  8. @section anull
  9. Pass the audio source unchanged to the output.
  10. @c man end AUDIO FILTERS
  11. @chapter Video Filters
  12. @c man begin VIDEO FILTERS
  13. When you configure your FFmpeg build, you can disable any of the
  14. existing filters using --disable-filters.
  15. The configure output will show the video filters included in your
  16. build.
  17. Below is a description of the currently available video filters.
  18. @section crop
  19. Crop the input video to @var{x}:@var{y}:@var{width}:@var{height}.
  20. @example
  21. ./ffmpeg -i in.avi -vf "crop=0:0:0:240" out.avi
  22. @end example
  23. @var{x} and @var{y} specify the position of the top-left corner of the
  24. output (non-cropped) area.
  25. The default value of @var{x} and @var{y} is 0.
  26. The @var{width} and @var{height} parameters specify the width and height
  27. of the output (non-cropped) area.
  28. A value of 0 is interpreted as the maximum possible size contained in
  29. the area delimited by the top-left corner at position x:y.
  30. For example the parameters:
  31. @example
  32. "crop=100:100:0:0"
  33. @end example
  34. will delimit the rectangle with the top-left corner placed at position
  35. 100:100 and the right-bottom corner corresponding to the right-bottom
  36. corner of the input image.
  37. The default value of @var{width} and @var{height} is 0.
  38. @section fifo
  39. Buffer input images and send them when they are requested.
  40. This filter is mainly useful when auto-inserted by the libavfilter
  41. framework.
  42. The filter does not take parameters.
  43. @section format
  44. Convert the input video to one of the specified pixel formats.
  45. Libavfilter will try to pick one that is supported for the input to
  46. the next filter.
  47. The filter accepts a list of pixel format names, separated by ":",
  48. for example "yuv420p:monow:rgb24".
  49. The following command:
  50. @example
  51. ./ffmpeg -i in.avi -vf "format=yuv420p" out.avi
  52. @end example
  53. will convert the input video to the format "yuv420p".
  54. @section hflip
  55. Flip the input video horizontally.
  56. For example to horizontally flip the video in input with
  57. @file{ffmpeg}:
  58. @example
  59. ffmpeg -i in.avi -vf "hflip" out.avi
  60. @end example
  61. @section noformat
  62. Force libavfilter not to use any of the specified pixel formats for the
  63. input to the next filter.
  64. The filter accepts a list of pixel format names, separated by ":",
  65. for example "yuv420p:monow:rgb24".
  66. The following command:
  67. @example
  68. ./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi
  69. @end example
  70. will make libavfilter use a format different from "yuv420p" for the
  71. input to the vflip filter.
  72. @section null
  73. Pass the video source unchanged to the output.
  74. @section ocv_smooth
  75. Apply smooth transform using libopencv.
  76. To enable this filter install libopencv library and headers and
  77. configure FFmpeg with --enable-libopencv.
  78. The filter accepts the following parameters:
  79. @var{type}:@var{param1}:@var{param2}:@var{param3}:@var{param4}.
  80. @var{type} is the type of smooth filter to apply, and can be one of
  81. the following values: "blur", "blur_no_scale", "median", "gaussian",
  82. "bilateral". The default value is "gaussian".
  83. @var{param1}, @var{param2}, @var{param3}, and @var{param4} are
  84. parameters whose meanings depend on smooth type. @var{param1} and
  85. @var{param2} accept integer positive values or 0, @var{param3} and
  86. @var{param4} accept float values.
  87. The default value for @var{param1} is 3, the default value for the
  88. other parameters is 0.
  89. These parameters correspond to the parameters assigned to the
  90. libopencv function @code{cvSmooth}. Refer to the official libopencv
  91. documentation for the exact meaning of the parameters:
  92. @url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
  93. @section pad
  94. Add paddings to the input image, and places the original input at the
  95. given coordinates @var{x}, @var{y}.
  96. It accepts the following parameters:
  97. @var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
  98. Follows the description of the accepted parameters.
  99. @table @option
  100. @item width, height
  101. Specify the size of the output image with the paddings added. If the
  102. value for @var{width} or @var{height} is 0, the corresponding input size
  103. is used for the output.
  104. The default value of @var{width} and @var{height} is 0.
  105. @item x, y
  106. Specify the offsets where to place the input image in the padded area
  107. with respect to the top/left border of the output image.
  108. The default value of @var{x} and @var{y} is 0.
  109. @item color
  110. Specify the color of the padded area, it can be the name of a color
  111. (case insensitive match) or a 0xRRGGBB[AA] sequence.
  112. The default value of @var{color} is "black".
  113. @end table
  114. @section pixdesctest
  115. Pixel format descriptor test filter, mainly useful for internal
  116. testing. The output video should be equal to the input video.
  117. For example:
  118. @example
  119. format=monow, pixdesctest
  120. @end example
  121. can be used to test the monowhite pixel format descriptor definition.
  122. @section scale
  123. Scale the input video to @var{width}:@var{height} and/or convert the image format.
  124. For example the command:
  125. @example
  126. ./ffmpeg -i in.avi -vf "scale=200:100" out.avi
  127. @end example
  128. will scale the input video to a size of 200x100.
  129. If the input image format is different from the format requested by
  130. the next filter, the scale filter will convert the input to the
  131. requested format.
  132. If the value for @var{width} or @var{height} is 0, the respective input
  133. size is used for the output.
  134. If the value for @var{width} or @var{height} is -1, the scale filter will
  135. use, for the respective output size, a value that maintains the aspect
  136. ratio of the input image.
  137. The default value of @var{width} and @var{height} is 0.
  138. @section slicify
  139. Pass the images of input video on to next video filter as multiple
  140. slices.
  141. @example
  142. ./ffmpeg -i in.avi -vf "slicify=32" out.avi
  143. @end example
  144. The filter accepts the slice height as parameter. If the parameter is
  145. not specified it will use the default value of 16.
  146. Adding this in the beginning of filter chains should make filtering
  147. faster due to better use of the memory cache.
  148. @section unsharp
  149. Sharpen or blur the input video.
  150. It accepts the following parameters:
  151. @var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
  152. Negative values for the amount will blur the input video, while positive
  153. values will sharpen. All parameters are optional and default to the
  154. equivalent of the string '5:5:1.0:0:0:0.0'.
  155. @table @option
  156. @item luma_msize_x
  157. Set the luma matrix horizontal size. It can be an integer between 3
  158. and 13, default value is 5.
  159. @item luma_msize_y
  160. Set the luma matrix vertical size. It can be an integer between 3
  161. and 13, default value is 5.
  162. @item luma_amount
  163. Set the luma effect strength. It can be a float number between -2.0
  164. and 5.0, default value is 1.0.
  165. @item chroma_msize_x
  166. Set the chroma matrix horizontal size. It can be an integer between 3
  167. and 13, default value is 0.
  168. @item chroma_msize_y
  169. Set the chroma matrix vertical size. It can be an integer between 3
  170. and 13, default value is 0.
  171. @item luma_amount
  172. Set the chroma effect strength. It can be a float number between -2.0
  173. and 5.0, default value is 0.0.
  174. @end table
  175. @example
  176. # Strong luma sharpen effect parameters
  177. unsharp=7:7:2.5
  178. # Strong blur of both luma and chroma parameters
  179. unsharp=7:7:-2:7:7:-2
  180. # Use the default values with @command{ffmpeg}
  181. ./ffmpeg -i in.avi -vf "unsharp" out.mp4
  182. @end example
  183. @section vflip
  184. Flip the input video vertically.
  185. @example
  186. ./ffmpeg -i in.avi -vf "vflip" out.avi
  187. @end example
  188. @c man end VIDEO FILTERS
  189. @chapter Video Sources
  190. @c man begin VIDEO SOURCES
  191. Below is a description of the currently available video sources.
  192. @section buffer
  193. Buffer video frames, and make them available to the filter chain.
  194. This source is mainly intended for a programmatic use, in particular
  195. through the interface defined in @file{libavfilter/vsrc_buffer.h}.
  196. It accepts the following parameters:
  197. @var{width}:@var{height}:@var{pix_fmt_string}
  198. All the parameters need to be explicitely defined.
  199. Follows the list of the accepted parameters.
  200. @table @option
  201. @item width, height
  202. Specify the width and height of the buffered video frames.
  203. @item pix_fmt_string
  204. A string representing the pixel format of the buffered video frames.
  205. It may be a number corresponding to a pixel format, or a pixel format
  206. name.
  207. @end table
  208. For example:
  209. @example
  210. buffer=320:240:yuv410p
  211. @end example
  212. will instruct the source to accept video frames with size 320x240 and
  213. with format "yuv410p". Since the pixel format with name "yuv410p"
  214. corresponds to the number 6 (check the enum PixelFormat definition in
  215. @file{libavutil/pixfmt.h}), this example corresponds to:
  216. @example
  217. buffer=320:240:6
  218. @end example
  219. @section color
  220. Provide an uniformly colored input.
  221. It accepts the following parameters:
  222. @var{color}:@var{frame_size}:@var{frame_rate}
  223. Follows the description of the accepted parameters.
  224. @table @option
  225. @item color
  226. Specify the color of the source. It can be the name of a color (case
  227. insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
  228. alpha specifier. The default value is "black".
  229. @item frame_size
  230. Specify the size of the sourced video, it may be a string of the form
  231. @var{width}x@var{heigth}, or the name of a size abbreviation. The
  232. default value is "320x240".
  233. @item frame_rate
  234. Specify the frame rate of the sourced video, as the number of frames
  235. generated per second. It has to be a string in the format
  236. @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
  237. number or a valid video frame rate abbreviation. The default value is
  238. "25".
  239. @end table
  240. For example the following graph description will generate a red source
  241. with an opacity of 0.2, with size "qcif" and a frame rate of 10
  242. frames per second, which will be overlayed over the source connected
  243. to the pad with identifier "in".
  244. @example
  245. "color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
  246. @end example
  247. @section nullsrc
  248. Null video source, never return images. It is mainly useful as a
  249. template and to be employed in analysis / debugging tools.
  250. It accepts as optional parameter a string of the form
  251. @var{width}:@var{height}, where @var{width} and @var{height} specify the size of
  252. the configured source.
  253. The default values of @var{width} and @var{height} are respectively 352
  254. and 288 (corresponding to the CIF size format).
  255. @c man end VIDEO SOURCES
  256. @chapter Video Sinks
  257. @c man begin VIDEO SINKS
  258. Below is a description of the currently available video sinks.
  259. @section nullsink
  260. Null video sink, do absolutely nothing with the input video. It is
  261. mainly useful as a template and to be employed in analysis / debugging
  262. tools.
  263. @c man end VIDEO SINKS