ffmpeg-scaler.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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 6.8, https://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>FFmpeg Scaler Documentation</title>
  7. <meta name="description" content="FFmpeg Scaler Documentation">
  8. <meta name="keywords" content="FFmpeg Scaler Documentation">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <meta name="viewport" content="width=device-width,initial-scale=1">
  13. <link href="#SEC_Contents" rel="contents" title="Table of Contents">
  14. <style type="text/css">
  15. <!--
  16. a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
  17. a.summary-letter {text-decoration: none}
  18. blockquote.indentedblock {margin-right: 0em}
  19. div.display {margin-left: 3.2em}
  20. div.example {margin-left: 3.2em}
  21. kbd {font-style: oblique}
  22. pre.display {font-family: inherit}
  23. pre.format {font-family: inherit}
  24. pre.menu-comment {font-family: serif}
  25. pre.menu-preformatted {font-family: serif}
  26. span.nolinebreak {white-space: nowrap}
  27. span.roman {font-family: initial; font-weight: normal}
  28. span.sansserif {font-family: sans-serif; font-weight: normal}
  29. span:hover a.copiable-anchor {visibility: visible}
  30. ul.no-bullet {list-style: none}
  31. -->
  32. </style>
  33. </head>
  34. <body lang="en">
  35. <h1 class="settitle" align="center">FFmpeg Scaler Documentation</h1>
  36. <a name="SEC_Top"></a>
  37. <a name="Description"></a>
  38. <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  39. <p>The FFmpeg rescaler provides a high-level interface to the libswscale
  40. library image conversion utilities. In particular it allows one to perform
  41. image rescaling and pixel format conversion.
  42. </p>
  43. <span id="scaler_005foptions"></span><a name="Scaler-Options"></a>
  44. <h2 class="chapter">2 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
  45. <p>The video scaler supports the following named options.
  46. </p>
  47. <p>Options may be set by specifying -<var>option</var> <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>SwsContext</code> options or through the <samp>libavutil/opt.h</samp> API.
  51. </p>
  52. <dl compact="compact">
  53. <dd>
  54. <span id="sws_005fflags"></span></dd>
  55. <dt><span><samp>sws_flags</samp></span></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>bicubic</samp>&rsquo;.
  59. </p>
  60. <p>It accepts the following values:
  61. </p><dl compact="compact">
  62. <dt><span>&lsquo;<samp>fast_bilinear</samp>&rsquo;</span></dt>
  63. <dd><p>Select fast bilinear scaling algorithm.
  64. </p>
  65. </dd>
  66. <dt><span>&lsquo;<samp>bilinear</samp>&rsquo;</span></dt>
  67. <dd><p>Select bilinear scaling algorithm.
  68. </p>
  69. </dd>
  70. <dt><span>&lsquo;<samp>bicubic</samp>&rsquo;</span></dt>
  71. <dd><p>Select bicubic scaling algorithm.
  72. </p>
  73. </dd>
  74. <dt><span>&lsquo;<samp>experimental</samp>&rsquo;</span></dt>
  75. <dd><p>Select experimental scaling algorithm.
  76. </p>
  77. </dd>
  78. <dt><span>&lsquo;<samp>neighbor</samp>&rsquo;</span></dt>
  79. <dd><p>Select nearest neighbor rescaling algorithm.
  80. </p>
  81. </dd>
  82. <dt><span>&lsquo;<samp>area</samp>&rsquo;</span></dt>
  83. <dd><p>Select averaging area rescaling algorithm.
  84. </p>
  85. </dd>
  86. <dt><span>&lsquo;<samp>bicublin</samp>&rsquo;</span></dt>
  87. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  88. chroma components.
  89. </p>
  90. </dd>
  91. <dt><span>&lsquo;<samp>gauss</samp>&rsquo;</span></dt>
  92. <dd><p>Select Gaussian rescaling algorithm.
  93. </p>
  94. </dd>
  95. <dt><span>&lsquo;<samp>sinc</samp>&rsquo;</span></dt>
  96. <dd><p>Select sinc rescaling algorithm.
  97. </p>
  98. </dd>
  99. <dt><span>&lsquo;<samp>lanczos</samp>&rsquo;</span></dt>
  100. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  101. changed by setting <code>param0</code>.
  102. </p>
  103. </dd>
  104. <dt><span>&lsquo;<samp>spline</samp>&rsquo;</span></dt>
  105. <dd><p>Select natural bicubic spline rescaling algorithm.
  106. </p>
  107. </dd>
  108. <dt><span>&lsquo;<samp>print_info</samp>&rsquo;</span></dt>
  109. <dd><p>Enable printing/debug logging.
  110. </p>
  111. </dd>
  112. <dt><span>&lsquo;<samp>accurate_rnd</samp>&rsquo;</span></dt>
  113. <dd><p>Enable accurate rounding.
  114. </p>
  115. </dd>
  116. <dt><span>&lsquo;<samp>full_chroma_int</samp>&rsquo;</span></dt>
  117. <dd><p>Enable full chroma interpolation.
  118. </p>
  119. </dd>
  120. <dt><span>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</span></dt>
  121. <dd><p>Select full chroma input.
  122. </p>
  123. </dd>
  124. <dt><span>&lsquo;<samp>bitexact</samp>&rsquo;</span></dt>
  125. <dd><p>Enable bitexact output.
  126. </p></dd>
  127. </dl>
  128. </dd>
  129. <dt><span><samp>srcw <var>(API only)</var></samp></span></dt>
  130. <dd><p>Set source width.
  131. </p>
  132. </dd>
  133. <dt><span><samp>srch <var>(API only)</var></samp></span></dt>
  134. <dd><p>Set source height.
  135. </p>
  136. </dd>
  137. <dt><span><samp>dstw <var>(API only)</var></samp></span></dt>
  138. <dd><p>Set destination width.
  139. </p>
  140. </dd>
  141. <dt><span><samp>dsth <var>(API only)</var></samp></span></dt>
  142. <dd><p>Set destination height.
  143. </p>
  144. </dd>
  145. <dt><span><samp>src_format <var>(API only)</var></samp></span></dt>
  146. <dd><p>Set source pixel format (must be expressed as an integer).
  147. </p>
  148. </dd>
  149. <dt><span><samp>dst_format <var>(API only)</var></samp></span></dt>
  150. <dd><p>Set destination pixel format (must be expressed as an integer).
  151. </p>
  152. </dd>
  153. <dt><span><samp>src_range <var>(boolean)</var></samp></span></dt>
  154. <dd><p>If value is set to <code>1</code>, indicates source is full range. Default value is
  155. <code>0</code>, which indicates source is limited range.
  156. </p>
  157. </dd>
  158. <dt><span><samp>dst_range <var>(boolean)</var></samp></span></dt>
  159. <dd><p>If value is set to <code>1</code>, enable full range for destination. Default value
  160. is <code>0</code>, which enables limited range.
  161. </p>
  162. <span id="sws_005fparams"></span></dd>
  163. <dt><span><samp>param0, param1</samp></span></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><span><samp>sws_dither</samp></span></dt>
  170. <dd><p>Set the dithering algorithm. Accepts one of the following
  171. values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
  172. </p>
  173. <dl compact="compact">
  174. <dt><span>&lsquo;<samp>auto</samp>&rsquo;</span></dt>
  175. <dd><p>automatic choice
  176. </p>
  177. </dd>
  178. <dt><span>&lsquo;<samp>none</samp>&rsquo;</span></dt>
  179. <dd><p>no dithering
  180. </p>
  181. </dd>
  182. <dt><span>&lsquo;<samp>bayer</samp>&rsquo;</span></dt>
  183. <dd><p>bayer dither
  184. </p>
  185. </dd>
  186. <dt><span>&lsquo;<samp>ed</samp>&rsquo;</span></dt>
  187. <dd><p>error diffusion dither
  188. </p>
  189. </dd>
  190. <dt><span>&lsquo;<samp>a_dither</samp>&rsquo;</span></dt>
  191. <dd><p>arithmetic dither, based using addition
  192. </p>
  193. </dd>
  194. <dt><span>&lsquo;<samp>x_dither</samp>&rsquo;</span></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><span><samp>alphablend</samp></span></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>none</samp>&rsquo;.
  204. </p>
  205. <dl compact="compact">
  206. <dt><span>&lsquo;<samp>uniform_color</samp>&rsquo;</span></dt>
  207. <dd><p>Blend onto a uniform background color
  208. </p>
  209. </dd>
  210. <dt><span>&lsquo;<samp>checkerboard</samp>&rsquo;</span></dt>
  211. <dd><p>Blend onto a checkerboard
  212. </p>
  213. </dd>
  214. <dt><span>&lsquo;<samp>none</samp>&rsquo;</span></dt>
  215. <dd><p>No blending
  216. </p>
  217. </dd>
  218. </dl>
  219. </dd>
  220. </dl>
  221. <a name="See-Also"></a>
  222. <h2 class="chapter">3 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  223. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  224. <a href="libswscale.html">libswscale</a>
  225. </p>
  226. <a name="Authors"></a>
  227. <h2 class="chapter">4 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  228. <p>The FFmpeg developers.
  229. </p>
  230. <p>For details about the authorship, see the Git history of the project
  231. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  232. <code>git log</code> in the FFmpeg source directory, or browsing the
  233. online repository at <a href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  234. </p>
  235. <p>Maintainers for the specific components are listed in the file
  236. <samp>MAINTAINERS</samp> in the source code tree.
  237. </p>
  238. </body>
  239. </html>