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.

364 lines
9.3KB

  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 format
  39. Convert the input video to one of the specified pixel formats.
  40. Libavfilter will try to pick one that is supported for the input to
  41. the next filter.
  42. The filter accepts a list of pixel format names, separated by ``:'',
  43. for example ``yuv420p:monow:rgb24''.
  44. The following command:
  45. @example
  46. ./ffmpeg -i in.avi -vf "format=yuv420p" out.avi
  47. @end example
  48. will convert the input video to the format ``yuv420p''.
  49. @section hflip
  50. Flip the input video horizontally.
  51. For example to horizontally flip the video in input with
  52. @file{ffmpeg}:
  53. @example
  54. ffmpeg -i in.avi -vf "hflip" out.avi
  55. @end example
  56. @section noformat
  57. Force libavfilter not to use any of the specified pixel formats for the
  58. input to the next filter.
  59. The filter accepts a list of pixel format names, separated by ``:'',
  60. for example ``yuv420p:monow:rgb24''.
  61. The following command:
  62. @example
  63. ./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi
  64. @end example
  65. will make libavfilter use a format different from ``yuv420p'' for the
  66. input to the vflip filter.
  67. @section null
  68. Pass the video source unchanged to the output.
  69. @section pad
  70. Add paddings to the input image, and places the original input at the
  71. given coordinates @var{x}, @var{y}.
  72. It accepts the following parameters:
  73. @var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
  74. Follows the description of the accepted parameters.
  75. @table @option
  76. @item width, height
  77. Specify the size of the output image with the paddings added. If the
  78. value for @var{width} or @var{height} is 0, the corresponding input size
  79. is used for the output.
  80. The default value of @var{width} and @var{height} is 0.
  81. @item x, y
  82. Specify the offsets where to place the input image in the padded area
  83. with respect to the top/left border of the output image.
  84. The default value of @var{x} and @var{y} is 0.
  85. @item color
  86. Specify the color of the padded area, it can be the name of a color
  87. (case insensitive match) or a 0xRRGGBB[AA] sequence.
  88. The default value of @var{color} is ``black''.
  89. @end table
  90. @section pixdesctest
  91. Pixel format descriptor test filter, mainly useful for internal
  92. testing. The output video should be equal to the input video.
  93. For example:
  94. @example
  95. format=monow, pixdesctest
  96. @end example
  97. can be used to test the monowhite pixel format descriptor definition.
  98. @section scale
  99. Scale the input video to @var{width}:@var{height} and/or convert the image format.
  100. For example the command:
  101. @example
  102. ./ffmpeg -i in.avi -vf "scale=200:100" out.avi
  103. @end example
  104. will scale the input video to a size of 200x100.
  105. If the input image format is different from the format requested by
  106. the next filter, the scale filter will convert the input to the
  107. requested format.
  108. If the value for @var{width} or @var{height} is 0, the respective input
  109. size is used for the output.
  110. If the value for @var{width} or @var{height} is -1, the scale filter will
  111. use, for the respective output size, a value that maintains the aspect
  112. ratio of the input image.
  113. The default value of @var{width} and @var{height} is 0.
  114. @section slicify
  115. Pass the images of input video on to next video filter as multiple
  116. slices.
  117. @example
  118. ./ffmpeg -i in.avi -vf "slicify=32" out.avi
  119. @end example
  120. The filter accepts the slice height as parameter. If the parameter is
  121. not specified it will use the default value of 16.
  122. Adding this in the beginning of filter chains should make filtering
  123. faster due to better use of the memory cache.
  124. @section unsharp
  125. Sharpen or blur the input video.
  126. It accepts the following parameters:
  127. @var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
  128. Negative values for the amount will blur the input video, while positive
  129. values will sharpen. All parameters are optional and default to the
  130. equivalent of the string '5:5:1.0:0:0:0.0'.
  131. @table @option
  132. @item luma_msize_x
  133. Set the luma matrix horizontal size. It can be an integer between 3
  134. and 13, default value is 5.
  135. @item luma_msize_y
  136. Set the luma matrix vertical size. It can be an integer between 3
  137. and 13, default value is 5.
  138. @item luma_amount
  139. Set the luma effect strength. It can be a float number between -2.0
  140. and 5.0, default value is 1.0.
  141. @item chroma_msize_x
  142. Set the chroma matrix horizontal size. It can be an integer between 3
  143. and 13, default value is 0.
  144. @item chroma_msize_y
  145. Set the chroma matrix vertical size. It can be an integer between 3
  146. and 13, default value is 0.
  147. @item luma_amount
  148. Set the chroma effect strength. It can be a float number between -2.0
  149. and 5.0, default value is 0.0.
  150. @end table
  151. @example
  152. # Strong luma sharpen effect parameters
  153. unsharp=7:7:2.5
  154. # Strong blur of both luma and chroma parameters
  155. unsharp=7:7:-2:7:7:-2
  156. # Use the default values with @command{ffmpeg}
  157. ./ffmpeg -i in.avi -vf "unsharp" out.mp4
  158. @end example
  159. @section vflip
  160. Flip the input video vertically.
  161. @example
  162. ./ffmpeg -i in.avi -vf "vflip" out.avi
  163. @end example
  164. @c man end VIDEO FILTERS
  165. @chapter Video Sources
  166. @c man begin VIDEO SOURCES
  167. Below is a description of the currently available video sources.
  168. @section buffer
  169. Buffer video frames, and make them available to the filter chain.
  170. This source is mainly intended for a programmatic use, in particular
  171. through the interface defined in @file{libavfilter/vsrc_buffer.h}.
  172. It accepts the following parameters:
  173. @var{width}:@var{height}:@var{pix_fmt_string}
  174. All the parameters need to be explicitely defined.
  175. Follows the list of the accepted parameters.
  176. @table @option
  177. @item width, height
  178. Specify the width and height of the buffered video frames.
  179. @item pix_fmt_string
  180. A string representing the pixel format of the buffered video frames.
  181. It may be a number corresponding to a pixel format, or a pixel format
  182. name.
  183. @end table
  184. For example:
  185. @example
  186. buffer=320:240:yuv410p
  187. @end example
  188. will instruct the source to accept video frames with size 320x240 and
  189. with format "yuv410p". Since the pixel format with name "yuv410p"
  190. corresponds to the number 6 (check the enum PixelFormat definition in
  191. @file{libavutil/pixfmt.h}), this example corresponds to:
  192. @example
  193. buffer=320:240:6
  194. @end example
  195. @section color
  196. Provide an uniformly colored input.
  197. It accepts the following parameters:
  198. @var{color}:@var{frame_size}:@var{frame_rate}
  199. Follows the description of the accepted parameters.
  200. @table @option
  201. @item color
  202. Specify the color of the source. It can be the name of a color (case
  203. insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
  204. alpha specifier. The default value is "black".
  205. @item frame_size
  206. Specify the size of the sourced video, it may be a string of the form
  207. @var{width}x@var{heigth}, or the name of a size abbreviation. The
  208. default value is "320x240".
  209. @item frame_rate
  210. Specify the frame rate of the sourced video, as the number of frames
  211. generated per second. It has to be a string in the format
  212. @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
  213. number or a valid video frame rate abbreviation. The default value is
  214. "25".
  215. @end table
  216. For example the following graph description will generate a red source
  217. with an opacity of 0.2, with size "qcif" and a frame rate of 10
  218. frames per second, which will be overlayed over the source connected
  219. to the pad with identifier "in".
  220. @example
  221. "color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
  222. @end example
  223. @section nullsrc
  224. Null video source, never return images. It is mainly useful as a
  225. template and to be employed in analysis / debugging tools.
  226. It accepts as optional parameter a string of the form
  227. @var{width}:@var{height}, where @var{width} and @var{height} specify the size of
  228. the configured source.
  229. The default values of @var{width} and @var{height} are respectively 352
  230. and 288 (corresponding to the CIF size format).
  231. @c man end VIDEO SOURCES
  232. @chapter Video Sinks
  233. @c man begin VIDEO SINKS
  234. Below is a description of the currently available video sinks.
  235. @section nullsink
  236. Null video sink, do absolutely nothing with the input video. It is
  237. mainly useful as a template and to be employed in analysis / debugging
  238. tools.
  239. @c man end VIDEO SINKS