<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=Arrays</id>
	<title>Arrays - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=Arrays"/>
	<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;action=history"/>
	<updated>2026-09-01T23:14:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9144&amp;oldid=prev</id>
		<title>Raffriff42: Undo revision 9141 by Bettyseeds (talk)</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9144&amp;oldid=prev"/>
		<updated>2016-06-02T15:40:08Z</updated>

		<summary type="html">&lt;p&gt;Undo revision 9141 by &lt;a href=&quot;/index.php/Special:Contributions/Bettyseeds&quot; title=&quot;Special:Contributions/Bettyseeds&quot;&gt;Bettyseeds&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:Bettyseeds&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:Bettyseeds (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:40, 2 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;REDIRECT# [[Pogo Games Support +1844 446 4460 Avisynth]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are not supported natively by the scripting language. However, a library named [[http://avslib.sourceforge.net/ AVSLib]] exists that provides a functional interface for creating and manipulating arrays. Coupled with Avisynth&amp;#039;s OOP style for calling functions, one can treat arrays as objects with methods, which is a familiar and easy to understand and code scripting concept.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are not supported natively by the scripting language. However, a library named [[http://avslib.sourceforge.net/ AVSLib]] exists that provides a functional interface for creating and manipulating arrays. Coupled with Avisynth&amp;#039;s OOP style for calling functions, one can treat arrays as objects with methods, which is a familiar and easy to understand and code scripting concept.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9143&amp;oldid=prev</id>
		<title>Raffriff42: Undo revision 9142 by Bettyseeds (talk)</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9143&amp;oldid=prev"/>
		<updated>2016-06-02T15:39:51Z</updated>

		<summary type="html">&lt;p&gt;Undo revision 9142 by &lt;a href=&quot;/index.php/Special:Contributions/Bettyseeds&quot; title=&quot;Special:Contributions/Bettyseeds&quot;&gt;Bettyseeds&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:Bettyseeds&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:Bettyseeds (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
&lt;a href=&quot;http://www.avisynth.nl/index.php?title=Arrays&amp;amp;diff=9143&amp;amp;oldid=9142&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Raffriff42</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9142&amp;oldid=prev</id>
		<title>Bettyseeds: Arrays : Pogo Games Support +1844 446 4460</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9142&amp;oldid=prev"/>
		<updated>2016-06-02T15:18:09Z</updated>

		<summary type="html">&lt;p&gt;Arrays : Pogo Games Support +1844 446 4460&lt;/p&gt;
&lt;a href=&quot;http://www.avisynth.nl/index.php?title=Arrays&amp;amp;diff=9142&amp;amp;oldid=9141&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Bettyseeds</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9141&amp;oldid=prev</id>
		<title>Bettyseeds at 15:06, 2 June 2016</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;diff=9141&amp;oldid=prev"/>
		<updated>2016-06-02T15:06:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:06, 2 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;REDIRECT# [[Pogo Games Support +1844 446 4460 Avisynth]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are not supported natively by the scripting language. However, a library named [[http://avslib.sourceforge.net/ AVSLib]] exists that provides a functional interface for creating and manipulating arrays. Coupled with Avisynth&amp;#039;s OOP style for calling functions, one can treat arrays as objects with methods, which is a familiar and easy to understand and code scripting concept.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Arrays are not supported natively by the scripting language. However, a library named [[http://avslib.sourceforge.net/ AVSLib]] exists that provides a functional interface for creating and manipulating arrays. Coupled with Avisynth&amp;#039;s OOP style for calling functions, one can treat arrays as objects with methods, which is a familiar and easy to understand and code scripting concept.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bettyseeds</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=Arrays&amp;diff=744&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=Arrays&amp;diff=744&amp;oldid=prev"/>
		<updated>2013-05-09T21:33:34Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Arrays are not supported natively by the scripting language. However, a library named [[http://avslib.sourceforge.net/ AVSLib]] exists that provides a functional interface for creating and manipulating arrays. Coupled with Avisynth&amp;#039;s OOP style for calling functions, one can treat arrays as objects with methods, which is a familiar and easy to understand and code scripting concept.&lt;br /&gt;
&lt;br /&gt;
Therefore, two preparatory steps are needed before being able to create and manipulate process arrays into your script:&lt;br /&gt;
&lt;br /&gt;
* [http://sourceforge.net/projects/avslib/ Download] and install the most current version of AVSLib into your system.&lt;br /&gt;
* Import the needed AVSLib files in your script as follows (see the instructions inside the library&amp;#039;s documentation to fill-in the gaps):&lt;br /&gt;
:* AVSLib 1.1.x versions: Enter &amp;lt;tt&amp;gt;LoadPackage(&amp;quot;avslib&amp;quot;, &amp;quot;array&amp;quot;)&amp;lt;/tt&amp;gt; to load the array implementation files, or &amp;lt;tt&amp;gt;LoadLibrary(&amp;quot;avslib&amp;quot;, CONFIG_AVSLIB_FULL)&amp;lt;/tt&amp;gt; to load entire AVSLib.&lt;br /&gt;
:* AVSLib 1.0.x versions: Enter an appropriate [[Import]]({path to AVSLib header}) statement as the first line of your script.&lt;br /&gt;
&lt;br /&gt;
Now you are ready to create your first array! In order to provide an almost real case example let&amp;#039;s assume the following (which are commonplace in many situations) about the script you want to create:&lt;br /&gt;
&lt;br /&gt;
* The script selects a distinct range of frames from each video clip.&lt;br /&gt;
* Some of the input clips may have different size, fps, audio and/or colorspace; thus they need to be converted.&lt;br /&gt;
* Some of the filtering parameters are distinct for each clip.&lt;br /&gt;
&lt;br /&gt;
Having done that, let&amp;#039;s proceed to the actual code:&lt;br /&gt;
&lt;br /&gt;
First, we create the array; ..1.., ..2.., etc. are actual filename strings. Clip loading is made by [[AviSource]] in the example but [[DirectShowSource]] may also be specified.&lt;br /&gt;
&lt;br /&gt;
 inp = ArrayCreate( \&lt;br /&gt;
     AviSource(..1..), \&lt;br /&gt;
     [[AviSource]](..2..), \&lt;br /&gt;
     ... \&lt;br /&gt;
     AviSource(..n..) )&lt;br /&gt;
&lt;br /&gt;
Then we convert to same fps, audio, colorspace and size by using [[AssumeFPS]], [[ConvertAudioTo16bit]], [[ConvertToYV12]] and [[BilinearResize]] respectively (or any resizer that you find fit). We use OOP + chaining to make compact expressions.&lt;br /&gt;
&lt;br /&gt;
Note that since Avisynth does not provide a way for in-place variable modification we must reassign to an array variable after each array operation (usually the same).&lt;br /&gt;
&lt;br /&gt;
 inp = inp.ArrayOpFunc(&amp;quot;AssumeFPS&amp;quot;, &amp;quot;24&amp;quot;).ArrayOpFunc(&amp;quot;ConvertAudioTo16bit&amp;quot; \&lt;br /&gt;
     ).ArrayOpFunc(&amp;quot;ConvertToYV12&amp;quot;).ArrayOpFunc(&amp;quot;BilinearResize&amp;quot;, &amp;quot;640,480&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
To perform trimming we will use arrays of other types also. Below &amp;#039;&amp;#039;ts&amp;#039;&amp;#039; stands for first frame to trim, &amp;#039;&amp;#039;te&amp;#039;&amp;#039; for last; each number corresponds to a clip in &amp;#039;&amp;#039;inp&amp;#039;&amp;#039; variable.&lt;br /&gt;
&lt;br /&gt;
 ts = ArrayCreate(12, 24, ..., 33) # n numbers in total&lt;br /&gt;
 te = ArrayCreate(8540, 7834, ..., 5712) # n numbers in total&lt;br /&gt;
&lt;br /&gt;
We also need a counter to make things easier; we will use ArrayRange to create an array of 0,1,2,...&lt;br /&gt;
&lt;br /&gt;
 cnt = ArrayRange(0, inp.ArrayLen()-1)&lt;br /&gt;
&lt;br /&gt;
In addition we must define a user function that will accept &amp;#039;&amp;#039;inp&amp;#039;&amp;#039;, &amp;#039;&amp;#039;ts&amp;#039;&amp;#039;, &amp;#039;&amp;#039;te&amp;#039;&amp;#039; and &amp;#039;&amp;#039;cnt&amp;#039;&amp;#039; and do the trimming.&lt;br /&gt;
&lt;br /&gt;
Since ArrayOpArrayFunc only accepts two arrays for per-element processing, it is easier to pass &amp;#039;inp&amp;#039; and &amp;#039;&amp;#039;cnt&amp;#039;&amp;#039; as array elements and &amp;#039;&amp;#039;ts&amp;#039;&amp;#039;, &amp;#039;&amp;#039;te&amp;#039;&amp;#039; as entire arrays.&lt;br /&gt;
&lt;br /&gt;
 Function MyTrim(clip c, int count, string fs, string fe) {&lt;br /&gt;
     return c.[[Trim]](fs.ArrayGet(count), fe.ArrayGet(count))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now we are ready to do the trim (line below).&lt;br /&gt;
&lt;br /&gt;
 inp = ArrayOpArrayFunc(inp, cnt, &amp;quot;MyTrim&amp;quot;, StrQuote(ts)+&amp;quot;,&amp;quot;+StrQuote(te))&lt;br /&gt;
&lt;br /&gt;
We will finish the processing with a final tweak on brightness with different settings on each clip and on hue with same settings for all clips.&lt;br /&gt;
&lt;br /&gt;
 bright = ArrayCreate(2.0, 1.5, ..., 3.1) # n numbers in total&lt;br /&gt;
 &lt;br /&gt;
 Function MyTweak(clip c, float br) { &lt;br /&gt;
     return c.[[Tweak]](bright=br, hue=12.3)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 inp = ArrayOpArrayFunc(inp, bright, &amp;quot;MyTweak&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
And now we are ready to combine the results and return them as script&amp;#039;s output. We will use [[Dissolve]] for a smoother transition.&lt;br /&gt;
&lt;br /&gt;
 return inp.ArraySum(sum_func=&amp;quot;Dissolve&amp;quot;, sum_args=&amp;quot;5&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This is it; the n input clips have been converted to a common video and audio format, trimmed and tweaked with individual settings and returned as a single video stream with only 11 lines of code (excluding comments).&lt;br /&gt;
&lt;br /&gt;
Other types of array processing are also possible (slicing ie operation on a subset of elements, joining, multiplexing, etc.) but these are topics to be discussed in other pages. Those that are interested can browse the [http://avslib.sourceforge.net/ AVSLib documentation]. One can also take a closer look at the [http://avslib.sourceforge.net/examples/index.html examples section] of the AVSLib documentation.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[Scripting_reference|scripting reference]].&lt;br /&gt;
[[Category:AviSynth_Syntax]]&lt;br /&gt;
[[Category:Scripting_Reference]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>