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