<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Soreepeong</id>
		<title>Avisynth wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Soreepeong"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Special:Contributions/Soreepeong"/>
		<updated>2026-04-07T22:37:47Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php/DeBarrel</id>
		<title>DeBarrel</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/DeBarrel"/>
				<updated>2019-06-19T13:11:49Z</updated>
		
		<summary type="html">&lt;p&gt;Soreepeong: Removed space between negative sign and actual number (Between - 0.5 to 0.5 -&amp;gt; Between -0.5 to 0.5)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{{FilterCat4|External_filters|Plugins|Adjustment_filters|Transformation}}&lt;br /&gt;
&lt;br /&gt;
{{Filter3&lt;br /&gt;
|1=&amp;lt;!-- author --&amp;gt;[http://www.avisynth.nl/users/vcmohan/ V.C.Mohan]&lt;br /&gt;
|2=&amp;lt;!-- version --&amp;gt;30 Dec 2016&lt;br /&gt;
|3= [http://www.avisynth.nl/users/vcmohan/movePlus/movePlus.7z movePlus.7z]&lt;br /&gt;
|4= External filters&lt;br /&gt;
|5= [https://www.gnu.org/licenses/gpl-3.0.en.html GPLv3]&lt;br /&gt;
|6=&amp;lt;!-- discussion URL --&amp;gt;[https://forum.doom9.org/showthread.php?t=136083&amp;amp;highlight=DeBarrel Original DeBarrel plugin], [https://forum.doom9.org/showthread.php?t=174163 movePlus]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;!-- a one-sentence description --&amp;gt;&lt;br /&gt;
Corrects Barrel type or Pin Cushion type distortions in an image that result in due to camera lens projecting image on to a flat film or sensor array. [http://www.avisynth.nl/users/vcmohan/movePlus/Barrel.html Full Description]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* AviSynth+ r2347 or later&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
:{{Template:FuncDef| Barrel (clip, float &amp;quot;a&amp;quot;, float &amp;quot;b&amp;quot;, float &amp;quot;c&amp;quot;, bool &amp;quot;pin&amp;quot;, float &amp;quot;vh&amp;quot;, bool &amp;quot;test&amp;quot;, float &amp;quot;ea&amp;quot;, float &amp;quot;eb&amp;quot;, float &amp;quot;ec&amp;quot;, int &amp;quot;nsteps&amp;quot;, Int &amp;quot;frame&amp;quot;, Int &amp;quot;color&amp;quot;, bool &amp;quot;ind&amp;quot;, bool &amp;quot;ypin&amp;quot;, float &amp;quot;ya&amp;quot;, float &amp;quot;yb&amp;quot;, float &amp;quot;yc&amp;quot;, float &amp;quot;yea&amp;quot;, float &amp;quot;yeb&amp;quot;, float &amp;quot;yec&amp;quot;)}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2| |clip| }}&lt;br /&gt;
::: Input clip&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|a|float|0.005}}&lt;br /&gt;
::: Coefficient a (xa in independent mode and start val in test mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|b|float|0.005}}&lt;br /&gt;
::: Coefficient b (xb in independent mode and start val in test mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|c|float|0.005}}&lt;br /&gt;
::: Coefficient c (xc in independent mode and start val in test mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|pin|bool|false}}&lt;br /&gt;
::: Whether to correct pin cushion or barrel type distortion&lt;br /&gt;
::::* true = pin&lt;br /&gt;
::::* false = barrel&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|vh|bool|1.0}}&lt;br /&gt;
::: Vertical to horizontal distortion ratio&lt;br /&gt;
::::* Between 0.1 and 10&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|test|bool|false}}&lt;br /&gt;
::: Whether in test mode&lt;br /&gt;
::::* true = test&lt;br /&gt;
::::* false = normal&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|ea|float|0.05}}&lt;br /&gt;
::: End value of coefficient a in test mode (xea in independent mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|eb|float|0.05}}&lt;br /&gt;
::: End value of coefficient b in test mode (xeb in independent mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|ec|float|0.05}}&lt;br /&gt;
::: End value of coefficient c in test mode (xec in independent mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|nsteps|int|20}}&lt;br /&gt;
::: Number of steps for variation (test mode only)&lt;br /&gt;
::::* Between 0 and 100&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|frame|Int|0}}&lt;br /&gt;
::: Input frame number for over lay (test mode only)&lt;br /&gt;
::::* Within input clip&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|color|Int|0}}&lt;br /&gt;
::: Color of dots in test mode and left out borders in normal&lt;br /&gt;
::::* In RRGGBB format&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|ind|bool|false}}&lt;br /&gt;
::: Whether x and y have independent coefficients&lt;br /&gt;
::::* true for independent&lt;br /&gt;
::::* false for pin cushion or barrel&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|ypin|bool|false}}&lt;br /&gt;
::: Whether Y direction has pin cushion distortion?&lt;br /&gt;
::::* true for pin cushion&lt;br /&gt;
::::* false for barrel&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|ya|float|0.05}}&lt;br /&gt;
::: Value of coefficient ya (start value in test mode )&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|yb|float|0.05}}&lt;br /&gt;
::: Value of coefficient yb (start value in test mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|yc|float|0.05}}&lt;br /&gt;
::: Value of coefficient yc (start value in test mode)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|yea|float|0.05}}&lt;br /&gt;
::: End value of coefficient ya (test mode only)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|yeb|float|0.05}}&lt;br /&gt;
::: End value of coefficient yb (test mode only)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::{{Par2|yec|float|0.05}}&lt;br /&gt;
::: End value of coefficient yc (test mode only)&lt;br /&gt;
::::* Between -0.5 and 0.5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;!-- example code block: 1st char in each line = space --&amp;gt;&lt;br /&gt;
 blankclip(width = 720, height = 480, pixel_type = &amp;quot;RGB32&amp;quot;, color = $ffffff, length = 10)&lt;br /&gt;
 grid()&lt;br /&gt;
 Barrel()&lt;br /&gt;
&lt;br /&gt;
Pin Cushion Distortion&lt;br /&gt;
 Barrel(a = 0.005, b = 0.005, c = 0.005, pin = false)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>Soreepeong</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/AnimeIVTC</id>
		<title>AnimeIVTC</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/AnimeIVTC"/>
				<updated>2016-12-08T03:57:05Z</updated>
		
		<summary type="html">&lt;p&gt;Soreepeong: Add &amp;quot;IVTC&amp;quot; Category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Filter&lt;br /&gt;
|thetoof&lt;br /&gt;
|2.00&lt;br /&gt;
|[[http://forum.doom9.org/showthread.php?t=138305&amp;amp;highlight=AnimeIVTC| Doom9 Thread (original)]][[http://forum.doom9.org/showthread.php?p=1673928| Doom9 Thread (mod)]]&lt;br /&gt;
|[[:Category:IVTC|IVTC]] &amp;amp; [[:Category:Decimation|Decimation]]&lt;br /&gt;
|&lt;br /&gt;
|[[http://creativecommons.org/licenses/by-sa/3.0/| CreativeCommons BY-SA 3.0]]}}&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;'''Author:''' thetoof&amp;lt;br /&amp;gt;'''Version:''' 2.00&amp;lt;br /&amp;gt;'''Discussion:''' [http://forum.doom9.org/showthread.php?t=138305 forum.doom9.org]&amp;lt;br /&amp;gt;'''Category:''' IVTC &amp;amp;amp; Decimation&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Requirements: ===&lt;br /&gt;
&amp;lt;br /&amp;gt;Put all the .dll/.avsi in the &amp;quot;plugins&amp;quot; folder of avisynth. You can get them all [[#V.29_Download|here]].&lt;br /&gt;
&lt;br /&gt;
* TIVTC, TDeint and TMM by tritical [http://forum.doom9.org/showthread.php?t=82264 link]&lt;br /&gt;
* nnEDI2 by tritical [http://forum.doom9.org/showthread.php?t=147695 link]&lt;br /&gt;
* nnEDI3&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; by tritical [http://forum.doom9.org/showthread.php?t=147695 link] or for avs 2.6 [http://forum.doom9.org/showthread.php?t=170083 link]&lt;br /&gt;
* EEDI2 by tritical, multithreaded version by foxyshadis [http://web.missouri.edu/~kes25c/ link]&lt;br /&gt;
* EEDI3&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; by tritical [[Eedi3|link]]&lt;br /&gt;
* yadifmod by tritical [http://avisynth.org.ru/yadif/yadif.html link]&lt;br /&gt;
* TGMCmod by thetoof (in 7z archive), original version by Didée here - [http://forum.doom9.org/showthread.php?p=1158000#post1158000 link]&lt;br /&gt;
* QTGMC&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; by -Vit- - [[QTGMC|link]]&lt;br /&gt;
* MVTools2 by Fizick [[MVTools|link]]&lt;br /&gt;
* RemoveGrain and Repair by kassandro [[RemoveGrain|link]]&lt;br /&gt;
* MaskTools by Manao [[MaskTools|link]]&lt;br /&gt;
* MaskTools2 by Manao  [[MaskTools2|link]]&lt;br /&gt;
* Vinverse by tritical (original script by Didée) [http://bengal.missouri.edu/~kes25c/vinverse.zip link]&lt;br /&gt;
* MedianBlur by tsp [http://www.avisynth.nl/users/tsp/|link]&lt;br /&gt;
* srestore by MOmonster [[Srestore|link]]&lt;br /&gt;
* Average by mg262 [http://forum.doom9.org/showthread.php?p=1129919#post1129919 link]&lt;br /&gt;
* ReduceFlicker by kassandro [http://home.arcor.de/kassandro/ReduceFlicker/ReduceFlicker.htm link]&lt;br /&gt;
* SangNom by MarcFD [[SangNom|link]]&lt;br /&gt;
* Toon by Soulhunter (original script by mf, speedups by Didée) [http://forum.doom9.org/showthread.php?t=131454 link]&lt;br /&gt;
* Lsfmod by LaTo [http://avisynth.org/mediawiki/LSFmod link], original version by Didée here [http://avisynth.org/mediawiki/LimitedSharpen link]&lt;br /&gt;
* aWarpSharp and Toon rewrites by SEt [http://forum.doom9.org/showthread.php?t=147285 link]&lt;br /&gt;
* Microsoft Visual C [http://www.microsoft.com/downloads/details.aspx?FamilyID=200b2fd9-ae1a-4a14-984d-389c36f85647&amp;amp;DisplayLang=en link]&lt;br /&gt;
* AvsRecursion by kassandro (put in your system32 folder for 32-bit systems... or SysWOW64 for 64-bit systems) [http://home.arcor.de/kassandro/AvsRecursion/AvsRecursion.htm link]&lt;br /&gt;
* daa3&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; [http://avisynth.nl/images/Daa3.avsi]&lt;br /&gt;
* and of course, AnimeIVTC by thetoof ;-)&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; required for mod ver..&lt;br /&gt;
&lt;br /&gt;
== I) About anime telecining ==&lt;br /&gt;
&lt;br /&gt;
# Particularities of anime:&lt;br /&gt;
- While a film is shot at 24 frames per second (fps), anime is animated at 24fps so there is not necessarily motion on every frame.&lt;br /&gt;
- When there is not a lot of movement, it can be displayed at lower framerates like 8 or 12 fps with duplicate(s) of every frame to maintain a constant framerate of 24fps.&lt;br /&gt;
- To create the illusion of faster movement, different parts of the image can move at different framerates. In this situation, the image is divided into 2 parts and there are many possible combinations of &amp;quot;intra-frame variable framerate&amp;quot;. This is not constant throughout the episode/movie since it changes depending on the amount of motion to be displayed.&lt;br /&gt;
- CG animation at 30 fps is sometimes used in anime, so you can also have sequences with movement on every frame without any interlacing nor blends.&lt;br /&gt;
- The credits can be truly interlaced to make them run faster without being juddery and unreadable, thus leaving more room for the show.&lt;br /&gt;
- The credits can also be at the full progressive framerate on top of the telecined background.&lt;br /&gt;
&lt;br /&gt;
# Basic concepts:&lt;br /&gt;
Soft telecine - the stream is encoded at 24 fps and the pulldown is applied during playback.&lt;br /&gt;
Hard telecine - your source was telecined before being encoded on the DVD (or before airing).&lt;br /&gt;
Double hard telecine - your source has at least one of the &amp;quot;intra-frame variable framerate&amp;quot; situations and the telecining was applied separately on each part of the frame, so the pattern is not constant and many frames are interlaced.&lt;br /&gt;
Field blended norm-conversion - Instead of going back to 24fps (film rate), the video streams are directly converted from NTSC (29.97fps) to PAL (25fps) or vice versa, creating ugly fieldblending (looks like DHT when inspecting a frame).&lt;br /&gt;
Hybrid - mix of 24t (24 fps displayed at 30 through telecining) and 30p (progressive movement on every frame)&lt;br /&gt;
Truly interlaced - each frame contains half the information of two frames, which means that you can bob it to 60p and see movement on every single frame, without any interlacing or blending.&lt;br /&gt;
Progressive - No interlacing whatsoever at the full framerate.&lt;br /&gt;
3:2 pattern - This pattern repeats itself from the very beginning to the very end of your clip: 3 progressive frames followed by 2 interlaced ones.&lt;br /&gt;
VFR - Variable Frame Rate - The sections of the clip run at different framerates, thus allowing to have less frames for the same movement. The duplicates are removed and played during the same amount of time as if there was the original amount of frames.&lt;br /&gt;
Lossless rendering pass - Save the file as uncompressed YV12 or Lagarith to apply the script only once and make subsequent filtering/encoding faster. It takes a lot of disk space: around 5GB for a 22 minutes clip @ 23.976fps with Lagarith and 20GB with uncompressed YV12.&lt;br /&gt;
&lt;br /&gt;
# Examples:&lt;br /&gt;
Double Hard Telecine - At first, your source may look like a typical Hard Telecined one, but after a more thorough inspection, you'll see that it's actually a DHT one: same source, different high motion scene.&lt;br /&gt;
Interlaced on top of telecined (can be hard or double hard) - In this case, it was a hard telecined source. Image&lt;br /&gt;
Obviously, since there's no pattern in DHT and interlacing on every frame with pure interlaced material, regular IVTC will output blends and jerkiness.&lt;br /&gt;
&lt;br /&gt;
Apply TComb ''before ''AnimeIVTC if you need to correct dotcrawl.&lt;br /&gt;
&lt;br /&gt;
It is NOT&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; recommended to use animeivtc with multithreading and/or calling it multiple times in a script. If you want to multithread it, see the [[#examples example scripts|examples example scripts]] below.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; can be done in mention cases [http://forum.doom9.org/showthread.php?p=1673928 here].&lt;br /&gt;
&lt;br /&gt;
== II) Function descriptions ==&lt;br /&gt;
&lt;br /&gt;
* [[#General settings|General settings]]&lt;br /&gt;
* [[#Interlaced or progressive credits|Interlaced or progressive credits]]&lt;br /&gt;
* [[#Mode=1 (Hard telecined)|Mode=1 (Hard telecined)]]&lt;br /&gt;
* [[#Mode=2 (Field-blended)|Mode=2 (Field-blended)]]&lt;br /&gt;
* [[#Mode=3 (Double hard telecined)|Mode=3 (Double hard telecined)]]&lt;br /&gt;
* [[#hybrid Mode=4 (Hybrid)|hybrid Mode=4 (Hybrid)]]&lt;br /&gt;
&amp;lt;code&amp;gt;AnimeIVTC&amp;lt;/code&amp;gt; (&amp;lt;var&amp;gt;clip i, int &amp;quot;mode&amp;quot;, int &amp;quot;aa&amp;quot;, int &amp;quot;precision&amp;quot;, int &amp;quot;killcomb&amp;quot;, int &amp;quot;cache&amp;quot;, bool &amp;quot;ifade&amp;quot;, float &amp;quot;sfthr&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;, bool &amp;quot;sfshow&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;chrfix&amp;quot; , bool &amp;quot;blend&amp;quot; , bool &amp;quot;normconv&amp;quot; , int &amp;quot;pattern&amp;quot; , int &amp;quot;pass&amp;quot;, bool &amp;quot;rendering&amp;quot; , int &amp;quot;bbob&amp;quot;, int &amp;quot;cbob&amp;quot;, string &amp;quot;edimode&amp;quot;, int &amp;quot;degrain&amp;quot;, int &amp;quot;omode&amp;quot; , int &amp;quot;cthresh&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;blockx&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;blocky&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;MI&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;tfmm&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;pp&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;metric&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;micmatching&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;i1&amp;quot;, int &amp;quot;i2&amp;quot;, int &amp;quot;e1&amp;quot;, int &amp;quot;e2&amp;quot;, int &amp;quot;e3&amp;quot;, int &amp;quot;p1&amp;quot;, int &amp;quot;p2&amp;quot; , bool &amp;quot;dchr&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;palf&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;tcfv1&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;nvfr&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;real30p&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;autoAssuf&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;ediandnn&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;o3025cfr&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , int &amp;quot;overlap&amp;quot;, int &amp;quot;pel&amp;quot;, int &amp;quot;search&amp;quot;, bool &amp;quot;nnedi3pel&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;**&amp;lt;/span&amp;gt; , string &amp;quot;credconv&amp;quot; , bool &amp;quot;mode22&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , clip &amp;quot;ediext&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , string &amp;quot;bob4p&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , clip &amp;quot;extbob&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , string &amp;quot;extbobf&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , bool &amp;quot;repwithtdeint&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; , float &amp;quot;dark&amp;quot;, int &amp;quot;thin&amp;quot;, int &amp;quot;sharp&amp;quot;, int &amp;quot;smooth&amp;quot;, bool &amp;quot;stabilize&amp;quot;, int &amp;quot;tradius&amp;quot;, int &amp;quot;aapel&amp;quot;, int &amp;quot;aaov&amp;quot;, int &amp;quot;aablk&amp;quot;, string &amp;quot;aatype&amp;quot;&amp;lt;/var&amp;gt;)&lt;br /&gt;
: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; in mod ver. only.&lt;br /&gt;
: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;**&amp;lt;/span&amp;gt; nnedi2pel in original ver..&lt;br /&gt;
=== General parameters ===&lt;br /&gt;
&amp;lt;var&amp;gt;mode&amp;lt;/var&amp;gt; : Required parameter. Defines the function's behavior&lt;br /&gt;
** 1 : Hard telecined&lt;br /&gt;
** 2 : Field blended&lt;br /&gt;
** 3 : Double hard telecine&lt;br /&gt;
** 4 : Hybrid&lt;br /&gt;
''chrfix'' : Use to correct chroma swap between fields (to find out, apply bob() on your clip and examine the frames. If at some point the chroma of a frame is in the other and vice-versa, the issue is present).&lt;br /&gt;
** True&lt;br /&gt;
** False (default)&lt;br /&gt;
''ifade'' : Detects and corrects interlaced fade-ins. Use for mode=1 or 4 since the clip is bobbed in mode=2 and 3.&lt;br /&gt;
** True&lt;br /&gt;
** False (default for speed concerns, but enabling it can be safer)&lt;br /&gt;
&amp;lt;var&amp;gt;ediandnn&amp;lt;/var&amp;gt; : to chose method. it's almost only about quality vs speed.&lt;br /&gt;
** 1 : nnedi3 (default)&lt;br /&gt;
** 2 : eedi3&lt;br /&gt;
** 3 : eedi3+nnedi3&lt;br /&gt;
''cache'' : Sets amount of frames to cache for all functions using scriptclip to prevent seeking issues frame order mess-up with temporal filters. Using too much will result in crashing, so use less if you get memory issues.&lt;br /&gt;
** 0 to inf. (default=10)&lt;br /&gt;
&amp;lt;var&amp;gt;killcomb&amp;lt;/var&amp;gt; : Removes any residual combing. Use for mode=1 or 4 since the clip is bobbed in mode=2 and 3.&lt;br /&gt;
** 0 : No combing removal (default)&lt;br /&gt;
** 1 : Combing removal with vinverse()&lt;br /&gt;
** 2 : Slower, but more aggressive combing removal by using mcbob's method&lt;br /&gt;
** 3 : Even slower, but better detail preservation and sharpness. Same as aa=3 [daa()]&lt;br /&gt;
&amp;lt;var&amp;gt;aa&amp;lt;/var&amp;gt; : Antialiasing. None is necessarily better than the others, but one is more adapted to your needs.&lt;br /&gt;
[Images/aliased.jpg without][Images/anti-aliasing.jpg with]&lt;br /&gt;
** -1: Compare by interleaving the different aa options&lt;br /&gt;
** 0 : No aa&lt;br /&gt;
** 1 : EEDI2() based aa [can be called externally as ediaa()]&lt;br /&gt;
** 2 : Average of a spatial interpolations of each fields contra-sharpening [can be called externally as daa()]&lt;br /&gt;
** 3 : Edge targeted Sangnom() aa leaving the rest of the frame untouched - watch out for detail loss... if you can spare some additionnal processing time, take a look at aa=4 [can be called externally as maa()]&lt;br /&gt;
** 4 : Line darkening, warp sharpening, edge targeted aa, limited sharpening and temporal stabilizing [can be called externally as SharpAAMCmod()]&lt;br /&gt;
'''The following options are meant for aa=4''' [SharpAAMCmod()]&lt;br /&gt;
&amp;lt;var&amp;gt;aatype&amp;lt;/var&amp;gt; : Select the filter used for aa&lt;br /&gt;
** &amp;quot;Sangnom&amp;quot; (default)&lt;br /&gt;
** &amp;quot;EEDI2&amp;quot; (slower, but sometimes has better detail preservation than Sangnom)&lt;br /&gt;
&amp;lt;var&amp;gt;dark&amp;lt;/var&amp;gt; : Line darkening strength by using Toon&lt;br /&gt;
** 0 to 1 (default=0.2)&lt;br /&gt;
&amp;lt;var&amp;gt;thin&amp;lt;/var&amp;gt; : Higher = thinner lines by using warpsharp&lt;br /&gt;
** default = 10&lt;br /&gt;
&amp;lt;var&amp;gt;sharp&amp;lt;/var&amp;gt; : Post-sharpening strength of LSFmod&lt;br /&gt;
** 0 to inf. (default = 150)&lt;br /&gt;
&amp;lt;var&amp;gt;smooth&amp;lt;/var&amp;gt; : Post-softening strength of LSFmod&lt;br /&gt;
** 0 to 100 (default = 100)&lt;br /&gt;
** -1 = The function will (try to) autocalculate a good value&lt;br /&gt;
&amp;lt;var&amp;gt;stabilize&amp;lt;/var&amp;gt; : Edge stabilizing through motion compensation with MDegrain's temporal averaging - use if the edges are unstable (trembling, flickering...) or as a edge-directed smart soothe().&lt;br /&gt;
** True&lt;br /&gt;
** False (default)&lt;br /&gt;
&amp;lt;var&amp;gt;tradius&amp;lt;/var&amp;gt; : Temporal radius (# of frames*2 1) of the stabilization.&lt;br /&gt;
** 0 to 3 (default=2)&lt;br /&gt;
&amp;lt;var&amp;gt;aapel&amp;lt;/var&amp;gt; : Supersampling factor for motion vector calculations when using stabilize=true. Higner = better, but slower&lt;br /&gt;
** 1, 2 or 4 (default=1)&lt;br /&gt;
&amp;lt;var&amp;gt;aablk&amp;lt;/var&amp;gt; : Size of the blocks for motion vector calculations when using stabilize=true. Larger blocks are less sensitive to noise, are faster, but also less accurate.&lt;br /&gt;
** 4, 8 or 16 (default=8 for SD and 16 for HD)&lt;br /&gt;
&amp;lt;var&amp;gt;aaov&amp;lt;/var&amp;gt; : Overlap of the blocks for motion vector calculation when using stabilize=true. Higner = better, but slower&lt;br /&gt;
** Must be even and up to half &amp;lt;var&amp;gt;aablk&amp;lt;/var&amp;gt; (default=4 for SD and 8 for HD)&lt;br /&gt;
&lt;br /&gt;
=== Interlaced or progressive credits ===&lt;br /&gt;
&amp;lt;var&amp;gt;i1/i2/p1/p2/e1/e2/e3&amp;lt;/var&amp;gt; : Give the frame numbers to the function so that each section is processed correctly. Use your '''source''''s frame numbers. You do not have to specify all of them. Example - a bit of the telecined episode interlaced opening credits episode progressive ending credits next episode preview. Use ''e1=w,i1=x,e2=y,p1=z,e3=a''.&lt;br /&gt;
** ''i1'' Last frame of the 1st interlaced section of the clip&lt;br /&gt;
** ''i2'' Last frame of the 2nd interlaced section of the clip&lt;br /&gt;
** ''p1'' Last frame of the 1st progressive section of the clip&lt;br /&gt;
** ''p2'' Last frame of the 2nd progressive section of the clip&lt;br /&gt;
** ''e1'' Last frame of the 1st telecined/double hard telecined/field blended/hybrid section of the clip&lt;br /&gt;
** ''e2'' Last frame of the 2nd telecined/double hard telecined/field blended/hybrid section of the clip&lt;br /&gt;
** ''e3'' Last frame of the 3rd telecined/double hard telecined/field blended/hybrid section of the clip&lt;br /&gt;
&amp;lt;var&amp;gt;omode&amp;lt;/var&amp;gt; : Determines the output framerate&lt;br /&gt;
** 1 : Converts the credits to the framerate of the episode to maintain a Constant Frame Rate. Mandatory for norm conversions.&lt;br /&gt;
** 2 : Credits are maintained at 29.97 fps (half their full temporal resolution) to create a [[VFR|Variable Frame Rate]] clip. '''Intended for mkv files.'''&lt;br /&gt;
&amp;lt;var&amp;gt;credconv&amp;lt;/var&amp;gt; : Determines how the credits will be converted for '''''omode=1'''''''''&lt;br /&gt;
** &amp;quot;mocomp&amp;quot; : Use motion-compensation. Use when you have low motion backgrounds to get a blend free and stable clip.&lt;br /&gt;
** &amp;quot;blend&amp;quot; : Blend frames together to reduce framerate (ugly and fast, but can lead to less disturbing artifacts when you have a high motion background)''''''&lt;br /&gt;
** &amp;quot;Drop&amp;quot;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; : Drop frames to reduce framerate creds into 24t (ugly and fast, will lead to stuttery motion)''''''&lt;br /&gt;
: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt; in mod ver. only. &lt;br /&gt;
&amp;lt;var&amp;gt;overlap&amp;lt;/var&amp;gt; : Overlap of the blocks for motion vector calculation. Higner = better, but slower. '''Use for &amp;quot;mocomp&amp;quot;'''.&lt;br /&gt;
** 0, 2 or 4 for SD (default=4)&lt;br /&gt;
** 0, 2, 4, 6 or 8 for HD (default=8)&lt;br /&gt;
&amp;lt;var&amp;gt;pel&amp;lt;/var&amp;gt; : Supersampling factor for motion vector calculation. Higner = better, but slower. '''Use for &amp;quot;mocomp&amp;quot;'''.&lt;br /&gt;
** 1, 2 or 4 (default=2)&lt;br /&gt;
&amp;lt;var&amp;gt;search&amp;lt;/var&amp;gt; : Have fun testing. 4 and 5 are usually better than 2 for roughly the same speed. '''Use for &amp;quot;mocomp&amp;quot;'''.&lt;br /&gt;
** 2 (Logarithmic search, also named Diamond Search)&lt;br /&gt;
** 3 (Exhaustive search) - slowest, but best results SAD-wise (basically the mo-comp is done by calculating the sum of absolute differences between blocks to determine if it is the same element moving or a different one) Attempt at lame joke: no, we're not talking about this here... [http://en.wikipedia.org/wiki/Sexual_arousal_disorder SAD]&lt;br /&gt;
** 4 (Hexagon search - similar to x264) (default)&lt;br /&gt;
** 5 (Uneven Multi Hexagon search - similar to x264)&lt;br /&gt;
&amp;lt;var&amp;gt;nnedi3pel&amp;lt;/var&amp;gt; : Use nnEDI3 for interpolation. True = usually better. '''Use for &amp;quot;mocomp&amp;quot;'''.&lt;br /&gt;
** true&lt;br /&gt;
** false (default)&lt;br /&gt;
&amp;lt;var&amp;gt;pass&amp;lt;/var&amp;gt; : Creating a VFR clip requires two passes. The file you must use for your final encode/subsequent filtering must be the one generated by pass=2.''' Use for omode=2'''.&lt;br /&gt;
** 1 : Open with vdub, file-run video analysis pass, wait until the end, close vdub OR do a rendering pass (saving the filtered clip in a lossless (i.e. with Lagarith or HuffYUV) avi file for further use to avoid computing the same thing twice - once for analysis and another to decimate) (default)&lt;br /&gt;
** 2 : Reload the same script with pass=2. Use the new avi file as source if you did a rendering pass. After all subsequent filtering, encode. Then, take the &amp;quot;timecode.txt&amp;quot; file and add it as the timecode for the video stream in mkvmerge.&lt;br /&gt;
&amp;lt;var&amp;gt;rendering&amp;lt;/var&amp;gt; : If you did a rendering pass , this will only be VFR decimation based on the files written by pass=1.''' Use for omode=2 and pass=2.'''&lt;br /&gt;
** True (you did a rendering pass and only want to decimate in pass=2)&lt;br /&gt;
** False (you did not create any intermediate file) (default)&lt;br /&gt;
&amp;lt;var&amp;gt;cbob&amp;lt;/var&amp;gt; : Higher = slower, but more precise... Here, it's ''almost'' about quality vs speed. '''Use for interlaced credits'''.&lt;br /&gt;
** 0 : Fastest, TDeint alone&lt;br /&gt;
** 1 : Better (TDeint + ediandnn for interpolation)&lt;br /&gt;
** 2 : Even better (TDeint + ediandnn + motion mask)&lt;br /&gt;
** 3 : Alternate (Yadifmod + ediandnn for interpolation)&lt;br /&gt;
** 4 : Most stable bobber around - QTGMC. Slow. (default)&lt;br /&gt;
&amp;lt;var&amp;gt;edimode&amp;lt;/var&amp;gt; : Tells which filter to use for spatial interpolation with''' ''cbob=4'''''. The &amp;quot;best&amp;quot; one depends on your source. '''Use for interlaced credits'''.&lt;br /&gt;
** see EdiMode in [http://avisynth.nl/index.php/QTGMC#Interpolation QTGMC]&lt;br /&gt;
** edimode = ediandnn by default in mod ver. unless you set EdiMode&lt;br /&gt;
&amp;lt;var&amp;gt;degrain&amp;lt;/var&amp;gt; : Temporal radius (# of frames to use * 2 1) for the final degraining step with''' ''cbob=4'''''. Higher = slower more noise removal more stable. '''Use for interlaced credits'''.&lt;br /&gt;
** 1 (default)&lt;br /&gt;
** 2&lt;br /&gt;
** 3&lt;br /&gt;
&lt;br /&gt;
=== Hard telecine (mode=1) ===&lt;br /&gt;
&amp;lt;var&amp;gt;precision&amp;lt;/var&amp;gt; : Higher = slower, but more precise... Here, it's may about quality vs speed.&lt;br /&gt;
** 0 : Fastest, tfm only&lt;br /&gt;
** 1 : Better (uses tfm + ediandnn to deinterlace)&lt;br /&gt;
** 2 : Even better (tfm + Tdeint + ediandnn for interpolation)&lt;br /&gt;
** 3 : Optimal (tfm + Tdeint + ediandnn + motion mask) (default)&lt;br /&gt;
** 4 : same as 3 but no blend&lt;br /&gt;
** 5 : tfm + yadifmod + ediandnn&lt;br /&gt;
** 6 : tfm + Tdeint + motion mask&lt;br /&gt;
** 7 : use extbobf\extbob with SelectEven to back to original fps (no blend)&lt;br /&gt;
** 8 : for already half extbobf\extbob fps&lt;br /&gt;
''blend'' : If you have a case of blend telecine, or blend-deinterlacing of telecined footage. 3:2 pattern - 3 clear, 2 blended. Weight must be 50/50.&lt;br /&gt;
** True&lt;br /&gt;
** False (default)&lt;br /&gt;
&lt;br /&gt;
=== Field blended (mode=2) ===&lt;br /&gt;
&amp;lt;var&amp;gt;bbob&amp;lt;/var&amp;gt; : Higher = slower, but more precise... Here, it's ''almost'' only about quality vs speed. Mo-comp is not recommended for blended material, but I left in case you have stability issues with the other bobbers.&lt;br /&gt;
** 0 : Fastest, TDeint alone&lt;br /&gt;
** 1 : Better (TDeint + nnedi3 for interpolation)&lt;br /&gt;
** 2 : Even better (TDeint + nnedi3 motion mask)&lt;br /&gt;
** 3 : Alternate (Yadifmod + nnedi3 for interpolation) (default)&lt;br /&gt;
** 4 : Most stable bobber around - QTGMC. Slow.&lt;br /&gt;
&amp;lt;var&amp;gt;edimode&amp;lt;/var&amp;gt; : Tells which filter to use for spatial interpolation with''' ''cbob=4'''''. The &amp;quot;best&amp;quot; one depends on your source.&lt;br /&gt;
** same as [http://avisynth.nl/index.php?title=AnimeIVTC#Interlaced_or_progressive_credits cbob]&lt;br /&gt;
&amp;lt;var&amp;gt;degrain&amp;lt;/var&amp;gt; : Temporal radius (# of frames to use * 2 1) for the final degraining step with''' ''cbob=4'''''. Higher = slower more noise removal more stable.&lt;br /&gt;
** 1 (default)&lt;br /&gt;
** 2&lt;br /&gt;
** 3&lt;br /&gt;
''normconv'' : Set to true if your source was blend-converted from PAL to NTSC or vice-versa.&lt;br /&gt;
** True : Change framerate to 25fps if your source is NTSC or to 23.976fps if it's PAL&lt;br /&gt;
** False : Keep 25fps if source is PAL and 23.976 if source is NTSC (default)&lt;br /&gt;
&lt;br /&gt;
=== Double hard telecine (mode=3) ===&lt;br /&gt;
&amp;lt;var&amp;gt;cbob&amp;lt;/var&amp;gt; : Higher = slower, but more precise... Here, it's ''almost'' about quality vs speed. '''Use for interlaced credits'''.&lt;br /&gt;
** 0 : Fastest, TDeint alone&lt;br /&gt;
** 1 : Better (TDeint + ediandnn for interpolation)&lt;br /&gt;
** 2 : Even better (TDeint + ediandnn + motion mask)&lt;br /&gt;
** 3 : Alternate (Yadifmod + ediandnn for interpolation)&lt;br /&gt;
** 4 : Most stable bobber around - QTGMC. Slow. (default)&lt;br /&gt;
&amp;lt;var&amp;gt;edimode&amp;lt;/var&amp;gt; : Tells which filter to use for spatial interpolation with''' ''cbob=4'''''. The &amp;quot;best&amp;quot; one depends on your source. '''Use for interlaced credits'''.&lt;br /&gt;
** see EdiMode in [http://avisynth.nl/index.php/QTGMC#Interpolation QTGMC]&lt;br /&gt;
** edimode = ediandnn by default in mod ver.&lt;br /&gt;
&amp;lt;var&amp;gt;degrain&amp;lt;/var&amp;gt; : Temporal radius (# of frames to use * 2 1) for the final degraining step with''' ''cbob=4'''''. Higher = slower more noise removal more stable.&lt;br /&gt;
** 1 (default)&lt;br /&gt;
** 2&lt;br /&gt;
** 3&lt;br /&gt;
&amp;lt;var&amp;gt;pattern&amp;lt;/var&amp;gt; : Tells the function how to decimate to 23.976 fps.&lt;br /&gt;
** 0 Safest. Uses TDecimate. (default)&lt;br /&gt;
** -1 Compare 1 to 5.&lt;br /&gt;
** 1 to 5 If your source has a fixed pattern, finding it with -1 and using the appropriate one will be faster and visually better, but as soon as there's a change, everything will be a mess. Be careful.&lt;br /&gt;
&lt;br /&gt;
=== Hybrid (mode=4) ===&lt;br /&gt;
&amp;lt;var&amp;gt;precision&amp;lt;/var&amp;gt; : Higher = slower, but more precise... Here, it's may about quality vs speed.&lt;br /&gt;
** 0 : Fastest, tfm only&lt;br /&gt;
** 1 : Better (uses tfm + ediandnn to deinterlace)&lt;br /&gt;
** 2 : Even better (tfm + Tdeint + ediandnn for interpolation)&lt;br /&gt;
** 3 : Optimal (tfm + Tdeint + ediandnn + motion mask) (default)&lt;br /&gt;
** 4 : same as 3 but no blend&lt;br /&gt;
** 5 : tfm + yadifmod + ediandnn&lt;br /&gt;
** 6 : tfm + Tdeint + motion mask&lt;br /&gt;
** 7 : use extbobf\extbob with SelectEven to back to original fps (no blend)&lt;br /&gt;
** 8 : for already half extbobf\extbob fps&lt;br /&gt;
&amp;lt;var&amp;gt;omode&amp;lt;/var&amp;gt; : Determines the output framerate&lt;br /&gt;
** 1 : Converts the 30p sections to 24p by blending frames together to maintain a Constant Frame Rate.&lt;br /&gt;
** 2 : 30p sections are maintained at 29.97 fps to create a [[VFR|Variable Frame Rate]] clip. '''Intended for mkv files.'''&lt;br /&gt;
&amp;lt;var&amp;gt;pass&amp;lt;/var&amp;gt; : Creating a VFR clip requires two passes. Rendering passes are only recommended when you have interlaced or progressive credits or when ''ifade=true''. You will not see the results of killcomb and aa in pass=1. The file you must use for your final encode/subsequent filtering must be the one generated by pass=2.''' Use for omode=2'''.&lt;br /&gt;
** 1 : Open with vdub, file-run video analysis pass, wait until the end, close vdub OR do a rendering pass (saving the filtered clip in a lossless (i.e. with Lagarith or HuffYUV) avi file for further use to avoid computing the same thing twice - once for analysis and another to decimate) (default)&lt;br /&gt;
** 2 : Reload the same script with pass=2. Use the new avi file as source if you did a rendering pass. After all subsequent filtering, encode. Then, take the &amp;quot;timecode.txt&amp;quot; file and add it as the timecode for the video stream in mkvmerge.&lt;br /&gt;
&amp;lt;var&amp;gt;rendering&amp;lt;/var&amp;gt; : If you did a rendering pass , this will only be VFR decimation based on the files written by pass=1.''' Use for omode=2 and pass=2.'''&lt;br /&gt;
** True (you did a rendering pass and only want to decimate in pass=2)&lt;br /&gt;
** False (you did not create any intermediate file) (default)&lt;br /&gt;
&lt;br /&gt;
== III) Examples ==&lt;br /&gt;
AnimeIVTC is quite easy to use... if you have questions after reading this manual, please post in the AnimeIVTC thread.&lt;br /&gt;
Here is a way to multithread it, but you can use the concept in many different ways (loading from different hard drives outputting to different hard drives and so forth). I only used 3 threads because more was too much for the source HDD, even when writing to 4 different ones. Do NOT use for VFR encodes, where analysis and decimation must be done in one shot.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 xxxsource(&amp;quot;file.ext&amp;quot;)&lt;br /&gt;
 threads = 3&lt;br /&gt;
 s=AnimeIVTC([settings])&lt;br /&gt;
 a=s.trim(0,int(framecount(s)/threads))&lt;br /&gt;
 b=s.trim(int(framecount(s)/threads) 1,int(framecount(s)/threads-1))&lt;br /&gt;
 c=s.trim(int(framecount(s)/threads-1) 1,0)&lt;br /&gt;
 a #load this script in vdub and save as rendering1, then change a to b and save as rendering2, ideally on a different HDD... etc etc&lt;br /&gt;
 &lt;br /&gt;
 #then, for further processing or encoding, load your different files and splice them, such as:&lt;br /&gt;
 #a=avisource(rendering1 file with path)&lt;br /&gt;
 #b=avisource(rendering2 file with path)&lt;br /&gt;
 a b .....&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== IV) Revisions ==&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;2.00 Released 2010-01-07 by thetoof&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
** v2 because of the syntax changes&lt;br /&gt;
** Compatibility with MVtools2&lt;br /&gt;
** Compatibility with srestore for field blended&lt;br /&gt;
** New (and better) decimation for dht&lt;br /&gt;
** The user will determine the end frames of every sections in case of progressive/interlaced credits and the rest will all be done internally (no need to switch between the checks since it was a pain)&lt;br /&gt;
** Handling of the blend-decimation of hybrid sections in omode=1&lt;br /&gt;
** More aa and killcomb options&lt;br /&gt;
** New parameter to fix chroma swap between fields&lt;br /&gt;
** New parameter to fix blend telecine&lt;br /&gt;
** New parameter to fix interlaced fade-ins&lt;br /&gt;
** The modes are &amp;quot;re-thought&amp;quot; : mode=1 (hard telecine) mode=2 (field blended) mode=3 (double hard telecine) mode=4 (hybrid) At the moment you define a frame # for interlaced or progressive credits, the function adapts itself&lt;br /&gt;
** Memory usage decreased for a few modes&lt;br /&gt;
** No need to specify the region of your source (done internally) Single parameter added (bool &amp;quot;normconv&amp;quot;) to go from one to another&lt;br /&gt;
** More accurate external pelclip with nnedi2 for optimal motion vectors calculation&lt;br /&gt;
** Rewriting of the function from scratch to prevent memory waste and other issues (I had patched with a few tricks here and there which made it harder to read. It's almost all gone now)&lt;br /&gt;
** Maybe a few other things I'll add when I remember what I changed in the last year or so ;)&amp;lt;small&amp;gt;&lt;br /&gt;
1.06 Released 2008-10-08 by thetoof&lt;br /&gt;
** Fixed bug when using mode=6 with the checks&lt;br /&gt;
** Faster aa=4 when settings=0&lt;br /&gt;
** Fixed mt=false issues&lt;br /&gt;
** Fixed 1/2-pel registration error between the original and antialiased clip, due to EEDI2 for aa=1&lt;br /&gt;
** Fixed bug where edge masking was disabled with mc=false&lt;br /&gt;
** Added aatype argument to aa=4 (use sangnom or eedi2 for anti-aliasing)&lt;br /&gt;
** aapel's default is now 1 (faster)&lt;br /&gt;
** re-added idx for aa=4 (faster)&lt;br /&gt;
** Removed useless messages in the checks&lt;br /&gt;
** Changed AssumeFPS with ChangeFPS for region conversions&lt;br /&gt;
** Added RequestLinear call after cdeblend to prevent false &amp;quot;hey, it's not deblending well&amp;quot; assumptions when seeking&lt;br /&gt;
** Added AvsRecursion &amp;amp;amp; aWarpsharp to the requirements archive&lt;br /&gt;
** Added corrected TempGaussMC_beta1mod&lt;br /&gt;
** Updated the docs to include the info on how to combine the lossless rendering pass and the analysis pass with vfr decimation&lt;br /&gt;
1.05 Released 2008-09-18 by thetoof&lt;br /&gt;
** Added string &amp;quot;edimode&amp;quot;&lt;br /&gt;
** Added int &amp;quot;degrain&amp;quot;&lt;br /&gt;
** Fixed typos in the docs&lt;br /&gt;
** Removed ineffective error message about the external audio file&lt;br /&gt;
** Added the plugins needed for aa=4 bob/precision=3 in the &amp;quot;requirements&amp;quot; archive &amp;amp;amp; list&lt;br /&gt;
1.04 Released 2008-09-17 by thetoof&lt;br /&gt;
** Fixed check=3 and check=10 to be compatible with the new add-ons&lt;br /&gt;
** Corrected typo in the error message asking to specify the omode&lt;br /&gt;
** Disabled aa comparison when using one of the check=x&lt;br /&gt;
** nnedipel's default is now false&lt;br /&gt;
** Changed the order of the filters so that all the stream (not only the ivtced sections) can be processed with killcomb and aa&lt;br /&gt;
** Fixed syntax errors with mode=7&lt;br /&gt;
1.03 Released 2008-09-16 by thetoof&lt;br /&gt;
** Fixed bug when splicing clips at different framerates&lt;br /&gt;
** Fixed bug where frames were lost to decimation in mode=6&lt;br /&gt;
** Fixed bug causing the &amp;quot;tfm.txt&amp;quot; file to be overwritten every time the script was loaded&lt;br /&gt;
** Fixed idx values in the MVAnalyse and MVFlowFPS calls&lt;br /&gt;
** Use of 2 different pelclips if prefiltered clip is used before motion vectors calculation to prevent b0rked output&lt;br /&gt;
** Removed omode=3 for optimal vfr decimation&lt;br /&gt;
** Less memory usage by using a named clip for all the blankclips&lt;br /&gt;
** Changed syntax to be compatible with the newest version of mrestore&lt;br /&gt;
** Faster blends and duplicates detection for decimate=5 by using dclip=i.bob().reduceflicker(strength=1) in mrestore&lt;br /&gt;
** Replaced nnediaa with ediaa for better aliasing removal (aa=1)&lt;br /&gt;
** Added functions in the script to fix &amp;quot;There is no function named iseven/isodd&amp;quot; bug&lt;br /&gt;
** Added &amp;quot;MT&amp;quot; parameter to use with the multithreaded version of MVTools&lt;br /&gt;
** Added support for fieldblended PAL &amp;amp;amp; norm-conversion restoration&lt;br /&gt;
** Added support for 30p credits on top of telecined background&lt;br /&gt;
** New check function to get the frame numbers of the 30p sections (check=0)&lt;br /&gt;
** New check function to see the prefiltered clip of the 30p sections (check=9)&lt;br /&gt;
** Argument &amp;quot;pureint&amp;quot; changed to &amp;quot;mix&amp;quot;&lt;br /&gt;
** 15 new &amp;quot;mix&amp;quot; modes for all the possibilities for 30p and 30i credits&lt;br /&gt;
** Replaced decimate=0 with pass=0&lt;br /&gt;
** New AA function by Mystery Keeper (aa=4)&lt;br /&gt;
** Re-added the possibility to use killcomb=0, but default remains 1&lt;br /&gt;
** Changed &amp;quot;precision&amp;quot;'s default to 3 for all modes&lt;br /&gt;
** Cosmetic changes&lt;br /&gt;
** Included TempGaussMC_beta1mod in the requirements package to make bob=3 work with the new &amp;quot;MT&amp;quot; parameter&lt;br /&gt;
** Docs update formatting improvement, reformulation here and there...&lt;br /&gt;
1.02 Released 2008-06-19 by thetoof&lt;br /&gt;
** No more &amp;quot;HD&amp;quot; setting (done automatically)&lt;br /&gt;
** Vinverse can't be removed from the filter chain, resulting in a speed improvement (killcomb=0 doesn't exist anymore)&lt;br /&gt;
** Decimate=0 can be used with any mode as a preparation to mode=7 (run a lossless rendering pass of decimate=0 and then load the resulting file with mode=7) for compressibility improvement through VFR&lt;br /&gt;
1.01 Released 2008-06-12 by thetoof&lt;br /&gt;
** Correction of syntax errors for mode=7&lt;br /&gt;
1.00 Released 2008-06-01 by thetoof&lt;br /&gt;
** Initial release of the function. &amp;lt;/small&amp;gt;&lt;br /&gt;
== V) Download ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.mediafire.com/download.php?kjjlukmmdzj Download AnimeIVTC 1.6 &amp;amp;amp; all necessary plugins (7z/2.48 MB)] ===&lt;br /&gt;
&lt;br /&gt;
=== [http://www.mediafire.com/download/go4earhv7ju3btc/AnimeIVTC+Requeriments+v2.7z Download AnimeIVTC 2.0 &amp;amp;amp; all necessary plugins (7z/1.65 MB)] ===&lt;br /&gt;
&lt;br /&gt;
=== [http://pastebin.com/Z1vqnPev AnimeIVTC 2.0 2015-10-28 mod] ===&lt;br /&gt;
&lt;br /&gt;
=== [http://www.mediafire.com/download/flq1s9nobrh81w7/AnimeIVTC_en_espa%C3%B1ol_v2.00.pdf AnimeIVTC_en_español_v2.00.pdf] by Overdrive80 ===&lt;br /&gt;
&lt;br /&gt;
[[Category:External filters]]&lt;br /&gt;
[[Category:IVTC]]&lt;br /&gt;
[[Category:Decimation]]&lt;/div&gt;</summary>
		<author><name>Soreepeong</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php/FFmpegSource</id>
		<title>FFmpegSource</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/FFmpegSource"/>
				<updated>2016-05-31T03:07:09Z</updated>
		
		<summary type="html">&lt;p&gt;Soreepeong: Added possible workaround when FFVS cannot seek accurately for mpegts streams&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FilterCat|External_filters|Plugins|Source_filters}}&lt;br /&gt;
{{Filter5&lt;br /&gt;
|1={{Author/Myrsloik}}, et al.&lt;br /&gt;
|2=v2.22&lt;br /&gt;
|3=[http://github.com/FFMS/ffms2/releases FFMS2 v2.22]&lt;br /&gt;
|4=[http://forum.doom9.org/member.php?u=135430 10bithack version]&lt;br /&gt;
|5=[http://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md User Manual]&lt;br /&gt;
|6=Source filters &lt;br /&gt;
|7=[http://opensource.org/licenses/MIT MIT] / binary is [http://www.gnu.org/licenses/gpl.txt GPLv3]&lt;br /&gt;
|8=[http://forum.doom9.org/showthread.php?t=127037 Doom9 Thread]}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Opens files using [http://www.ffmpeg.org/ FFmpeg] and nothing else. May be frame accurate on good days. The source is MIT licensed and can be obtained from the [http://github.com/FFMS/ffms2/ GitHub repository]. The precompiled binary is GPL3 licensed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
* AviSynth 2.6.0 or [http://sourceforge.net/projects/avisynth2/ greater]&lt;br /&gt;
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&amp;lt;br&amp;gt;&lt;br /&gt;
:([[High_bit-depth_Support_with_Avisynth#Importing_High_Bit-depth_Video_into_AviSynth|10-bit formats]] are supported with the 10bithack version - see alternate download above)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
*Because of LAVF's demuxer, most raw streams (such as elementary h264 and other mpeg video streams) will fail to work properly.&lt;br /&gt;
&lt;br /&gt;
*'''FFAudioSource''' will have to remake any index implicitly created by '''FFVideoSource''' and therefore code like&lt;br /&gt;
&amp;lt;div {{ListItemContinue}} &amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;AudioDub( FFVideoSource(X), FFAudioSource(X) )&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
will require two indexing passes. Apart from the time consumed this is harmless. To work around it open the audio first: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;A = FFAudioSource(X)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;V = FFVideoSource(X)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;AudioDub(V, A)&amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
('''FFmpegSource2''' does this for you with a single function call) or use '''FFIndex''', like so: &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;FFIndex(X)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;code&amp;gt;AudioDub( FFVideoSource(X), FFAudioSource(X) )&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*Interlaced H.264 mostly works these days, but seeking may occasionally result in corruption.&lt;br /&gt;
*Transport Streams will not decode reliably without {{FuncArg|seekmode}} -1.&lt;br /&gt;
*Open-GOP H.264 will sometimes produces corruption when seeking.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Known Issues ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
(''NOTE this section does not appear in the [http://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md latest documentation] and may be obsolete'')&lt;br /&gt;
* Interlaced H.264 is decoded in an odd way; each field gets its own full-height frame and the fieldrate is reported as the framerate, and furthermore one of the fields (odd or even) may &amp;quot;jump around&amp;quot;. To get the correct behavior, you can try setting {{FuncArg|fpsnum}} and {{FuncArg|fpsden}} so that the framerate is halved (may or may not work). This issue is caused by libavcodec. &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Compatibility ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
===Video===&lt;br /&gt;
&lt;br /&gt;
*AVI, MKV, MP4, FLV: Frame accurate&lt;br /&gt;
*WMV: Frame accurate(?) but avformat seems to pick keyframes relatively far away&lt;br /&gt;
*OGM: Frame accurate(?)&lt;br /&gt;
*VOB, MPG: Seeking seems to be off by one or two frames now and then&lt;br /&gt;
*M2TS, TS: Seeking seems to be off a few frames here and there&lt;br /&gt;
**As MP4 container supports MPEG2/4 video stream, when seeking is off, you can try copying the stream to MP4 container (maybe without audio.) With FFmpeg: &amp;lt;code&amp;gt;ffmpeg -i file.m2ts -c:v copy -an file.mp4&amp;lt;/code&amp;gt;. You might have to specify &amp;lt;code&amp;gt;-fflags +genpts&amp;lt;/code&amp;gt; before &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt;.&lt;br /&gt;
*Image files: Most formats can be opened if seekmode=-1 is set, no animation support&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
&lt;br /&gt;
Seeking should be sample-accurate with most codecs in AVI, MKV, MP4 and FLV. &lt;br /&gt;
&lt;br /&gt;
Decoding linearly will almost always give correct results, and forward-seeks from trimming should result in at most a few hundred samples of corruption.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Indexing and You ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
Before '''FFMS2''' can open a file, it must be indexed first so that keyframe/sample positions are known and seeking is easily accomplished. This is done automatically when using '''FFVideoSource''' or '''FFAudioSource''', but if you want to you can invoke the indexing yourself by calling '''FFIndex''', or by running &amp;lt;tt&amp;gt;ffmsindex.exe&amp;lt;/tt&amp;gt;. By default the index is written to a file so it can be reused the next time you open the same file, but this behavior can be turned off if desired.&lt;br /&gt;
&lt;br /&gt;
If you wonder why '''FFMS2''' takes so long opening files, the indexing is the answer. If you want a progress report on the indexing, you can use the supplied &amp;lt;tt&amp;gt;ffmsindex.exe&amp;lt;/tt&amp;gt; command line program.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
== Function Reference ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
=== FFmpegSource2 ===&lt;br /&gt;
{{FuncDef|FFmpegSource2(string ''source'' [, int ''vtrack'', int ''atrack'' , &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;bool ''cache'', string ''cachefile'', int ''fpsnum'', int ''fpsden'', &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int ''threads'', string ''timecodes'', int ''seekmode'', bool ''overwrite'', &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int ''width'', int ''height'', string ''resizer'', string ''colorspace'', &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;int ''rffmode'', int ''adjustdelay'', bool ''utf8'', string ''varprefix'' ] )&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
:{{Par2|source|string|(required)}}&lt;br /&gt;
::Path of the file to be opened.&lt;br /&gt;
&lt;br /&gt;
:{{Par2|vtrack|int|-1}}&lt;br /&gt;
::The video track number to open, as seen by the relevant demuxer. Track numbers start from zero, and are guaranteed to be continous (i.e. there must be a track 1 if there is a track 0 and a track 2). {{FuncArg|vtrack}}=-1 (the default) means open the first video track. Note that this filter's idea about what ''track'' has what ''number'' may be completely different from what some other application might think. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|atrack|int|-2}}&lt;br /&gt;
::The audio track to open. {{FuncArg|atrack}}=-1 means select the first available track. {{FuncArg|atrack}}=-2 (the default) means audio is disabled. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|cache|bool|true}}&lt;br /&gt;
::If set to true (the default), this filter will first check if the {{FuncArg|cachefile}} contains a valid index, and if it does, that index will be used. If no index is found, all video tracks will be indexed, and the indexing data will be written to {{FuncArg|cachefile}} afterwards. If set to false, this filter will not look for an existing index file; instead all video tracks will be indexed when the script is opened, and the indexing data will be discarded after the script is closed; you will have to index again next time you open the script. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|cachefile|string|source + &amp;quot;.ffindex&amp;quot;}}&lt;br /&gt;
::The filename of the index file (where the indexing data is saved). Defaults to &amp;lt;tt&amp;gt;sourcefilename.ffindex&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|fpsnum|int|-1}}&lt;br /&gt;
:{{Par2|fpsden|int|1}}&lt;br /&gt;
::Controls the framerate of the output; used for VFR to CFR conversions. If {{FuncArg|fpsnum}} is less than or equal to zero (the default), the output will contain the same frames that the input did, and the frame rate reported to Avisynth will be set based on the input clip's average frame duration. If {{FuncArg|fpsnum}} is greater than zero, this filter will force a constant frame rate, expressed as a rational number where {{FuncArg|fpsnum}} is the numerator and {{FuncArg|fpsden}} is the denominator. This may naturally cause dropped or duplicated frames to achieve the desired frame rate, and the output is not guaranteed to have the same number of frames that the input did.&lt;br /&gt;
&lt;br /&gt;
:{{Par2|threads|int|-1}}&lt;br /&gt;
::The number of decoding threads to request from [http://ffmpeg.org/libavcodec.html '''libavcodec''']. Setting it to less than or equal to zero means it defaults to the number of logical CPUs as reported by Windows. Note that this setting might be completely ignored under a number of conditions; most commonly because a lot of decoders actually do not support multithreading. Default -1.&lt;br /&gt;
&lt;br /&gt;
:{{Par2|timecodes|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
::Filename to write [http://matroska.org/technical/specs/notes.html Matroska v2 timecodes] for the opened video track. If the file exists, it will be truncated and overwritten. Set to the empty string to disable timecodes writing (this is the default). &lt;br /&gt;
&lt;br /&gt;
:{{Par2|seekmode|int|1}}&lt;br /&gt;
::Controls how seeking is done. Mostly useful for getting uncooperative files to work. Valid modes are:&lt;br /&gt;
::*-1: Linear access without rewind; i.e. will throw an error if each successive requested frame number isn't bigger than the last one. Only intended for opening images but might work on well with some obscure video format.&lt;br /&gt;
::*0: Linear access (i.e. if you request frame n without having requested all frames from 0 to n-1 in order first, all frames from 0 to n will have to be decoded before n can be delivered). The definition of slow, but should make some formats &amp;quot;usable&amp;quot;.&lt;br /&gt;
::*1: Safe normal (the default). Bases seeking decisions on the keyframe positions reported by libavformat.&lt;br /&gt;
::*2: Unsafe normal. Same as mode 1, but no error will be thrown if the exact seek destination has to be guessed.&lt;br /&gt;
::*3: Aggressive. Seeks in the forward direction even if no closer keyframe is known to exist. Only useful for testing and containers where libavformat doesn't report keyframes properly.&lt;br /&gt;
&lt;br /&gt;
:{{Par2|overwrite|bool|false}}&lt;br /&gt;
::If set to true, this filter will reindex the source file and overwrite the index file even if the index file already exists and is valid. Mostly useful for trackmask changes and testing.&lt;br /&gt;
&lt;br /&gt;
:{{Par2|width|int|-1}}&lt;br /&gt;
:{{Par2|height|int|-1}}&lt;br /&gt;
::Sets the resolution of the output video, in pixels. Setting either dimension to less than or equal to zero (which is the default) means the resolution of the first decoded video frame is used for that dimension. These parameters are mostly useful because FFMS2 supports video streams that change resolution mid-stream; since Avisynth does not, these parameters are used to set single resolution for the output. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|resizer|string|&amp;quot;BICUBIC&amp;quot;}}&lt;br /&gt;
::The resizing algorithm to use if rescaling the image is necessary. If the video uses subsampled chroma but your chosen output colorspace does not, the chosen resizer will be used to upscale the chroma planes, even if you did not request an image rescaling. The available choices are &amp;lt;code&amp;gt;FAST_BILINEAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BILINEAR&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BICUBIC&amp;lt;/code&amp;gt; (default), &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;POINT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AREA&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BICUBLIN&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GAUSS&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SINC&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;LANCZOS&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SPLINE&amp;lt;/code&amp;gt;. Note that &amp;lt;code&amp;gt;SPLINE&amp;lt;/code&amp;gt; is completely different from Avisynth's builtin Spline [[Resize|resizers]]. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|colorspace|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
::Convert the output from whatever it was to the given colorspace, which can be one of &amp;lt;code&amp;gt;YV12&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;YUY2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;RGB24&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;RGB32&amp;lt;/code&amp;gt;. Setting this to an empty string (the default) means keeping the same colorspace as the input. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|rffmode|int|0}}&lt;br /&gt;
::Controls how RFF flags in the video stream are treated (RFF = ''Repeat First Field''; used in 3:2 pulldown&amp;lt;sup&amp;gt;[http://wayback.archive.org/web/20150120040340/http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729%28v=vs.85%29.aspx]&amp;lt;/sup&amp;gt;). In other words, it's equivalent to the &amp;quot;field operation&amp;quot; mode switch in [[DVD2AVI]]/[[DGIndex]]. Valid modes are:&lt;br /&gt;
::*0: Ignore all flags (the default mode).&lt;br /&gt;
::*1: Honor all pulldown flags.&lt;br /&gt;
::*2: Equivalent to DVD2AVI's &amp;quot;force film&amp;quot; mode.&lt;br /&gt;
::Note that using modes 1 or 2 will make FFMS2 throw an error if the video stream has no RFF flags at all. When using either of those modes, it will also make the output be assumed as CFR, disallow vertical scaling and disallow setting the output colorspace. &amp;lt;code&amp;gt;FFPICT_TYPE&amp;lt;/code&amp;gt; will also not be set as the output is a combination of several frames. Other subtle behavior changes may also exist. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|adjustdelay|int|-1}}&lt;br /&gt;
::Controls how audio delay is handled, i.e. what happens if the first audio sample in the file doesn't have a timestamp of zero. The following arguments are valid:&lt;br /&gt;
::*-3: No adjustment is made; the first decodable audio sample becomes the first sample in the output.&lt;br /&gt;
::*-2: Samples are created (with silence) or discarded so that sample 0 in the decoded audio starts at time zero.&lt;br /&gt;
::*-1: Samples are created (with silence) or discarded so that sample 0 in the decoded audio starts at the same time as frame 0 of the first video track. This is the default, and probably what most people want.&lt;br /&gt;
::*Any integer &amp;gt;= 0: Same as -1, but adjust relative to the video track with the given track number instead. If the provided track number isn't a video track, an error is raised.&lt;br /&gt;
::-2 obviously does the same thing as -1 if the first video frame of the first video track starts at time zero. In some containers this will always be the case, in others (most notably 188-byte MPEG TS) it will almost never happen. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|utf8|bool|false}}&lt;br /&gt;
::If set to true, this filter will assume that the .avs script is encoded as UTF-8 and therefore interpret all filenames as UTF-8 encoded strings. This makes it possible to open files with odd filenames that otherwise would not be openable. &lt;br /&gt;
&lt;br /&gt;
::'''NOTE:''' You must make sure you save the .avs file without a BOM (byte-order marker) or Avisynth will refuse to open it. Notepad will write a BOM, so use something else.&lt;br /&gt;
&lt;br /&gt;
::You should also note that setting this parameter incorrectly will cause all file openings to fail unless your filenames are exclusively 7-bit ASCII compatible. &lt;br /&gt;
&lt;br /&gt;
:{{Par2|varprefix|string|&amp;quot;&amp;quot;}}&lt;br /&gt;
::A string that is added as a prefix to all [[#Exported_AviSynth_variables|exported]] Avisynth variables. This makes it possible to differentiate between variables from different clips. &lt;br /&gt;
&lt;br /&gt;
* Note, ''FFMS2'' is a shorter name (added in v2.22) for ''FFmpegSource2''. The syntax is the same for both.&lt;br /&gt;
&lt;br /&gt;
=== Other Functions ===&lt;br /&gt;
For complete documentation see the [http://github.com/FFMS/ffms2/blob/master/doc/ffms2-avisynth.md#function-reference FFMS2 GitHub page].&lt;br /&gt;
{{PluginFilterTable2}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFIndex|&lt;br /&gt;
Indexes a number of tracks in a given source file and writes the index file to disk, where it can be picked up and used by &amp;lt;tt&amp;gt;FFVideoSource&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;FFAudioSource&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|&lt;br /&gt;
}} &lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFAudioSource|&lt;br /&gt;
Opens audio. Invokes indexing of all tracks if no valid index file is found, or if the requested track isn't present in the index. &lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFVideoSource|&lt;br /&gt;
Opens video. Will invoke indexing of all video tracks (but no audio tracks) if no valid index file is found.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFmpegSource2|&lt;br /&gt;
A convenience function that combines the functionality of '''FFVideoSource''' and '''FFAudioSource''' (see above).&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFMS2|&lt;br /&gt;
A shorter '''FFmpegSource2''' alias, this feature was added in v2.22.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
}} &lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFImageSource|&lt;br /&gt;
A convenience alias for '''FFVideoSource''', with the options set optimally for using it as an image reader. Disables caching and seeking for maximum compatiblity.&lt;br /&gt;
| [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFSetLogLevel|&lt;br /&gt;
Sets the FFmpeg logging level, i.e. how much diagnostic spam it prints to STDERR.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFGetLogLevel|&lt;br /&gt;
Returns the current log level, as an integer.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFGetVersion|&lt;br /&gt;
Returns the '''FFMS2''' version, as a string.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRowNote|&lt;br /&gt;
'''Note''': the following functions are provided by &amp;lt;tt&amp;gt;[http://raw.githubusercontent.com/FFMS/ffms2/master/etc/FFMS2.avsi FFMS2.avsi]&amp;lt;/tt&amp;gt; and are not available unless that script has been imported or [[Plugins#Plugin_Autoload_and_Name_Precedence|autoloaded]].&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFFormatTime|&lt;br /&gt;
A helper function used to format a time given in milliseconds into a h:mm:ss.ttt string. Used internally by '''FFInfo'''.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
{{PluginFilterRow|FFmpegSource|FFInfo|&lt;br /&gt;
A helper function similar to Avisynth's internal [[Info|Info()]] function; shows general information about the current frame.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exported AviSynth variables ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
All variable names are prefixed by the {{FuncArg|varprefix}} argument to the respective '''FFVideoSource''' or '''FFAudioSource''' call that generated them. &lt;br /&gt;
&lt;br /&gt;
'''NOTE''': these exported variables are mostly [[Runtime_environment|Runtime variables]], requiring [[ScriptClip]] etc to read them.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFSAR_NUM, FFSAR_DEN, FFSAR'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The playback aspect ratio specified by the container. &amp;lt;tt&amp;gt;FFSAR_NUM&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FFSAR_DEN&amp;lt;/tt&amp;gt; make up the rational number of the ratio; &amp;lt;tt&amp;gt;FFSAR&amp;lt;/tt&amp;gt; is only provided for convenience and may not be set in case it cannot be calculated (i.e. if &amp;lt;tt&amp;gt;FFSAR_DEN&amp;lt;/tt&amp;gt; is zero).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFCROP_LEFT, FFCROP_RIGHT, FFCROP_TOP, FFCROP_BOTTOM'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The on-playback cropping specified by the container.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFCOLOR_SPACE'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The colorimetry the input claims to be using. Only meaningful for YUV inputs. The source for this variable is a metadata flag that can arbitrarily be set or manipulated at will by incompetent users or buggy programs without changing the actual video content, so blindly trusting its correctness is not recommended.&lt;br /&gt;
&lt;br /&gt;
The value is exported as a cryptic numerical constant that matches the values in the MPEG-2 specification. You can find the gory details in the FFMS2 API documentation, but the important ones are:&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|1}} &amp;gt;&lt;br /&gt;
 0: RGB (usually indicates the stream isn't actually YUV, but RGB flagged as YUV)&lt;br /&gt;
 1: ITU-R Rec.709&lt;br /&gt;
 2: Unknown or unspecified&lt;br /&gt;
 5 and 6: ITU-R Rec.601&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFCOLOR_RANGE'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The color range the input video claims to be using. Much like &amp;lt;tt&amp;gt;FFCOLOR_SPACE&amp;lt;/tt&amp;gt;, the source for this variable is a metadata flag that can freely be set to arbitrary values, so trusting it blindly might not be a good idea.&lt;br /&gt;
&lt;br /&gt;
Note that using &amp;lt;tt&amp;gt;SWScale&amp;lt;/tt&amp;gt;() or the width/height/colorspace parameters to '''FFVideoSource''' may under some circumstances change the output color range.&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|1}} &amp;gt;&lt;br /&gt;
 0: Unknown/unspecified&lt;br /&gt;
 1: Limited range (usually 16-235)&lt;br /&gt;
 2: Full range (0-255)&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFPICT_TYPE'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The picture type of the most recently requested frame as the ASCII number of the character listed below. Use &amp;lt;tt&amp;gt;Chr&amp;lt;/tt&amp;gt;() to convert it to an actual letter in AviSynth. Use {{FuncArg|after_frame}}&amp;lt;tt&amp;gt;=true&amp;lt;/tt&amp;gt; in AviSynth's conditional scripting for proper results. Only set when {{FuncArg|rffmode}}&amp;lt;tt&amp;gt;=0&amp;lt;/tt&amp;gt;. The FFmpeg source definition of the characters:&lt;br /&gt;
&amp;lt;div {{BoxWidthIndent|56|1}} &amp;gt;&lt;br /&gt;
 I: Intra&lt;br /&gt;
 P: Predicted&lt;br /&gt;
 B: Bi-dir predicted&lt;br /&gt;
 S: S(GMC)-VOP MPEG4&lt;br /&gt;
 i: Switching Intra&lt;br /&gt;
 p: Switching Predicted&lt;br /&gt;
 b: FF_BI_TYPE (no good explanation available)&lt;br /&gt;
 ?: Unknown&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFVFR_TIME'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The actual time of the source frame in milliseconds. Only set when no type of CFR conversion is being done ({{FuncArg|rffmode}} and {{FuncArg|fpsnum}} left at their defaults).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFCHANNEL_LAYOUT'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The audio channel layout of the audio stream. This is exported as a very cryptic integer that is constructed in the same way as the &amp;lt;tt&amp;gt;dwChannelMask&amp;lt;/tt&amp;gt; property of the Windows &amp;lt;tt&amp;gt;WAVEFORMATEXTENSIBLE&amp;lt;/tt&amp;gt; struct. If you don't know what a &amp;lt;tt&amp;gt;WAVEFORMATEXTENSIBLE&amp;lt;/tt&amp;gt; is or what the &amp;lt;tt&amp;gt;dwChannelMask&amp;lt;/tt&amp;gt; does, don't worry about it.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;'''FFVAR_PREFIX'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable prefix of the last called FFMS source function. Note that this is a global variable.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==C Plugin==&lt;br /&gt;
The C plugin supports the additional [[planar]] colorspaces in AviSynth 2.6. Also starting with &amp;lt;tt&amp;gt;r940+64&amp;lt;/tt&amp;gt; it removes the Matroska demuxer too. This means that the *only* demuxer this build of FFMS2 uses is LAVF. The test this time is whether VP8 (and maybe VP9) bearing WebM files can be used correctly with the LAVF demuxer.&amp;lt;br&amp;gt;&lt;br /&gt;
*'''Discussion''' - [http://forum.doom9.org/showthread.php?p=1762372#post1762372 Doom9 Thread]&lt;br /&gt;
&lt;br /&gt;
*'''Download''' - [http://www.mediafire.com/download/k3yoexl7xsvqv3m/ffms2_r1110%2B98-avs%2Bvsp.7z FFMS2 C-plugin r1110+98]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;'''Note:'''&amp;lt;/span&amp;gt; C-plugins must be loaded using [[Plugins#LoadCPlugin|LoadCPlugin]].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;max-width:62em&amp;quot; &amp;gt;&lt;br /&gt;
*[http://forum.doom9.org/showthread.php?t=127037 Doom9 Forum] - FFmpegSource discussion.&lt;br /&gt;
*[http://github.com/FFMS/ffms2 GitHub] - Source code repository.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
'''Back to [[External_filters#Source_Filters|External Filters]] &amp;amp;larr;'''&lt;/div&gt;</summary>
		<author><name>Soreepeong</name></author>	</entry>

	</feed>