codekingpro/portable-devtools
114k
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 Documentation8 </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 Documentation17 </h1>18 19 20<a name="SEC_Top"></a>21 22<div class="element-contents" id="SEC_Contents">23<h2 class="contents-heading">Table of Contents</h2>24 25<div class="contents">26 27<ul class="toc-numbered-mark">28 <li><a id="toc-Description" href="#Description">1 Description</a></li>29 <li><a id="toc-Scaler-Options" href="#Scaler-Options">2 Scaler Options</a></li>30 <li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>31 <li><a id="toc-Authors" href="#Authors">4 Authors</a></li>32</ul>33</div>34</div>35 36<a name="Description"></a>37<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>38 39<p>The FFmpeg rescaler provides a high-level interface to the libswscale40library image conversion utilities. In particular it allows one to perform41image rescaling and pixel format conversion.42</p>43 44<a class="anchor" id="scaler_005foptions"></a><a name="Scaler-Options"></a>45<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>46 47<p>The video scaler supports the following named options.48</p>49<p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the50FFmpeg tools, with a few API-only exceptions noted below.51For programmatic use, they can be set explicitly in the52<code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.53</p>54<dl class="table">55<dd>56<a class="anchor" id="scaler"></a></dd>57<dt><samp class="option">scaler, scaler_sub</samp></dt>58<dd><p>Choose the scaling algorithm to use. Default value is ‘<samp class="samp">auto</samp>’ for both.59It accepts the following values:60</p>61<dl class="table">62<dt>‘<samp class="samp">auto</samp>’</dt>63<dd><p>Aumotic choice. For ‘<samp class="samp">scaler_sub</samp>’, this means the same algorithm as64‘<samp class="samp">scaler</samp>’. For ‘<samp class="samp">scaler</samp>’, this defaults to the scaler flag selected65by ‘<samp class="samp">sws_flags</samp>’.66</p>67</dd>68<dt>‘<samp class="samp">bilinear</samp>’</dt>69<dd><p>Bilinear filter. (AKA triangle filter)70</p>71</dd>72<dt>‘<samp class="samp">bicubic</samp>’</dt>73<dd><p>2-tap cubic BC-spline (AKA Mitchell-Netravali spline). The B and C parameters74can be configured by setting <code class="code">param0</code> and <code class="code">param1</code>, defaulting to750.0 and 0.6 respectively.76</p>77</dd>78<dt>‘<samp class="samp">point, neighbor</samp>’</dt>79<dd><p>Point sampling (AKA nearest neighbor).80</p>81</dd>82<dt>‘<samp class="samp">area</samp>’</dt>83<dd><p>Area averaging. Equivalent to ‘<samp class="samp">bilinear</samp>’ for upscaling.84</p>85</dd>86<dt>‘<samp class="samp">gaussian</samp>’</dt>87<dd><p>2-tap Gaussian filter approximation. The sharpness parameter can be configured88by setting <code class="code">param0</code>, defaulting to 3.0.89</p>90</dd>91<dt>‘<samp class="samp">sinc</samp>’</dt>92<dd><p>Unwindowed sinc filter.93</p>94</dd>95<dt>‘<samp class="samp">lanczos</samp>’</dt>96<dd><p>Lanczos resampling (sinc windowed sinc). The number of filter taps can97be configured by setting <code class="code">param0</code>, defaulting to 3.98</p>99</dd>100<dt>‘<samp class="samp">spline</samp>’</dt>101<dd><p>Unwindowed natural bicubic spline.102</p></dd>103</dl>104 105<a class="anchor" id="sws_005fflags"></a></dd>106<dt><samp class="option">sws_flags</samp></dt>107<dd><p>Set the scaler flags. This is also used to set the scaling108algorithm, though this usage is deprecated in favor of setting ‘<samp class="samp">scaler</samp>’.109Only a single algorithm may be selected. Default value is ‘<samp class="samp">bicubic</samp>’.110</p>111<p>It accepts the following values:112</p><dl class="table">113<dt>‘<samp class="samp">fast_bilinear</samp>’</dt>114<dd><p>Select fast bilinear scaling algorithm. (Deprecated)115</p>116</dd>117<dt>‘<samp class="samp">bilinear</samp>’</dt>118<dd><p>Select bilinear scaling algorithm. (Deprecated)119</p>120</dd>121<dt>‘<samp class="samp">bicubic</samp>’</dt>122<dd><p>Select bicubic scaling algorithm. (Deprecated)123</p>124</dd>125<dt>‘<samp class="samp">experimental</samp>’</dt>126<dd><p>Select experimental scaling algorithm. (Deprecated)127</p>128</dd>129<dt>‘<samp class="samp">neighbor</samp>’</dt>130<dd><p>Select nearest neighbor rescaling algorithm. (Deprecated)131</p>132</dd>133<dt>‘<samp class="samp">area</samp>’</dt>134<dd><p>Select averaging area rescaling algorithm. (Deprecated)135</p>136</dd>137<dt>‘<samp class="samp">bicublin</samp>’</dt>138<dd><p>Select bicubic scaling algorithm for the luma component, bilinear for139chroma components. (Deprecated)140</p>141</dd>142<dt>‘<samp class="samp">gauss</samp>’</dt>143<dd><p>Select Gaussian rescaling algorithm. (Deprecated)144</p>145</dd>146<dt>‘<samp class="samp">sinc</samp>’</dt>147<dd><p>Select sinc rescaling algorithm. (Deprecated)148</p>149</dd>150<dt>‘<samp class="samp">lanczos</samp>’</dt>151<dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be152changed by setting <code class="code">param0</code>. (Deprecated)153</p>154</dd>155<dt>‘<samp class="samp">spline</samp>’</dt>156<dd><p>Select natural bicubic spline rescaling algorithm. (Deprecated)157</p>158</dd>159<dt>‘<samp class="samp">print_info</samp>’</dt>160<dd><p>Enable printing/debug logging.161</p>162</dd>163<dt>‘<samp class="samp">accurate_rnd</samp>’</dt>164<dd><p>Enable accurate rounding.165</p>166</dd>167<dt>‘<samp class="samp">full_chroma_int</samp>’</dt>168<dd><p>Enable full chroma interpolation.169</p>170</dd>171<dt>‘<samp class="samp">full_chroma_inp</samp>’</dt>172<dd><p>Select full chroma input.173</p>174</dd>175<dt>‘<samp class="samp">bitexact</samp>’</dt>176<dd><p>Enable bitexact output.177</p>178</dd>179<dt>‘<samp class="samp">unstable</samp>’</dt>180<dd><p>Allow the use of experimental new code. May subtly affect the output or even181produce wrong results. For testing only.182</p></dd>183</dl>184 185</dd>186<dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>187<dd><p>Set source width.188</p>189</dd>190<dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>191<dd><p>Set source height.192</p>193</dd>194<dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>195<dd><p>Set destination width.196</p>197</dd>198<dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>199<dd><p>Set destination height.200</p>201</dd>202<dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>203<dd><p>Set source pixel format (must be expressed as an integer).204</p>205</dd>206<dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>207<dd><p>Set destination pixel format (must be expressed as an integer).208</p>209</dd>210<dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>211<dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is212<code class="code">0</code>, which indicates source is limited range.213</p>214</dd>215<dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>216<dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value217is <code class="code">0</code>, which enables limited range.218</p>219</dd>220<dt><samp class="option">gamma <var class="var">(boolean)</var></samp></dt>221<dd><p>If value is set to <code class="code">1</code>, enable gamma correct scaling. Default value is <code class="code">0</code>.222</p>223<a class="anchor" id="sws_005fparams"></a></dd>224<dt><samp class="option">param0, param1</samp></dt>225<dd><p>Set scaling algorithm parameters. The specified values are specific of226some scaling algorithms and ignored by others. The specified values227are floating point number values.228</p>229</dd>230<dt><samp class="option">sws_dither</samp></dt>231<dd><p>Set the dithering algorithm. Accepts one of the following232values. Default value is ‘<samp class="samp">auto</samp>’.233</p>234<dl class="table">235<dt>‘<samp class="samp">auto</samp>’</dt>236<dd><p>automatic choice237</p>238</dd>239<dt>‘<samp class="samp">none</samp>’</dt>240<dd><p>no dithering241</p>242</dd>243<dt>‘<samp class="samp">bayer</samp>’</dt>244<dd><p>bayer dither245</p>246</dd>247<dt>‘<samp class="samp">ed</samp>’</dt>248<dd><p>error diffusion dither249</p>250</dd>251<dt>‘<samp class="samp">a_dither</samp>’</dt>252<dd><p>arithmetic dither, based using addition253</p>254</dd>255<dt>‘<samp class="samp">x_dither</samp>’</dt>256<dd><p>arithmetic dither, based using xor (more random/less apparent patterning that257a_dither).258</p>259</dd>260</dl>261 262</dd>263<dt><samp class="option">alphablend</samp></dt>264<dd><p>Set the alpha blending to use when the input has alpha but the output does not.265Default value is ‘<samp class="samp">none</samp>’.266</p>267<dl class="table">268<dt>‘<samp class="samp">uniform_color</samp>’</dt>269<dd><p>Blend onto a uniform background color270</p>271</dd>272<dt>‘<samp class="samp">checkerboard</samp>’</dt>273<dd><p>Blend onto a checkerboard274</p>275</dd>276<dt>‘<samp class="samp">none</samp>’</dt>277<dd><p>No blending278</p>279</dd>280</dl>281 282</dd>283</dl>284 285 286<a name="See-Also"></a>287<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>288 289<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>,290<a class="url" href="libswscale.html">libswscale</a>291</p>292 293<a name="Authors"></a>294<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>295 296<p>The FFmpeg developers.297</p>298<p>For details about the authorship, see the Git history of the project299(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command300<code class="command">git log</code> in the FFmpeg source directory, or browsing the301online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.302</p>303<p>Maintainers for the specific components are listed in the file304<samp class="file">MAINTAINERS</samp> in the source code tree.305</p>306 307 <p style="font-size: small;">308 This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.309 </p>310 </div>311 </body>312</html>313 