File size: 11,538 Bytes
a48938a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by , GNU Texinfo 7.1.1 -->
  <head>
    <meta charset="utf-8">
    <title>
      FFmpeg Scaler Documentation
    </title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="style.min.css">
  </head>
  <body>
    <div class="container">
      <h1>
      FFmpeg Scaler Documentation
      </h1>


<a name="SEC_Top"></a>

<div class="element-contents" id="SEC_Contents">
<h2 class="contents-heading">Table of Contents</h2>

<div class="contents">

<ul class="toc-numbered-mark">
  <li><a id="toc-Description" href="#Description">1 Description</a></li>
  <li><a id="toc-Scaler-Options" href="#Scaler-Options">2 Scaler Options</a></li>
  <li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
  <li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
</ul>
</div>
</div>

<a name="Description"></a>
<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>

<p>The FFmpeg rescaler provides a high-level interface to the libswscale
library image conversion utilities. In particular it allows one to perform
image rescaling and pixel format conversion.
</p>

<a class="anchor" id="scaler_005foptions"></a><a name="Scaler-Options"></a>
<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>

<p>The video scaler supports the following named options.
</p>
<p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
FFmpeg tools, with a few API-only exceptions noted below.
For programmatic use, they can be set explicitly in the
<code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
</p>
<dl class="table">
<dd>
<a class="anchor" id="scaler"></a></dd>
<dt><samp class="option">scaler, scaler_sub</samp></dt>
<dd><p>Choose the scaling algorithm to use. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo; for both.
It accepts the following values:
</p>
<dl class="table">
<dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
<dd><p>Aumotic choice. For &lsquo;<samp class="samp">scaler_sub</samp>&rsquo;, this means the same algorithm as
&lsquo;<samp class="samp">scaler</samp>&rsquo;. For &lsquo;<samp class="samp">scaler</samp>&rsquo;, this defaults to the scaler flag selected
by &lsquo;<samp class="samp">sws_flags</samp>&rsquo;.
</p>
</dd>
<dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
<dd><p>Bilinear filter. (AKA triangle filter)
</p>
</dd>
<dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
<dd><p>2-tap cubic BC-spline (AKA Mitchell-Netravali spline). The B and C parameters
can be configured by setting <code class="code">param0</code> and <code class="code">param1</code>, defaulting to
0.0 and 0.6 respectively.
</p>
</dd>
<dt>&lsquo;<samp class="samp">point, neighbor</samp>&rsquo;</dt>
<dd><p>Point sampling (AKA nearest neighbor).
</p>
</dd>
<dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
<dd><p>Area averaging. Equivalent to &lsquo;<samp class="samp">bilinear</samp>&rsquo; for upscaling.
</p>
</dd>
<dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
<dd><p>2-tap Gaussian filter approximation. The sharpness parameter can be configured
by setting <code class="code">param0</code>, defaulting to 3.0.
</p>
</dd>
<dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
<dd><p>Unwindowed sinc filter.
</p>
</dd>
<dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
<dd><p>Lanczos resampling (sinc windowed sinc). The number of filter taps can
be configured by setting <code class="code">param0</code>, defaulting to 3.
</p>
</dd>
<dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
<dd><p>Unwindowed natural bicubic spline.
</p></dd>
</dl>

<a class="anchor" id="sws_005fflags"></a></dd>
<dt><samp class="option">sws_flags</samp></dt>
<dd><p>Set the scaler flags. This is also used to set the scaling
algorithm, though this usage is deprecated in favor of setting &lsquo;<samp class="samp">scaler</samp>&rsquo;.
Only a single algorithm may be selected. Default value is &lsquo;<samp class="samp">bicubic</samp>&rsquo;.
</p>
<p>It accepts the following values:
</p><dl class="table">
<dt>&lsquo;<samp class="samp">fast_bilinear</samp>&rsquo;</dt>
<dd><p>Select fast bilinear scaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
<dd><p>Select bilinear scaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
<dd><p>Select bicubic scaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
<dd><p>Select experimental scaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">neighbor</samp>&rsquo;</dt>
<dd><p>Select nearest neighbor rescaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">area</samp>&rsquo;</dt>
<dd><p>Select averaging area rescaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">bicublin</samp>&rsquo;</dt>
<dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
chroma components. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
<dd><p>Select Gaussian rescaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">sinc</samp>&rsquo;</dt>
<dd><p>Select sinc rescaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
<dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
changed by setting <code class="code">param0</code>. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
<dd><p>Select natural bicubic spline rescaling algorithm. (Deprecated)
</p>
</dd>
<dt>&lsquo;<samp class="samp">print_info</samp>&rsquo;</dt>
<dd><p>Enable printing/debug logging.
</p>
</dd>
<dt>&lsquo;<samp class="samp">accurate_rnd</samp>&rsquo;</dt>
<dd><p>Enable accurate rounding.
</p>
</dd>
<dt>&lsquo;<samp class="samp">full_chroma_int</samp>&rsquo;</dt>
<dd><p>Enable full chroma interpolation.
</p>
</dd>
<dt>&lsquo;<samp class="samp">full_chroma_inp</samp>&rsquo;</dt>
<dd><p>Select full chroma input.
</p>
</dd>
<dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
<dd><p>Enable bitexact output.
</p>
</dd>
<dt>&lsquo;<samp class="samp">unstable</samp>&rsquo;</dt>
<dd><p>Allow the use of experimental new code. May subtly affect the output or even
produce wrong results. For testing only.
</p></dd>
</dl>

</dd>
<dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
<dd><p>Set source width.
</p>
</dd>
<dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
<dd><p>Set source height.
</p>
</dd>
<dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
<dd><p>Set destination width.
</p>
</dd>
<dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
<dd><p>Set destination height.
</p>
</dd>
<dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
<dd><p>Set source pixel format (must be expressed as an integer).
</p>
</dd>
<dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
<dd><p>Set destination pixel format (must be expressed as an integer).
</p>
</dd>
<dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
<dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
<code class="code">0</code>, which indicates source is limited range.
</p>
</dd>
<dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
<dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
is <code class="code">0</code>, which enables limited range.
</p>
</dd>
<dt><samp class="option">gamma <var class="var">(boolean)</var></samp></dt>
<dd><p>If value is set to <code class="code">1</code>, enable gamma correct scaling. Default value is <code class="code">0</code>.
</p>
<a class="anchor" id="sws_005fparams"></a></dd>
<dt><samp class="option">param0, param1</samp></dt>
<dd><p>Set scaling algorithm parameters. The specified values are specific of
some scaling algorithms and ignored by others. The specified values
are floating point number values.
</p>
</dd>
<dt><samp class="option">sws_dither</samp></dt>
<dd><p>Set the dithering algorithm. Accepts one of the following
values. Default value is &lsquo;<samp class="samp">auto</samp>&rsquo;.
</p>
<dl class="table">
<dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
<dd><p>automatic choice
</p>
</dd>
<dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
<dd><p>no dithering
</p>
</dd>
<dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
<dd><p>bayer dither
</p>
</dd>
<dt>&lsquo;<samp class="samp">ed</samp>&rsquo;</dt>
<dd><p>error diffusion dither
</p>
</dd>
<dt>&lsquo;<samp class="samp">a_dither</samp>&rsquo;</dt>
<dd><p>arithmetic dither, based using addition
</p>
</dd>
<dt>&lsquo;<samp class="samp">x_dither</samp>&rsquo;</dt>
<dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
a_dither).
</p>
</dd>
</dl>

</dd>
<dt><samp class="option">alphablend</samp></dt>
<dd><p>Set the alpha blending to use when the input has alpha but the output does not.
Default value is &lsquo;<samp class="samp">none</samp>&rsquo;.
</p>
<dl class="table">
<dt>&lsquo;<samp class="samp">uniform_color</samp>&rsquo;</dt>
<dd><p>Blend onto a uniform background color
</p>
</dd>
<dt>&lsquo;<samp class="samp">checkerboard</samp>&rsquo;</dt>
<dd><p>Blend onto a checkerboard
</p>
</dd>
<dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
<dd><p>No blending
</p>
</dd>
</dl>

</dd>
</dl>


<a name="See-Also"></a>
<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>

<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>,
<a class="url" href="libswscale.html">libswscale</a>
</p>

<a name="Authors"></a>
<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>

<p>The FFmpeg developers.
</p>
<p>For details about the authorship, see the Git history of the project
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
</p>
<p>Maintainers for the specific components are listed in the file
<samp class="file">MAINTAINERS</samp> in the source code tree.
</p>

      <p style="font-size: small;">
        This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
      </p>
    </div>
  </body>
</html>