ffmpeg-scaler.html 7.8 KB

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