ffmpeg-scaler.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Scaler Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg Scaler Documentation
  17. </h1>
  18. <div class="top-level-extent" id="SEC_Top">
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  24. <li><a id="toc-Scaler-Options" href="#Scaler-Options">2 Scaler Options</a></li>
  25. <li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
  26. <li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
  27. </ul>
  28. </div>
  29. </div>
  30. <ul class="mini-toc">
  31. <li><a href="#Description" accesskey="1">Description</a></li>
  32. <li><a href="#Scaler-Options" accesskey="2">Scaler Options</a></li>
  33. <li><a href="#See-Also" accesskey="3">See Also</a></li>
  34. <li><a href="#Authors" accesskey="4">Authors</a></li>
  35. </ul>
  36. <div class="chapter-level-extent" id="Description">
  37. <h2 class="chapter"><span>1 Description<a class="copiable-link" href="#Description"> &para;</a></span></h2>
  38. <p>The FFmpeg rescaler provides a high-level interface to the libswscale
  39. library image conversion utilities. In particular it allows one to perform
  40. image rescaling and pixel format conversion.
  41. </p>
  42. <a class="anchor" id="scaler_005foptions"></a></div>
  43. <div class="chapter-level-extent" id="Scaler-Options">
  44. <h2 class="chapter"><span>2 Scaler Options<a class="copiable-link" href="#Scaler-Options"> &para;</a></span></h2>
  45. <p>The video scaler supports the following named options.
  46. </p>
  47. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  48. FFmpeg tools, with a few API-only exceptions noted below.
  49. For programmatic use, they can be set explicitly in the
  50. <code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
  51. </p>
  52. <dl class="table">
  53. <dd>
  54. <a class="anchor" id="sws_005fflags"></a></dd>
  55. <dt><samp class="option">sws_flags</samp></dt>
  56. <dd><p>Set the scaler flags. This is also used to set the scaling
  57. algorithm. Only a single algorithm should be selected. Default
  58. value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
  59. </p>
  60. <p>It accepts the following values:
  61. </p><dl class="table">
  62. <dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
  63. <dd><p>Select fast bilinear scaling algorithm.
  64. </p>
  65. </dd>
  66. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  67. <dd><p>Select bilinear scaling algorithm.
  68. </p>
  69. </dd>
  70. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  71. <dd><p>Select bicubic scaling algorithm.
  72. </p>
  73. </dd>
  74. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  75. <dd><p>Select experimental scaling algorithm.
  76. </p>
  77. </dd>
  78. <dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
  79. <dd><p>Select nearest neighbor rescaling algorithm.
  80. </p>
  81. </dd>
  82. <dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
  83. <dd><p>Select averaging area rescaling algorithm.
  84. </p>
  85. </dd>
  86. <dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
  87. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  88. chroma components.
  89. </p>
  90. </dd>
  91. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  92. <dd><p>Select Gaussian rescaling algorithm.
  93. </p>
  94. </dd>
  95. <dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
  96. <dd><p>Select sinc rescaling algorithm.
  97. </p>
  98. </dd>
  99. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  100. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  101. changed by setting <code class="code">param0</code>.
  102. </p>
  103. </dd>
  104. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  105. <dd><p>Select natural bicubic spline rescaling algorithm.
  106. </p>
  107. </dd>
  108. <dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
  109. <dd><p>Enable printing/debug logging.
  110. </p>
  111. </dd>
  112. <dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
  113. <dd><p>Enable accurate rounding.
  114. </p>
  115. </dd>
  116. <dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
  117. <dd><p>Enable full chroma interpolation.
  118. </p>
  119. </dd>
  120. <dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
  121. <dd><p>Select full chroma input.
  122. </p>
  123. </dd>
  124. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  125. <dd><p>Enable bitexact output.
  126. </p></dd>
  127. </dl>
  128. </dd>
  129. <dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
  130. <dd><p>Set source width.
  131. </p>
  132. </dd>
  133. <dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
  134. <dd><p>Set source height.
  135. </p>
  136. </dd>
  137. <dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
  138. <dd><p>Set destination width.
  139. </p>
  140. </dd>
  141. <dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
  142. <dd><p>Set destination height.
  143. </p>
  144. </dd>
  145. <dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
  146. <dd><p>Set source pixel format (must be expressed as an integer).
  147. </p>
  148. </dd>
  149. <dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
  150. <dd><p>Set destination pixel format (must be expressed as an integer).
  151. </p>
  152. </dd>
  153. <dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
  154. <dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
  155. <code class="code">0</code>, which indicates source is limited range.
  156. </p>
  157. </dd>
  158. <dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
  159. <dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
  160. is <code class="code">0</code>, which enables limited range.
  161. </p>
  162. <a class="anchor" id="sws_005fparams"></a></dd>
  163. <dt><samp class="option">param0, param1</samp></dt>
  164. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  165. some scaling algorithms and ignored by others. The specified values
  166. are floating point number values.
  167. </p>
  168. </dd>
  169. <dt><samp class="option">sws_dither</samp></dt>
  170. <dd><p>Set the dithering algorithm. Accepts one of the following
  171. values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
  172. </p>
  173. <dl class="table">
  174. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  175. <dd><p>automatic choice
  176. </p>
  177. </dd>
  178. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  179. <dd><p>no dithering
  180. </p>
  181. </dd>
  182. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  183. <dd><p>bayer dither
  184. </p>
  185. </dd>
  186. <dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
  187. <dd><p>error diffusion dither
  188. </p>
  189. </dd>
  190. <dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
  191. <dd><p>arithmetic dither, based using addition
  192. </p>
  193. </dd>
  194. <dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
  195. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  196. a_dither).
  197. </p>
  198. </dd>
  199. </dl>
  200. </dd>
  201. <dt><samp class="option">alphablend</samp></dt>
  202. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  203. Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
  204. </p>
  205. <dl class="table">
  206. <dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
  207. <dd><p>Blend onto a uniform background color
  208. </p>
  209. </dd>
  210. <dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
  211. <dd><p>Blend onto a checkerboard
  212. </p>
  213. </dd>
  214. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  215. <dd><p>No blending
  216. </p>
  217. </dd>
  218. </dl>
  219. </dd>
  220. </dl>
  221. </div>
  222. <div class="chapter-level-extent" id="See-Also">
  223. <h2 class="chapter"><span>3 See Also<a class="copiable-link" href="#See-Also"> &para;</a></span></h2>
  224. <p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  225. <a class="url" href="libswscale.html">libswscale</a>
  226. </p>
  227. </div>
  228. <div class="chapter-level-extent" id="Authors">
  229. <h2 class="chapter"><span>4 Authors<a class="copiable-link" href="#Authors"> &para;</a></span></h2>
  230. <p>The FFmpeg developers.
  231. </p>
  232. <p>For details about the authorship, see the Git history of the project
  233. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  234. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  235. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  236. </p>
  237. <p>Maintainers for the specific components are listed in the file
  238. <samp class="file">MAINTAINERS</samp> in the source code tree.
  239. </p>
  240. </div>
  241. </div>
  242. <p style="font-size: small;">
  243. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  244. </p>
  245. </div>
  246. </body>
  247. </html>