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.

338 lines
8.8KB

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