
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://kb.speeddemosarchive.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://kb.speeddemosarchive.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darkwasabi</id>
		<title>SDA Knowledge Base - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://kb.speeddemosarchive.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darkwasabi"/>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/Special:Contributions/Darkwasabi"/>
		<updated>2026-04-28T05:39:54Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.9</generator>

	<entry>
		<id>https://kb.speeddemosarchive.com/Analog_Capture</id>
		<title>Analog Capture</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/Analog_Capture"/>
				<updated>2007-01-14T02:02:50Z</updated>
		
		<summary type="html">&lt;p&gt;Darkwasabi: /* Acquiring Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Acquiring Equipment==&lt;br /&gt;
&lt;br /&gt;
First of all, if you don't have access to a computer running Windows, and are instead using a Mac, check out the [[Mac Capture]] page.&lt;br /&gt;
&lt;br /&gt;
Otherwise, I recommend the [http://www.ati.com/products/radeon9600/aiw9600/index.html ATI All-In-Wonder 9600]. If you decide to record your run on VHS and let me capture, that is the card I will use. The American version supports every video standard I've ever heard of and captures in brilliant color, with full brightness transfer and virtually no dropped frames. It also captures full framerate ready video. Coming from inferior capture devices, I literally can not say enough good things about this card, so you will have to trust me that it is the best on the market.&lt;br /&gt;
&lt;br /&gt;
Be sure to download and install the most recent drivers for the card (once you have it installed) from the [http://www.ati.com/ ATI site], since you never know what might happen to your video (in terms of quality) if you use old drivers.&lt;br /&gt;
&lt;br /&gt;
==Acquiring Software==&lt;br /&gt;
&lt;br /&gt;
The software I recommend for capture and editing is called [http://www.virtualdub.org/ VirtualDub]. It is freeware, which means you are not expected to pay for it. If you like VirtualDub, though, you should donate a few bucks to the man who wrote it, like I did.&lt;br /&gt;
&lt;br /&gt;
VirtualDub comes as a .zip file. This means you will need a program to unzip it into its own directory. I recommend [http://www.win-rar.com/ WinRAR], because it allows you to simply right click on the VirtualDub .zip file and select &amp;quot;&amp;lt;u&amp;gt;E&amp;lt;/u&amp;gt;xtract to VirtualDub-(version number)&amp;quot;. This is the most efficient way I've seen to unzip things in Windows, because you don't have to open a program or make your own directory for VirtualDub. No further installation is required.&lt;br /&gt;
&lt;br /&gt;
In addition, in order for you to capture full framerate video you will need to download two additional pieces of software. The first, [http://www.avisynth.org/ avisynth], will allow you to split the fields of the captured video so that the full framerate is restored in progressive scan (since you will be capturing interlaced video). You will probably want to associate .avs files with Notepad (as you're asked to during the installation of avisynth) to make things easier on yourself later.&lt;br /&gt;
&lt;br /&gt;
==Acquiring Codecs==&lt;br /&gt;
&lt;br /&gt;
Once you have VirtualDub and the associated software ready to go, go ahead and download the codecs you will need. You will be using [http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html Huffyuv] (pronounced &amp;quot;Huff Why You Vee,&amp;quot; in case you're interested) as your codec when you capture. Huffyuv is also freeware. I also mirror [http://www.metroid2002.com/files/huffyuv-2.1.1.zip version 2.1.1 of Huffyuv here at SDA.].&lt;br /&gt;
&lt;br /&gt;
Huffyuv also comes as a .zip. Do the same thing you did for VirtualDub, only this time you will need to open the Huffyuv folder, right click on the huffyuv.inf file and click &amp;quot;Install&amp;quot; in the menu that appears. This will install Huffyuv for you.&lt;br /&gt;
&lt;br /&gt;
Your output codec will be the latest version of DivX, available from [http://www.divx.com/divx/download/ http://www.divx.com/divx/download/]. Open the .exe file you download from there and follow the instructions to install DivX. You will probably have to reboot your computer to install it. It doesn't cost anything to install, either, though.&lt;br /&gt;
&lt;br /&gt;
You don't need an input audio codec; you will just capture raw audio data without compression.&lt;br /&gt;
&lt;br /&gt;
For an output audio codec, I use [http://www.metroid2002.com/files/lameACM-20020202.zip version 0.8.0 of the LAME ACM]. This codec is a freeware MP3 encoder, maybe the best in the world. Be sure to only use the version I host here (0.8.0) - other versions have been proven to cause serious sound desynching issues. Once you've downloaded and unzipped the file, right click on the LameACM.inf file and click &amp;quot;Install&amp;quot; to install the codec, similarly to how you installed Huffyuv. You can visit [http://mp3dev.org LAME's homepage] to learn more about the codec, but the LAME ACM is not available there. I've decided to host it myself because it's a bit hard to find on the Internet, and because you could easily get an older version of the codec on accident.&lt;br /&gt;
&lt;br /&gt;
==Capturing Video==&lt;br /&gt;
&lt;br /&gt;
Once all three codecs are installed, it's time to open VirtualDub for the first time. Double-click on the VirtualDub.exe application to open it. You are presented with VirtualDub's Dub Mode, where you apply filters to video and audio and export data to a new file. You're not ready to use this mode yet, since you still need to capture your run.&lt;br /&gt;
&lt;br /&gt;
==Getting Started (Capturing)==&lt;br /&gt;
&lt;br /&gt;
Start by hooking your VCR up to your capture card. You will probably need to use the red or black (right channel) and white (left channel) audio cables, as well as the yellow (composite video) cable. If your VCR has an S-Video output, by all means hook up your VCR using S-Video (instead of by the yellow Composite cable), though inexpensive VCRs seldom have such outputs. Press Play on the VCR or on the VCR's remote to start playing your run. You will want to have some video playing to make adjustments to the capture software before you rewind the tape and start to capture it for real.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Ca&amp;lt;u&amp;gt;p&amp;lt;/u&amp;gt;ture AVI...&amp;quot; from the &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ile menu. If all goes well, you should be blasted with a large amount of audio static and a window full of snow. If you see your run already, fine; you can skip the next step.&lt;br /&gt;
&lt;br /&gt;
==Setting Settings==&lt;br /&gt;
&lt;br /&gt;
If you see snow, you need to tell your capture card to select the Composite or S-Video source, whichever you hooked your VCR up with. Select &amp;lt;u&amp;gt;S&amp;lt;/u&amp;gt;ource from the &amp;lt;u&amp;gt;V&amp;lt;/u&amp;gt;ideo menu, select Video Composite or S-Video from the &amp;quot;Select a Video Source:&amp;quot; dropdown menu, and then hit OK. If you have a card other than the ATI All-In-Wonder 9600, this process may be different for you. Consult your card's documentation.&lt;br /&gt;
&lt;br /&gt;
Once you see your run playing on your computer, it's time to set up your capture settings. Start with the three buttons in the lower right hand corner of the VirtualDub Capture Mode window. You need to click on the first button (starting at the left) and set it to 22.05 KHz, 16-bit stereo. (If you only plugged in a white cable since your VCR doesn't have stereo sound, select &amp;quot;mono&amp;quot; instead of &amp;quot;stereo&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
For the second button, choose 29.97 fps (if you're capturing NTSC video) or 25.00 fps (if you're capturing a PAL or SECAM video). If you are in the US or in Japan, you are most likely using NTSC. If you are in Europe, Australia or elsewhere, you are most likely using either PAL or SECAM (remember to select 30.00 fps instead of 25.00 fps if you used 60 Hz equipment to play and record your run; just don't worry about this if you don't know what that means). The third button is a display of how much bandwidth you need to write the data to the drive. There's no need to do anything with it.&lt;br /&gt;
&lt;br /&gt;
Next, choose &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ormat from the &amp;lt;u&amp;gt;V&amp;lt;/u&amp;gt;ideo menu. This shows the resolution you will be capturing at. If you are capturing NTSC, select 640 x 480. If you are capturing PAL or SECAM, select 704 x 576. This resolution will help you keep the image dimensions correct on the computer, so that the game isn't distorted (compared to watching it on a TV screen). Your capture will also be ready to be transformed into a full framerate video. Hit OK to close out of the Format window.&lt;br /&gt;
&lt;br /&gt;
After setting your resolution, select Co&amp;lt;u&amp;gt;m&amp;lt;/u&amp;gt;pression from the &amp;lt;u&amp;gt;V&amp;lt;/u&amp;gt;ideo menu. You should see the Huffyuv codec in the left part of the window. Select it and hit OK. Huffyuv will compress the video you are capturing by a factor of 2 or more without changing what you see at all. It is said to be the only non-lossy video compression codec in the world because of this. There's no need to set the audio compression now; you will do that later, after you've captured.&lt;br /&gt;
&lt;br /&gt;
Finally, set where you will capture by going to the &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ile menu and selecting &amp;quot;Set capture &amp;lt;u&amp;gt;f&amp;lt;/u&amp;gt;ile...&amp;quot;. You should use your largest available hard drive, or else just save as &amp;quot;capture.avi&amp;quot; or something on your Desktop for easy access. This is the file VirtualDub will capture to. Make sure that the file doesn't already exist, or it will be overwritten when you start to capture.&lt;br /&gt;
&lt;br /&gt;
Now go to the &amp;lt;u&amp;gt;C&amp;lt;/u&amp;gt;apture menu and select &amp;quot;&amp;lt;u&amp;gt;P&amp;lt;/u&amp;gt;references...&amp;quot;. Select all of the boxes before the word &amp;quot;Save&amp;quot;; there should be four of them. Then hit OK. This will save all of your settings (EXCEPT for the very first setting, the source setting on your capture card) so that you don't have to reset them the next time you capture something.&lt;br /&gt;
&lt;br /&gt;
==Capturing==&lt;br /&gt;
&lt;br /&gt;
With all of your settings set, you're ready to capture. Press F6 to start VirtualDub capturing, then press Play on your VCR (assuming you're already in the right place on the tape). You should see your run start on the monitor. Keep an eye on the &amp;quot;Frames dropped&amp;quot; indicator on the right side of the VirtualDub Capture Mode window. You should stop dropping frames almost entirely once the picture clears up (after a couple seconds). If not, then there may be a problem with your CPU speed, with your hard drive speed, with your capture settings, or with your capture card. Try to use the other readouts on the right side of the window to diagnose the problem.&lt;br /&gt;
&lt;br /&gt;
Beware of digital autotracking indicators. On many newer VCRs, annoying displays of the autotracking (or the time position) may cover your run. If this happens, press Rewind without stopping the tape (even though I say not to in the VHS section) and back up to just before your segment starts. If you press Play at the right time, the tape will start without trying to set the tracking again and the audio read head will sync before your segment starts. If head resynching happens too late and the video is distorted or audio is cut out, try pressing Rewind again to move further back. If you can't avoid losing some of your run due to VHS, try to remember to start recording longer before you start playing next time. Also keep in mind that every time you press Rewind or Fast Forward while your tape is playing, you risk damage to the tape.&lt;br /&gt;
&lt;br /&gt;
When you are done capturing, press Escape to tell VirtualDub to stop. Then select &amp;quot;E&amp;lt;u&amp;gt;x&amp;lt;/u&amp;gt;it capture mode&amp;quot; from the &amp;lt;u&amp;gt;F&amp;lt;/u&amp;gt;ile menu. You are now ready to start editing your newly captured run!&lt;br /&gt;
&lt;br /&gt;
Return to the [[Main Page|front page]].&lt;/div&gt;</summary>
		<author><name>Darkwasabi</name></author>	</entry>

	<entry>
		<id>https://kb.speeddemosarchive.com/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/Main_Page"/>
				<updated>2006-10-26T22:14:16Z</updated>
		
		<summary type="html">&lt;p&gt;Darkwasabi: /* Compressing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the [http://speeddemosarchive.com/ Speed Demos Archive] Knowledge Base. Here you will find information related to speed running and video capture.&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Current Contents ==&lt;br /&gt;
&lt;br /&gt;
===Getting Started: Recording a...===&lt;br /&gt;
* [[Console Recording|Console System (GC/PS2/XBOX/SNES/Genesis/NES/etc.)]]&lt;br /&gt;
* [[Digital Capture|PC Game]]&lt;br /&gt;
* [[Game Boy Capture|Game Boy, Game Boy Color, or Game Boy Advance game]]&lt;br /&gt;
* [[DS|Nintendo DS]]&lt;br /&gt;
* [[PSP|PSP]]&lt;br /&gt;
&lt;br /&gt;
===Media===&lt;br /&gt;
* [[VHS|VHS Info]]&lt;br /&gt;
* [[DVD|DVD Info]]&lt;br /&gt;
* [[Unfinalized DVD|Recovering data from unfinalized DVDs]]&lt;br /&gt;
&lt;br /&gt;
===Capture===&lt;br /&gt;
* [[Analog Capture|Analog Capture (game consoles)]]&lt;br /&gt;
* [[Digital Capture|Digital Capture (PC games)]]&lt;br /&gt;
* [[Mac Capture]]&lt;br /&gt;
&lt;br /&gt;
===Editing===&lt;br /&gt;
* [[Avisynth]]&lt;br /&gt;
* [[Editing in VirtualDub]]&lt;br /&gt;
&lt;br /&gt;
===Compressing===&lt;br /&gt;
* [[Megui|H.264 / AAC with Megui]]&lt;br /&gt;
* [[Batch Encoding|H.264 / AAC with CLI and batch files]]&lt;br /&gt;
* [[DivX|DivX / XviD / mp3 with VirtualDub(Mod)]]&lt;br /&gt;
* [[XviD / mp3 with VirtualDub(Mod) and MeGUI]]&lt;br /&gt;
&lt;br /&gt;
===Hosting===&lt;br /&gt;
* [[Video hosting services]]&lt;br /&gt;
* [[Famster]]&lt;br /&gt;
&lt;br /&gt;
===Other Pages===&lt;br /&gt;
* [[TAS|What is TAS?]]&lt;br /&gt;
* [[Verification Guidelines]]&lt;br /&gt;
&lt;br /&gt;
===Lossless Codecs===&lt;br /&gt;
* [[Lossless Codecs Comparison]]&lt;br /&gt;
&lt;br /&gt;
===Old===&lt;br /&gt;
* [[Recording FAQ|Old Recording FAQ (large)]]&lt;/div&gt;</summary>
		<author><name>Darkwasabi</name></author>	</entry>

	<entry>
		<id>https://kb.speeddemosarchive.com/AviSynth</id>
		<title>AviSynth</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/AviSynth"/>
				<updated>2006-10-19T01:09:52Z</updated>
		
		<summary type="html">&lt;p&gt;Darkwasabi: /* Part 5: Deinterlacing / Full framerate video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
To put it briefly, avisynth is a video editor like virtualdub except everything is done with scripts. For details, check [http://en.wikipedia.org/wiki/AviSynth Wikipedia]. The most important thing to learn right now is the concept of avisynth.&lt;br /&gt;
&lt;br /&gt;
Let's say you're still using virtualdub, &lt;br /&gt;
 &lt;br /&gt;
*You go through the menu or drag and drop your source video inside the program.&lt;br /&gt;
*You load the audio.&lt;br /&gt;
*You use the brackets to cut off frames you don't need.&lt;br /&gt;
*You go to the filters section and use resize.&lt;br /&gt;
*Resizing has made the picture blurry, so you add the sharpen filter.&lt;br /&gt;
 &lt;br /&gt;
So you did all that by moving your mouse, going through menus, etc. With avisynth you're creating a text-based file (.avs) to tell it what to do with text commands. The above would be, as an example: &lt;br /&gt;
 &lt;br /&gt;
*avisource(&amp;quot;myvideo.avi&amp;quot;)&lt;br /&gt;
*wavsource(&amp;quot;myaudio.wav&amp;quot;)&lt;br /&gt;
*Trim(4000,7000)&lt;br /&gt;
*Lanczos4Resize(320,240)&lt;br /&gt;
*XSharpen(30,40)&lt;br /&gt;
 &lt;br /&gt;
You save the avs file, and load that into megui or virtualdub for final compression. The advantage is that you don't have go through as many menus, you don't have to remember which frames you want to cut out, you have access to more advanced deinterlacing filters like mvbob, you can keep your scripts forever so that you don't have to start from scratch in case you want to re-encode them later.&lt;br /&gt;
&lt;br /&gt;
===How to use this guide.===&lt;br /&gt;
&lt;br /&gt;
Yes, avisynth can be confusing and hard to learn but it is very rewarding once you get the hang of it. I suggest you look at the sample scripts at the bottom of the page to get an idea of what a final script looks like. Then go through each section putting whatever you need into your own script. If you are having trouble, &amp;lt;i&amp;gt;and you probably will&amp;lt;/i&amp;gt; &amp;gt;:), do not hesitate to ask for help in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Installation / plugins==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.avisynth.org/ or http://sourceforge.net/project/showfiles.php?group_id=57023 to download Avisynth. You should see two versions, 2.5.6a and 2.5.7 RC. The first is the stable release, while the latter is at the moment still in the testing phase so you may get problems when editing your run. Note that to complete Part 11: SDA StatID you will need 2.5.7 RC 1 or higher, so make your choice between the wimpy road or living dangerously on the edge.&lt;br /&gt;
&lt;br /&gt;
With Avisynth installed, go to Start menu -&amp;gt; [All] Programs -&amp;gt; Avisynth -&amp;gt; Plugin Directory. This will open the directory where Avisynth stores its plugins. Copy the files from inside the [[Media:avisynthplugins.zip|avisynth plugins]] zip file to the avisynth plugins directory window you just opened.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The avisynth script==&lt;br /&gt;
&lt;br /&gt;
The work folder for this guide is &amp;quot;C:\video processing\&amp;quot; where all source files are located.&lt;br /&gt;
&lt;br /&gt;
Create a .txt document with a name of your choice. Rename the extension from .txt to .avs. If you can't see the extension and are running in Windows, open Windows Explorer, go to Tools -&amp;gt; Folder Options -&amp;gt; View and uncheck &amp;quot;Hide extensions for known filetypes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Open the avs file in Notepad or any text editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 1: Loading the plugins===&lt;br /&gt;
&lt;br /&gt;
Avisynth will automatically load any dll and avsi files located in the plugins directory. The only plugin that I recommend you load manually is DGDecode.dll since it's in its own folder. You can of course just copy and paste it into the plugins folder, but be sure to re-copy it if you update DGMPGDec. Change the file path if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;) # For DVD source&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 2: Loading the source files===&lt;br /&gt;
&lt;br /&gt;
There are different ways to load the source files and it all depends on what it is you're working with. Here is a list of available commands.&lt;br /&gt;
* avisource(video.avi)&lt;br /&gt;
* directshowsource(video)&lt;br /&gt;
* MPEG2source(video.d2v)&lt;br /&gt;
* Ac3source(video, sound.ac3)&lt;br /&gt;
* Wavsource(sound.wav)&lt;br /&gt;
* Mpasource(sound.mpa)&lt;br /&gt;
* AudioDub(video, sound)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You don't need to include the whole file path, as long as you keep the avs file in the same folder as the source files.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;capture card&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;screen capture software&amp;lt;/b&amp;gt; then it is quite simple to load the files. If avisource does not work, try directshowsource. Those using Camtasia will probably need to use the latter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Video and audio are already combined&lt;br /&gt;
avisource(&amp;quot;C:\video processing\video.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
### Video and audio are split&lt;br /&gt;
#AudioDub(avisource(&amp;quot;C:\video processing\video.avi&amp;quot;), wavsource(&amp;quot;C:\video processing\audio.wav&amp;quot;))&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the # before AudioDub. This is telling avisynth to skip over the line. If you need to use this line, remove the # and add one before the first avisource command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; If your video is separated in multiple parts, which is usually the case when recording with Fraps, then be sure to look at part 4 since it is linked to part 2.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;DVD recorder&amp;lt;/b&amp;gt; then your video and audio is most likely split. Make sure you've gone over the [[DVD|DVD page]] before continuing.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
AC3source(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
#AudioDub(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),MPASource(&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.mpa&amp;quot;)) &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
I hope you haven't removed the delay information from the sound files. Not that it's the end of the world if you did remove it, you'll just have to listen by ear until you get a close value with DelayAudio().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 3: Fixing audio delay===&lt;br /&gt;
&lt;br /&gt;
This will only work if the audio desync is constant and not progressive. Constant desync is when the desync at the beginning of the video is the same as the desync at the end of the video. You guessed right, it's easy to fix. Progressive desync, on the other hand, can be a huge pain and may require external tools to fix.&lt;br /&gt;
&lt;br /&gt;
The DelayAudio command is straightforward, but there is an extra concept worth learning. Look at the following two scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is there a difference between them? Yes and no. They both get the same result, however the script with one line makes it easier for projects where you append files together. I suggest using the format of the second script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 4: Appending===&lt;br /&gt;
&lt;br /&gt;
One of the best features of avisynth is its ability to do an aligned splice when appending video. There is usually a mismatch between the length of the video and the length of the audio, typically ranging from -50 ms to +50 ms. &amp;lt;b&amp;gt;This means that appending files in VirtualDub(Mod) will in almost all cases cause a desync&amp;lt;/b&amp;gt; because the audio of clip2 will be appended right after clip1. VirtualDub(Mod) is unable to do an aligned splice. Here is an illustration:&lt;br /&gt;
&lt;br /&gt;
[[Image:append.png]]&lt;br /&gt;
&lt;br /&gt;
You will probably never use UnalignedSplice. Here are different methods for using AlignedSplice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Method 1&lt;br /&gt;
AlignedSplice(avisource(&amp;quot;clip1.avi&amp;quot;), avisource(&amp;quot;clip2.avi&amp;quot;), avisource(&amp;quot;clip3.avi&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
### Method 2&lt;br /&gt;
a = avisource(&amp;quot;clip1.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;clip2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
AlignedSplice(a,b,c)&lt;br /&gt;
&lt;br /&gt;
### Method 3&lt;br /&gt;
avisource(&amp;quot;clip1.avi&amp;quot;)++avisource(&amp;quot;clip2.avi&amp;quot;)++avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob1.d2v&amp;quot;),&amp;quot;vob1 DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)++Ac3Source(MPEG2source(&amp;quot;vob2.d2v&amp;quot;),&amp;quot;vob2 DELAY -30ms.ac3&amp;quot;).DelayAudio(-0.030)&lt;br /&gt;
&lt;br /&gt;
### Method 4&lt;br /&gt;
import(&amp;quot;script1.avs&amp;quot;)++import(&amp;quot;script2.avs&amp;quot;)++import(&amp;quot;script3.avs&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 is good for when you're joining a lot of clips since it's easier to edit. Notice the double plus signs in method 3, this is the same as AlignedSplice. One plus sign would indicate UnalignedSplice. Method 4 is to join independent avisynth scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 5: Deinterlacing / Full framerate video===&lt;br /&gt;
&lt;br /&gt;
Deinterlacing isn't needed for video that is not interlaced such as computer games recorded with Fraps/Camtasia, or if your console game outputs in progressive mode and you captured in progressive mode as well. Otherwise, if your footage looks anything like the picture below with the horizontal lines, then you definitely need to deinterlace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; The SelectEven() command used in this section is still useful for those with beefy computers who recorded their computer game at 60 fps. The command will get you half framerate (30 fps) needed for LQ/MQ.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:dmc3interlaced.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avisynth will help you restore the full range of motion to your video. Capturing at 320 x 240 without Avisynth, as most people do, would cause you to lose half of your motion information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You should create separate avisynth scripts for each quality version that has differences between them. There's no sense in creating one avisynth script, encoding it, editing the script, encoding again, etc. With separate avisynth scripts you'll get less script errors, less headaches, and you'll be able to queue many encodes.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1&amp;lt;/b&amp;gt; = Full framerate. 59.94 for NTSC, 50 for PAL.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F2&amp;lt;/b&amp;gt; = Half framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F3&amp;lt;/b&amp;gt; = One third framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
LQ/MQ/HQ/IQ = Low/Medium/High/Insane quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;LQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;MQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;HQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;IQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;These values are meant to be used as a &amp;lt;u&amp;gt;guide&amp;lt;/u&amp;gt;. The framerate of your video will be limited by the framerate of the game you're recording. Final Fantasy and Kingdom Hearts are examples of games that run at 30 fps, and therefore there is no point in deinterlacing to 60 fps. You'll just end up with sets of duplicate frames.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Determining the framerate of the game.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's actually very easy to do, the important thing was to make you aware that games aren't always made to run at 60 fps. Basically, just follow the next section about full framerate, then at some point (the earlier the better) open the script in VirtualDub(Mod) or Media Player Classic and move frame by frame to check for duplicate sets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1 - Full framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the game you recorded outputs in low resolution then there's no reason to deinterlace with full resolution. The NES, SNES and Sega Genesis are examples of systems that output video in low resolution.&lt;br /&gt;
&lt;br /&gt;
Method 1 - Pros: Easy and fast. Cons: You'll notice a bobbing effect which is unpleasant to the eye. Harder for the encoder, bitrate usage is higher.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 - Pros: Zero bobbing. Great for the encoder, bitrate usage is lower. Cons: Slightly blurry image from resizing. Slow because of the mvbob filter (don't even think about using leakkernelbob).&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt; &lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
(RESIZE FILTER GOES HERE, check part 7)&lt;br /&gt;
(SHARPENING FILTER GOES HERE, check part 8)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method is commonly used for gameboy footage. Sharpening is probably a good idea, too, but don't go overboard.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Full resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
For full resolution deinterlacing leakkerneldeint or mvbob come into play. If you notice too many &amp;quot;lines&amp;quot; or interlacing artifacts as we like to call it, then lower the threshold value. The negative effect to lowering this is that you end up with more jaggedy edges, and loss of details. Use what you think is best.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### You may have to set order to 0. Try both to see which one works.&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those who want more quality at the cost of encoding speed can use mvbob instead of leakkernelbob. Nate uses this himself, so if you want to go the SDA way, go with mvbob. Beware, this thing is very, very slow. But it comes with a free Frogurt!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F2 - Half framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;High resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section is for games that run at 30 fps such as Final Fantasy, Kingdom Hearts.&lt;br /&gt;
&lt;br /&gt;
In certain cases gameplay will be in 30 fps(25 for PAL), but you still end up with interlaced video. This is because the fields shifted out of order, and in this case it's called combing. All you need to do is shift the fields back with their proper frame and it'll be deinterlaced, or decombed. Sounds simple, but usually these games just seem to be progressive at one point, and combed at another; almost as if it were random. This is fixed by using the Decomb filter with the Telecide() command.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
Telecide()&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
An easy way to check to see if your game runs at 30 fps is to separate the fields and look a section of gameplay frame by frame. Simply use separatefields() in your script. If the game flows frame by frame as if it were normal(except squashed), then it's at full framerate. If movement only occurs every other frame, then it is at 30 fps.&lt;br /&gt;
&lt;br /&gt;
With games that run at half framerate, there might be certain small parts in the game that are actually at full framerate such as menu screens.  Since they are usually just a small part of gameplay, you can just ignore it and let the Decomb filter deinterlace it. &lt;br /&gt;
&lt;br /&gt;
You can also manually tell the Decomb filter to decomb certain parts. You can do so by creating file called decomb.tel in the same directory as the avs file. First change your Telecide() command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Telecide(ovr=&amp;quot;decomb.tel&amp;quot;)&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now open up decomb.tel and tell it what frames you want matched.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
100,200 n&lt;br /&gt;
500,600 n&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This says frames 100-200 and 500-600 will be matched with the next.  Use p for the previous frame and c for the current frame. If you're not sure, just try them all out.&lt;br /&gt;
&lt;br /&gt;
Because your resulting framerate for the higher quality videos will be half that of normal, there's no need to encode Insane Quality. For High Quality simply use constant quantizer of 19 in h.264 and encode your audio at 320 kbps.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the easiest kind of deinterlacing. You barely even have to think about it. Looking at the picture above, notice all the individual horizontal lines. These show the fields. Every even numbered line is one field, while every odd numbered line is the other field. With half framerate we simply remove one of the fields. This reduces the height of the video by half, we'll take care of the width later on when resizing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F3 - One third framerate.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used for games that have problems with flickering sprites, typically what you see in older games. This is probably the trickiest kind of deinterlacing, so you may want to consult with others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
selectevery(3)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/SelectEvery&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 6: Trimming===&lt;br /&gt;
&lt;br /&gt;
Trim is used to cut out frames. The numbers inside the brackets represent the range of frames you want to keep. You should have the trim command somewhere after deinterlacing to avoid any confusion. To make it easier to find the frame range numbers, load the avs file into VirtualDub(Mod) since it displays the current frame number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Trim(100,50000)&lt;br /&gt;
&lt;br /&gt;
#Trim(100,35000)++Trim(36000,50000)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Warning:&amp;lt;/b&amp;gt; If you are using the selecteven() command, you will only have half as many frames in your video, so you must divide the values in your Trim() command by two to compensate.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Trim&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 7: Resizing===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 1:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Never resize to a resolution greater than that of the original source video. This is called &amp;quot;stretching&amp;quot; and does nothing to increase the quality of your video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 2:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; As mentioned in part 5, there's no point deinterlacing to full resolution when the game itself plays in low resolution. Obviously, do not resize videos of these games to full resolution.&lt;br /&gt;
&lt;br /&gt;
Be sure to read Part 8: Sharpening since resizing can possibly make the picture too blurry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for HQ/IQ full resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only time you should be resizing for HQ/IQ is if the aspect ratio is incorrect. People with &amp;lt;b&amp;gt;NTSC DVD&amp;lt;/b&amp;gt; recorders will end up with video at 720x480 resolution, an aspect ratio of 1.5:1. This is a problem since the game you're recording probably plays at an aspect ratio of 1.33:1, or more commonly reffered to as 4:3. In this case you would resize the video to 640x480. &amp;lt;b&amp;gt;PAL DVD&amp;lt;/b&amp;gt; video will come at 720x576 and needs to be resized to 704x576.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(640,480)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(704,576)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for MQ/LQ low resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This step is required to meet SDA standards. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(352,288)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Resize&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.avisynth.org/ReduceBy2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 8: Sharpening===&lt;br /&gt;
&lt;br /&gt;
When a picture or video has gone through significant resizing you usually end up with a blurry image. This is where sharpening comes in. Those who recorded their computer game with screen capture software are pretty much guaranteed a blurry image when resizing to the MQ resolution. Same with those who chose to deinterlace their video to the MQ resolution with the mvbob + resize method. Do not go overboard with the sharpening, play with the values until it looks right.&lt;br /&gt;
&lt;br /&gt;
Since XSharpen works in the YV12 colorspace, you will have to convert it first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
### Defaults are 30,40&lt;br /&gt;
XSharpen(30,40)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 9: Cropping / Adding borders===&lt;br /&gt;
&lt;br /&gt;
You may be tempted to crop out the black border of console recorded footage. It's best to leave them in, otherwise you're going to make more work for yourself dealing with strange resolutions, encoders not accepting them, and possibly using the resize command later only to get an incorrect aspect ratio. Cropping should be used sparingly.&lt;br /&gt;
&lt;br /&gt;
The following code corresponds to the illustration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(10,8,-14,-16)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:crop.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will probably not use the crop and add border commands. A good example of its combined use is if you want to get rid of some noise at the bottom of the video. You would crop it away, then add the border back. Only do this if the noise is along the black border of the video, we don't want to crop away gameplay footage...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(0,0,0,-10)&lt;br /&gt;
Addborders(0,0,0,10)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 10: Color / Brightness===&lt;br /&gt;
&lt;br /&gt;
Be very careful when playing around with color and brightness. If your video is too bright and looks greyish it will be rejected. Feel free to ask others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum] for their opinions about your video.&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Tweak&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Levels&lt;br /&gt;
&lt;br /&gt;
http://forum.doom9.org/showthread.php?t=93571&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 11: SDA StatID===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; This should be the last thing you do in your script. Make sure the script works without the StatID before continuing.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SDA uses Station ID's to protect the runner's and the site's identities. StatID's are placed at the beginning of a video and shown for a few seconds. They are the next best thing to watermarks. Below is an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:StatIDexample.png]]&lt;br /&gt;
&lt;br /&gt;
SDA realizes that those who encode their own runs and need manual timing can't show the time in the StatID, since final encodes are sent to Radix &amp;lt;i&amp;gt;and then&amp;lt;/i&amp;gt; timed. Until a solution is found, just make one without the time. A partial StatID is better than none.&lt;br /&gt;
&lt;br /&gt;
You will need to install [http://sourceforge.net/project/showfiles.php?group_id=57023 Avisynth 2.5.7 RC 1] or later in order for the script to work. You also need to download the [[Media:SDAlogo.png|SDA logo]] and place it in the same folder as your avisynth script, or make sure the paths are correct in the script.&lt;br /&gt;
&lt;br /&gt;
The script is designed to work with any source file at any resolution and at any framerate. The only thing you need to change is the subtitle. The \n indicates a new line. Place the code at the end of your script.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One thing you should watch out for is the line &amp;quot;clip=last&amp;quot; in the script. Depending on how you do your script, it may be written out differently. Take sample script #2 as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Sample scripts==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. DVD source, one segment, for HQ and IQ, deinterlacer: leakkerneldeint, gamma correction, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment3.d2v&amp;quot;),&amp;quot;segment3 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
Trim(588,37648)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
Levels(0, 1.2, 255, 16, 235)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. DVD source, two segments appended, for LQ and MQ DivX/Xvid, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
seg1 = Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
seg1.separatefields().selecteven()&lt;br /&gt;
seg1.Trim(76,109763)&lt;br /&gt;
seg1.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
seg2 = Ac3Source(MPEG2source(&amp;quot;segment2.d2v&amp;quot;),&amp;quot;segment2 192Kbps DELAY -32ms.ac3&amp;quot;).DelayAudio(-0.032)&lt;br /&gt;
seg2.separatefields().selecteven()&lt;br /&gt;
seg2.Trim(143,76875)&lt;br /&gt;
seg2.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=seg1&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++seg1++seg2&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Fraps source, split parts, one segment, for LQ and MQ, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
avisource(&amp;quot;seg7_part1.avi&amp;quot;)++avisource(&amp;quot;seg7_part2.avi&amp;quot;)++avisource(&amp;quot;seg7_part3.avi&amp;quot;)&lt;br /&gt;
Trim(439,60938)&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
XSharpen(35,40)  # A little sharper than default 30,40&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Fraps source, split parts, segmented run, all appended into one video, for HQ and IQ, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
a = avisource(&amp;quot;seg1_1.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;seg2_1.avi&amp;quot;)++avisource(&amp;quot;seg2_2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;seg3_1.avi&amp;quot;)++avisource(&amp;quot;seg3_2.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
a.trim(100,20877)&lt;br /&gt;
b.trim(16,10988)&lt;br /&gt;
c.trim(875,13000)&lt;br /&gt;
&lt;br /&gt;
AlignedSplice(a,b,c)  # Same as a++b++c&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5a.&amp;lt;/font&amp;gt; DVD source, one segment, for HQ and IQ, deinterlacer: mvbob, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
mvbob()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(600,38000)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5b.&amp;lt;/font&amp;gt; DVD source, one segment, for MQ and LQ, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(300,19000)&lt;br /&gt;
Lanczos4Resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkwasabi</name></author>	</entry>

	<entry>
		<id>https://kb.speeddemosarchive.com/AviSynth</id>
		<title>AviSynth</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/AviSynth"/>
				<updated>2006-10-14T22:22:20Z</updated>
		
		<summary type="html">&lt;p&gt;Darkwasabi: /* Part 5: Deinterlacing / Full framerate video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
To put it briefly, avisynth is a video editor like virtualdub except everything is done with scripts. For details, check [http://en.wikipedia.org/wiki/AviSynth Wikipedia]. The most important thing to learn right now is the concept of avisynth.&lt;br /&gt;
&lt;br /&gt;
Let's say you're still using virtualdub, &lt;br /&gt;
 &lt;br /&gt;
*You go through the menu or drag and drop your source video inside the program.&lt;br /&gt;
*You load the audio.&lt;br /&gt;
*You use the brackets to cut off frames you don't need.&lt;br /&gt;
*You go to the filters section and use resize.&lt;br /&gt;
*Resizing has made the picture blurry, so you add the sharpen filter.&lt;br /&gt;
 &lt;br /&gt;
So you did all that by moving your mouse, going through menus, etc. With avisynth you're creating a text-based file (.avs) to tell it what to do with text commands. The above would be, as an example: &lt;br /&gt;
 &lt;br /&gt;
*avisource(&amp;quot;myvideo.avi&amp;quot;)&lt;br /&gt;
*wavsource(&amp;quot;myaudio.wav&amp;quot;)&lt;br /&gt;
*Trim(4000,7000)&lt;br /&gt;
*Lanczos4Resize(320,240)&lt;br /&gt;
*XSharpen(30,40)&lt;br /&gt;
 &lt;br /&gt;
You save the avs file, and load that into megui or virtualdub for final compression. The advantage is that you don't have go through as many menus, you don't have to remember which frames you want to cut out, you have access to more advanced deinterlacing filters like mvbob, you can keep your scripts forever so that you don't have to start from scratch in case you want to re-encode them later.&lt;br /&gt;
&lt;br /&gt;
===How to use this guide.===&lt;br /&gt;
&lt;br /&gt;
Yes, avisynth can be confusing and hard to learn but it is very rewarding once you get the hang of it. I suggest you look at the sample scripts at the bottom of the page to get an idea of what a final script looks like. Then go through each section putting whatever you need into your own script. If you are having trouble, &amp;lt;i&amp;gt;and you probably will&amp;lt;/i&amp;gt; &amp;gt;:), do not hesitate to ask for help in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Installation / plugins==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.avisynth.org/ or http://sourceforge.net/project/showfiles.php?group_id=57023 to download Avisynth. You should see two versions, 2.5.6a and 2.5.7 RC. The first is the stable release, while the latter is at the moment still in the testing phase so you may get problems when editing your run. Note that to complete Part 11: SDA StatID you will need 2.5.7 RC 1 or higher, so make your choice between the wimpy road or living dangerously on the edge.&lt;br /&gt;
&lt;br /&gt;
With Avisynth installed, go to Start menu -&amp;gt; [All] Programs -&amp;gt; Avisynth -&amp;gt; Plugin Directory. This will open the directory where Avisynth stores its plugins. Copy the files from inside the [[Media:avisynthplugins.zip|avisynth plugins]] zip file to the avisynth plugins directory window you just opened.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The avisynth script==&lt;br /&gt;
&lt;br /&gt;
The work folder for this guide is &amp;quot;C:\video processing\&amp;quot; where all source files are located.&lt;br /&gt;
&lt;br /&gt;
Create a .txt document with a name of your choice. Rename the extension from .txt to .avs. If you can't see the extension and are running in Windows, open Windows Explorer, go to Tools -&amp;gt; Folder Options -&amp;gt; View and uncheck &amp;quot;Hide extensions for known filetypes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Open the avs file in Notepad or any text editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 1: Loading the plugins===&lt;br /&gt;
&lt;br /&gt;
Depending on what kind of source material you have, there will be some plugins you don't use. It doesn't hurt to load them though. Mvbob's extension is .avsi so it will automatically be loaded. Copy the following code into the avs file. Change the file paths if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;) # DVD&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\mpasource.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\Warpsharp.dll&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 2: Loading the source files===&lt;br /&gt;
&lt;br /&gt;
There are different ways to load the source files and it all depends on what it is you're working with. Here is a list of available commands.&lt;br /&gt;
* avisource(video.avi)&lt;br /&gt;
* directshowsource(video)&lt;br /&gt;
* MPEG2source(video.d2v)&lt;br /&gt;
* Ac3source(video, sound.ac3)&lt;br /&gt;
* Wavsource(sound.wav)&lt;br /&gt;
* Mpasource(sound.mpa)&lt;br /&gt;
* AudioDub(video, sound)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You don't need to include the whole file path, as long as you keep the avs file in the same folder as the source files.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;capture card&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;screen capture software&amp;lt;/b&amp;gt; then it is quite simple to load the files. If avisource does not work, try directshowsource. Those using Camtasia will probably need to use the latter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Video and audio are already combined&lt;br /&gt;
avisource(&amp;quot;C:\video processing\video.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
### Video and audio are split&lt;br /&gt;
#AudioDub(avisource(&amp;quot;C:\video processing\video.avi&amp;quot;), wavsource(&amp;quot;C:\video processing\audio.wav&amp;quot;))&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the # before AudioDub. This is telling avisynth to skip over the line. If you need to use this line, remove the # and add one before the first avisource command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; If your video is separated in multiple parts, which is usually the case when recording with Fraps, then be sure to look at part 4 since it is linked to part 2.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;DVD recorder&amp;lt;/b&amp;gt; then your video and audio is most likely split. Make sure you've gone over the [[DVD|DVD page]] before continuing.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
AC3source(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
#AudioDub(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),MPASource(&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.mpa&amp;quot;)) &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
I hope you haven't removed the delay information from the sound files. Not that it's the end of the world if you did remove it, you'll just have to listen by ear until you get a close value with DelayAudio().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 3: Fixing audio delay===&lt;br /&gt;
&lt;br /&gt;
This will only work if the audio desync is constant and not progressive. Constant desync is when the desync at the beginning of the video is the same as the desync at the end of the video. You guessed right, it's easy to fix. Progressive desync, on the other hand, can be a huge pain and may require external tools to fix.&lt;br /&gt;
&lt;br /&gt;
The DelayAudio command is straightforward, but there is an extra concept worth learning. Look at the following two scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is there a difference between them? Yes and no. They both get the same result, however the script with one line makes it easier for projects where you append files together. I suggest using the format of the second script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 4: Appending===&lt;br /&gt;
&lt;br /&gt;
One of the best features of avisynth is its ability to do an aligned splice when appending video. There is usually a mismatch between the length of the video and the length of the audio, typically ranging from -50 ms to +50 ms. &amp;lt;b&amp;gt;This means that appending files in VirtualDub(Mod) will in almost all cases cause a desync&amp;lt;/b&amp;gt; because the audio of clip2 will be appended right after clip1. VirtualDub(Mod) is unable to do an aligned splice. Here is an illustration:&lt;br /&gt;
&lt;br /&gt;
[[Image:append.png]]&lt;br /&gt;
&lt;br /&gt;
You will probably never use UnalignedSplice. Here are different methods for using AlignedSplice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Method 1&lt;br /&gt;
AlignedSplice(avisource(&amp;quot;clip1.avi&amp;quot;), avisource(&amp;quot;clip2.avi&amp;quot;), avisource(&amp;quot;clip3.avi&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
### Method 2&lt;br /&gt;
a = avisource(&amp;quot;clip1.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;clip2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
AlignedSplice(a,b,c)&lt;br /&gt;
&lt;br /&gt;
### Method 3&lt;br /&gt;
avisource(&amp;quot;clip1.avi&amp;quot;)++avisource(&amp;quot;clip2.avi&amp;quot;)++avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob1.d2v&amp;quot;),&amp;quot;vob1 DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)++Ac3Source(MPEG2source(&amp;quot;vob2.d2v&amp;quot;),&amp;quot;vob2 DELAY -30ms.ac3&amp;quot;).DelayAudio(-0.030)&lt;br /&gt;
&lt;br /&gt;
### Method 4&lt;br /&gt;
import(&amp;quot;script1.avs&amp;quot;)++import(&amp;quot;script2.avs&amp;quot;)++import(&amp;quot;script3.avs&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 is good for when you're joining a lot of clips since it's easier to edit. Notice the double plus signs in method 3, this is the same as AlignedSplice. One plus sign would indicate UnalignedSplice. Method 4 is to join independent avisynth scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 5: Deinterlacing / Full framerate video===&lt;br /&gt;
&lt;br /&gt;
Deinterlacing isn't needed for video that is not interlaced such as computer games recorded with Fraps/Camtasia, or if your console game outputs in progressive mode and you captured in progressive mode as well. Otherwise, if your footage looks anything like the picture below with the horizontal lines, then you definitely need to deinterlace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; The SelectEven() command used in this section is still useful for those with beefy computers who recorded their computer game at 60 fps. The command will get you half framerate (30 fps) needed for LQ/MQ.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:dmc3interlaced.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avisynth will help you restore the full range of motion to your video. Capturing at 320 x 240 without Avisynth, as most people do, would cause you to lose half of your motion information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You should create separate avisynth scripts for each quality version that has differences between them. There's no sense in creating one avisynth script, encoding it, editing the script, encoding again, etc. With separate avisynth scripts you'll get less script errors, less headaches, and you'll be able to queue many encodes.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1&amp;lt;/b&amp;gt; = Full framerate. 59.94 for NTSC, 50 for PAL.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F2&amp;lt;/b&amp;gt; = Half framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F3&amp;lt;/b&amp;gt; = One third framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
LQ/MQ/HQ/IQ = Low/Medium/High/Insane quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;LQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;MQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;HQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;IQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;These values are meant to be used as a &amp;lt;u&amp;gt;guide&amp;lt;/u&amp;gt;. The framerate of your video will be limited by the framerate of the game you're recording. Final Fantasy and Kingdom Hearts are examples of games that run at 30 fps, and therefore there is no point in deinterlacing to 60 fps. You'll just end up with sets of duplicate frames.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Determining the framerate of the game.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's actually very easy to do, the important thing was to make you aware that games aren't always made to run at 60 fps. Basically, just follow the next section about full framerate, then at some point (the earlier the better) open the script in VirtualDub(Mod) or Media Player Classic and move frame by frame to check for duplicate sets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1 - Full framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the game you recorded outputs in low resolution then there's no reason to deinterlace with full resolution. The NES, SNES and Sega Genesis are examples of systems that output video in low resolution.&lt;br /&gt;
&lt;br /&gt;
Method 1 - Pros: Easy and fast. Cons: You'll notice a bobbing effect which is unpleasant to the eye. Harder for the encoder, bitrate usage is higher.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 - Pros: Zero bobbing. Great for the encoder, bitrate usage is lower. Cons: Slightly blurry image from resizing. Slow because of the mvbob filter (don't even think about using leakkernelbob).&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt; &lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
(RESIZE FILTER GOES HERE, check part 7)&lt;br /&gt;
(SHARPENING FILTER GOES HERE, check part 8)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method is commonly used for gameboy footage. Sharpening is probably a good idea, too, but don't go overboard.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Full resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
For full resolution deinterlacing leakkerneldeint or mvbob come into play. If you notice too many &amp;quot;lines&amp;quot; or interlacing artifacts as we like to call it, then lower the threshold value. The negative effect to lowering this is that you end up with more jaggedy edges, and loss of details. Use what you think is best.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### You may have to set order to 0. Try both to see which one works.&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those who want more quality at the cost of encoding speed can use mvbob instead of leakkernelbob. Nate uses this himself, so if you want to go the SDA way, go with mvbob. Beware, this thing is very, very slow. But it comes with a free Frogurt!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F2 - Half framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;High resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section is for games that run at 30 fps such as Final Fantasy, Kingdom Hearts.&lt;br /&gt;
&lt;br /&gt;
In certain cases gameplay will be in 30 fps(25 for PAL), but you still end up with interlaced video. This is because the fields shifted out of order, and in this case it's called combing. All you need to do is shift the fields back with their proper frame and it'll be deinterlaced, or decombed. Sounds simple, but usually these games just seem to be progressive at one point, and combed at another; almost as if it were random. This is fixed by using the Decomb filter with the Telecide() command.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
Telecide()&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
An easy way to check to see if your game runs at 30 fps is to separate the fields and look a section of gameplay frame by frame. Simply use separatefields() in your script. If the game flows frame by frame as if it were normal(except squashed), then it's at full framerate. If movement only occurs every other frame, then it is at 30 fps.&lt;br /&gt;
&lt;br /&gt;
With games that run at half framerate, there might be certain small parts in the game that are actually at full framerate such as menu screens.  Since they are usually just a small part of gameplay, you can just ignore it and let the Decomb filter deinterlace it. &lt;br /&gt;
&lt;br /&gt;
You can also manually tell the Decomb filter to decomb certain parts. You can do so by creating file called decomb.tel in the same directory as the avs file. First change your Telecide() command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Telecide(ovr=&amp;quot;decomb.tel&amp;quot;)&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now open up decomb.tel and tell it what frames you want matched.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
100,200 n&lt;br /&gt;
500,600 n&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This says frames 100-200 and 500-600 will be matched with the next.  Use p for the previous frame and c for the current frame. If you're not sure, just try them all out.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the easiest kind of deinterlacing. You barely even have to think about it. Looking at the picture above, notice all the individual horizontal lines. These show the fields. Every even numbered line is one field, while every odd numbered line is the other field. With half framerate we simply remove one of the fields. This reduces the height of the video by half, we'll take care of the width later on when resizing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F3 - One third framerate.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used for games that have problems with flickering sprites, typically what you see in older games. This is probably the trickiest kind of deinterlacing, so you may want to consult with others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
selectevery(3)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/SelectEvery&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 6: Trimming===&lt;br /&gt;
&lt;br /&gt;
Trim is used to cut out frames. The numbers inside the brackets represent the range of frames you want to keep. You should have the trim command somewhere after deinterlacing to avoid any confusion. To make it easier to find the frame range numbers, load the avs file into VirtualDub(Mod) since it displays the current frame number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Trim(100,50000)&lt;br /&gt;
&lt;br /&gt;
#Trim(100,35000)++Trim(36000,50000)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Warning:&amp;lt;/b&amp;gt; If you are using the selecteven() command, you will only have half as many frames in your video, so you must divide the values in your Trim() command by two to compensate.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Trim&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 7: Resizing===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 1:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Never resize to a resolution greater than that of the original source video. This is called &amp;quot;stretching&amp;quot; and does nothing to increase the quality of your video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 2:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; As mentioned in part 5, there's no point deinterlacing to full resolution when the game itself plays in low resolution. Obviously, do not resize videos of these games to full resolution.&lt;br /&gt;
&lt;br /&gt;
Be sure to read Part 8: Sharpening since resizing can possibly make the picture too blurry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for HQ/IQ full resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only time you should be resizing for HQ/IQ is if the aspect ratio is incorrect. People with &amp;lt;b&amp;gt;NTSC DVD&amp;lt;/b&amp;gt; recorders will end up with video at 720x480 resolution, an aspect ratio of 1.5:1. This is a problem since the game you're recording probably plays at an aspect ratio of 1.33:1, or more commonly reffered to as 4:3. In this case you would resize the video to 640x480. &amp;lt;b&amp;gt;PAL DVD&amp;lt;/b&amp;gt; video will come at 720x576 and needs to be resized to 704x576.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(640,480)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(704,576)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for MQ/LQ low resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This step is required to meet SDA standards. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(352,288)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Resize&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.avisynth.org/ReduceBy2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 8: Sharpening===&lt;br /&gt;
&lt;br /&gt;
When a picture or video has gone through significant resizing you usually end up with a blurry image. This is where sharpening comes in. Those who recorded their computer game with screen capture software are pretty much guaranteed a blurry image when resizing to the MQ resolution. Same with those who chose to deinterlace their video to the MQ resolution with the mvbob + resize method. Do not go overboard with the sharpening, play with the values until it looks right.&lt;br /&gt;
&lt;br /&gt;
Since XSharpen works in the YV12 colorspace, you will have to convert it first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
### Defaults are 30,40&lt;br /&gt;
XSharpen(30,40)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 9: Cropping / Adding borders===&lt;br /&gt;
&lt;br /&gt;
You may be tempted to crop out the black border of console recorded footage. It's best to leave them in, otherwise you're going to make more work for yourself dealing with strange resolutions, encoders not accepting them, and possibly using the resize command later only to get an incorrect aspect ratio. Cropping should be used sparingly.&lt;br /&gt;
&lt;br /&gt;
The following code corresponds to the illustration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(10,8,-14,-16)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:crop.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will probably not use the crop and add border commands. A good example of its combined use is if you want to get rid of some noise at the bottom of the video. You would crop it away, then add the border back. Only do this if the noise is along the black border of the video, we don't want to crop away gameplay footage...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(0,0,0,-10)&lt;br /&gt;
Addborders(0,0,0,10)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 10: Color / Brightness===&lt;br /&gt;
&lt;br /&gt;
Be very careful when playing around with color and brightness. If your video is too bright and looks greyish it will be rejected. Feel free to ask others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum] for their opinions about your video.&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Tweak&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Levels&lt;br /&gt;
&lt;br /&gt;
http://forum.doom9.org/showthread.php?t=93571&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 11: SDA StatID===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; This should be the last thing you do in your script. Make sure the script works without the StatID before continuing.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SDA uses Station ID's to protect the runner's and the site's identities. StatID's are placed at the beginning of a video and shown for a few seconds. They are the next best thing to watermarks. Below is an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:StatIDexample.png]]&lt;br /&gt;
&lt;br /&gt;
SDA realizes that those who encode their own runs and need manual timing can't show the time in the StatID, since final encodes are sent to Radix &amp;lt;i&amp;gt;and then&amp;lt;/i&amp;gt; timed. Until a solution is found, just make one without the time. A partial StatID is better than none.&lt;br /&gt;
&lt;br /&gt;
You will need to install [http://sourceforge.net/project/showfiles.php?group_id=57023 Avisynth 2.5.7 RC 1] or later in order for the script to work. You also need to download the [[Media:SDAlogo.png|SDA logo]] and place it in the same folder as your avisynth script, or make sure the paths are correct in the script.&lt;br /&gt;
&lt;br /&gt;
The script is designed to work with any source file at any resolution and at any framerate. The only thing you need to change is the subtitle. The \n indicates a new line. Place the code at the end of your script.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One thing you should watch out for is the line &amp;quot;clip=last&amp;quot; in the script. Depending on how you do your script, it may be written out differently. Take sample script #2 as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Sample scripts==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. DVD source, one segment, for HQ and IQ, deinterlacer: leakkerneldeint, gamma correction, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\leakkerneldeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment3.d2v&amp;quot;),&amp;quot;segment3 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
Trim(588,37648)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
Levels(0, 1.2, 255, 16, 235)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. DVD source, two segments appended, for LQ and MQ DivX/Xvid, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\leakkerneldeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
seg1 = Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
seg1.separatefields().selecteven()&lt;br /&gt;
seg1.Trim(76,109763)&lt;br /&gt;
seg1.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
seg2 = Ac3Source(MPEG2source(&amp;quot;segment2.d2v&amp;quot;),&amp;quot;segment2 192Kbps DELAY -32ms.ac3&amp;quot;).DelayAudio(-0.032)&lt;br /&gt;
seg2.separatefields().selecteven()&lt;br /&gt;
seg2.Trim(143,76875)&lt;br /&gt;
seg2.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=seg1&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++seg1++seg2&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Fraps source, split parts, one segment, for LQ and MQ, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\Warpsharp.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
avisource(&amp;quot;seg7_part1.avi&amp;quot;)++avisource(&amp;quot;seg7_part2.avi&amp;quot;)++avisource(&amp;quot;seg7_part3.avi&amp;quot;)&lt;br /&gt;
Trim(439,60938)&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
XSharpen(35,40)  # A little sharper than default 30,40&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Fraps source, split parts, segmented run, all appended into one video, for HQ and IQ, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
a = avisource(&amp;quot;seg1_1.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;seg2_1.avi&amp;quot;)++avisource(&amp;quot;seg2_2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;seg3_1.avi&amp;quot;)++avisource(&amp;quot;seg3_2.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
a.trim(100,20877)&lt;br /&gt;
b.trim(16,10988)&lt;br /&gt;
c.trim(875,13000)&lt;br /&gt;
&lt;br /&gt;
AlignedSplice(a,b,c)  # Same as a++b++c&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5a.&amp;lt;/font&amp;gt; DVD source, one segment, for HQ and IQ, deinterlacer: mvbob, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
mvbob()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(600,38000)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5b.&amp;lt;/font&amp;gt; DVD source, one segment, for MQ and LQ, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(300,19000)&lt;br /&gt;
Lanczos4Resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkwasabi</name></author>	</entry>

	<entry>
		<id>https://kb.speeddemosarchive.com/AviSynth</id>
		<title>AviSynth</title>
		<link rel="alternate" type="text/html" href="https://kb.speeddemosarchive.com/AviSynth"/>
				<updated>2006-10-14T22:20:46Z</updated>
		
		<summary type="html">&lt;p&gt;Darkwasabi: /* Part 5: Deinterlacing / Full framerate video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
To put it briefly, avisynth is a video editor like virtualdub except everything is done with scripts. For details, check [http://en.wikipedia.org/wiki/AviSynth Wikipedia]. The most important thing to learn right now is the concept of avisynth.&lt;br /&gt;
&lt;br /&gt;
Let's say you're still using virtualdub, &lt;br /&gt;
 &lt;br /&gt;
*You go through the menu or drag and drop your source video inside the program.&lt;br /&gt;
*You load the audio.&lt;br /&gt;
*You use the brackets to cut off frames you don't need.&lt;br /&gt;
*You go to the filters section and use resize.&lt;br /&gt;
*Resizing has made the picture blurry, so you add the sharpen filter.&lt;br /&gt;
 &lt;br /&gt;
So you did all that by moving your mouse, going through menus, etc. With avisynth you're creating a text-based file (.avs) to tell it what to do with text commands. The above would be, as an example: &lt;br /&gt;
 &lt;br /&gt;
*avisource(&amp;quot;myvideo.avi&amp;quot;)&lt;br /&gt;
*wavsource(&amp;quot;myaudio.wav&amp;quot;)&lt;br /&gt;
*Trim(4000,7000)&lt;br /&gt;
*Lanczos4Resize(320,240)&lt;br /&gt;
*XSharpen(30,40)&lt;br /&gt;
 &lt;br /&gt;
You save the avs file, and load that into megui or virtualdub for final compression. The advantage is that you don't have go through as many menus, you don't have to remember which frames you want to cut out, you have access to more advanced deinterlacing filters like mvbob, you can keep your scripts forever so that you don't have to start from scratch in case you want to re-encode them later.&lt;br /&gt;
&lt;br /&gt;
===How to use this guide.===&lt;br /&gt;
&lt;br /&gt;
Yes, avisynth can be confusing and hard to learn but it is very rewarding once you get the hang of it. I suggest you look at the sample scripts at the bottom of the page to get an idea of what a final script looks like. Then go through each section putting whatever you need into your own script. If you are having trouble, &amp;lt;i&amp;gt;and you probably will&amp;lt;/i&amp;gt; &amp;gt;:), do not hesitate to ask for help in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Installation / plugins==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.avisynth.org/ or http://sourceforge.net/project/showfiles.php?group_id=57023 to download Avisynth. You should see two versions, 2.5.6a and 2.5.7 RC. The first is the stable release, while the latter is at the moment still in the testing phase so you may get problems when editing your run. Note that to complete Part 11: SDA StatID you will need 2.5.7 RC 1 or higher, so make your choice between the wimpy road or living dangerously on the edge.&lt;br /&gt;
&lt;br /&gt;
With Avisynth installed, go to Start menu -&amp;gt; [All] Programs -&amp;gt; Avisynth -&amp;gt; Plugin Directory. This will open the directory where Avisynth stores its plugins. Copy the files from inside the [[Media:avisynthplugins.zip|avisynth plugins]] zip file to the avisynth plugins directory window you just opened.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The avisynth script==&lt;br /&gt;
&lt;br /&gt;
The work folder for this guide is &amp;quot;C:\video processing\&amp;quot; where all source files are located.&lt;br /&gt;
&lt;br /&gt;
Create a .txt document with a name of your choice. Rename the extension from .txt to .avs. If you can't see the extension and are running in Windows, open Windows Explorer, go to Tools -&amp;gt; Folder Options -&amp;gt; View and uncheck &amp;quot;Hide extensions for known filetypes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Open the avs file in Notepad or any text editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 1: Loading the plugins===&lt;br /&gt;
&lt;br /&gt;
Depending on what kind of source material you have, there will be some plugins you don't use. It doesn't hurt to load them though. Mvbob's extension is .avsi so it will automatically be loaded. Copy the following code into the avs file. Change the file paths if needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;) # DVD&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\mpasource.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\Warpsharp.dll&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 2: Loading the source files===&lt;br /&gt;
&lt;br /&gt;
There are different ways to load the source files and it all depends on what it is you're working with. Here is a list of available commands.&lt;br /&gt;
* avisource(video.avi)&lt;br /&gt;
* directshowsource(video)&lt;br /&gt;
* MPEG2source(video.d2v)&lt;br /&gt;
* Ac3source(video, sound.ac3)&lt;br /&gt;
* Wavsource(sound.wav)&lt;br /&gt;
* Mpasource(sound.mpa)&lt;br /&gt;
* AudioDub(video, sound)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You don't need to include the whole file path, as long as you keep the avs file in the same folder as the source files.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;capture card&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;screen capture software&amp;lt;/b&amp;gt; then it is quite simple to load the files. If avisource does not work, try directshowsource. Those using Camtasia will probably need to use the latter.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Video and audio are already combined&lt;br /&gt;
avisource(&amp;quot;C:\video processing\video.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
### Video and audio are split&lt;br /&gt;
#AudioDub(avisource(&amp;quot;C:\video processing\video.avi&amp;quot;), wavsource(&amp;quot;C:\video processing\audio.wav&amp;quot;))&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Notice the # before AudioDub. This is telling avisynth to skip over the line. If you need to use this line, remove the # and add one before the first avisource command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; If your video is separated in multiple parts, which is usually the case when recording with Fraps, then be sure to look at part 4 since it is linked to part 2.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you used a &amp;lt;b&amp;gt;DVD recorder&amp;lt;/b&amp;gt; then your video and audio is most likely split. Make sure you've gone over the [[DVD|DVD page]] before continuing.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
AC3source(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
#AudioDub(MPEG2source(&amp;quot;C:\video processing\vob.d2v&amp;quot;),MPASource(&amp;quot;C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.mpa&amp;quot;)) &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
I hope you haven't removed the delay information from the sound files. Not that it's the end of the world if you did remove it, you'll just have to listen by ear until you get a close value with DelayAudio().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 3: Fixing audio delay===&lt;br /&gt;
&lt;br /&gt;
This will only work if the audio desync is constant and not progressive. Constant desync is when the desync at the beginning of the video is the same as the desync at the end of the video. You guessed right, it's easy to fix. Progressive desync, on the other hand, can be a huge pain and may require external tools to fix.&lt;br /&gt;
&lt;br /&gt;
The DelayAudio command is straightforward, but there is an extra concept worth learning. Look at the following two scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;)&lt;br /&gt;
DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob.d2v&amp;quot;),&amp;quot;vob DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Is there a difference between them? Yes and no. They both get the same result, however the script with one line makes it easier for projects where you append files together. I suggest using the format of the second script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 4: Appending===&lt;br /&gt;
&lt;br /&gt;
One of the best features of avisynth is its ability to do an aligned splice when appending video. There is usually a mismatch between the length of the video and the length of the audio, typically ranging from -50 ms to +50 ms. &amp;lt;b&amp;gt;This means that appending files in VirtualDub(Mod) will in almost all cases cause a desync&amp;lt;/b&amp;gt; because the audio of clip2 will be appended right after clip1. VirtualDub(Mod) is unable to do an aligned splice. Here is an illustration:&lt;br /&gt;
&lt;br /&gt;
[[Image:append.png]]&lt;br /&gt;
&lt;br /&gt;
You will probably never use UnalignedSplice. Here are different methods for using AlignedSplice:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Method 1&lt;br /&gt;
AlignedSplice(avisource(&amp;quot;clip1.avi&amp;quot;), avisource(&amp;quot;clip2.avi&amp;quot;), avisource(&amp;quot;clip3.avi&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
### Method 2&lt;br /&gt;
a = avisource(&amp;quot;clip1.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;clip2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
AlignedSplice(a,b,c)&lt;br /&gt;
&lt;br /&gt;
### Method 3&lt;br /&gt;
avisource(&amp;quot;clip1.avi&amp;quot;)++avisource(&amp;quot;clip2.avi&amp;quot;)++avisource(&amp;quot;clip3.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;vob1.d2v&amp;quot;),&amp;quot;vob1 DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)++Ac3Source(MPEG2source(&amp;quot;vob2.d2v&amp;quot;),&amp;quot;vob2 DELAY -30ms.ac3&amp;quot;).DelayAudio(-0.030)&lt;br /&gt;
&lt;br /&gt;
### Method 4&lt;br /&gt;
import(&amp;quot;script1.avs&amp;quot;)++import(&amp;quot;script2.avs&amp;quot;)++import(&amp;quot;script3.avs&amp;quot;)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 is good for when you're joining a lot of clips since it's easier to edit. Notice the double plus signs in method 3, this is the same as AlignedSplice. One plus sign would indicate UnalignedSplice. Method 4 is to join independent avisynth scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 5: Deinterlacing / Full framerate video===&lt;br /&gt;
&lt;br /&gt;
Deinterlacing isn't needed for video that is not interlaced such as computer games recorded with Fraps/Camtasia, or if your console game outputs in progressive mode and you captured in progressive mode as well. Otherwise, if your footage looks anything like the picture below with the horizontal lines, then you definitely need to deinterlace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; The SelectEven() command used in this section is still useful for those with beefy computers who recorded their computer game at 60 fps. The command will get you half framerate (30 fps) needed for LQ/MQ.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:dmc3interlaced.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Avisynth will help you restore the full range of motion to your video. Capturing at 320 x 240 without Avisynth, as most people do, would cause you to lose half of your motion information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; You should create separate avisynth scripts for each quality version that has differences between them. There's no sense in creating one avisynth script, encoding it, editing the script, encoding again, etc. With separate avisynth scripts you'll get less script errors, less headaches, and you'll be able to queue many encodes.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1&amp;lt;/b&amp;gt; = Full framerate. 59.94 for NTSC, 50 for PAL.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F2&amp;lt;/b&amp;gt; = Half framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;F3&amp;lt;/b&amp;gt; = One third framerate.&amp;lt;br&amp;gt;&lt;br /&gt;
LQ/MQ/HQ/IQ = Low/Medium/High/Insane quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;DivX (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (2D)&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;H.264 (3D)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;LQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;MQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F3&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F2&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1/F2&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;HQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;IQ&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;F1&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;These values are meant to be used as a &amp;lt;u&amp;gt;guide&amp;lt;/u&amp;gt;. The framerate of your video will be limited by the framerate of the game you're recording. Final Fantasy and Kingdom Hearts are examples of games that run at 30 fps, and therefore there is no point in deinterlacing to 60 fps. You'll just end up with sets of duplicate frames.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Determining the framerate of the game.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's actually very easy to do, the important thing was to make you aware that games aren't always made to run at 60 fps. Basically, just follow the next section about full framerate, then at some point (the earlier the better) open the script in VirtualDub(Mod) or Media Player Classic and move frame by frame to check for duplicate sets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F1 - Full framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the game you recorded outputs in low resolution then there's no reason to deinterlace with full resolution. The NES, SNES and Sega Genesis are examples of systems that output video in low resolution.&lt;br /&gt;
&lt;br /&gt;
Method 1 - Pros: Easy and fast. Cons: You'll notice a bobbing effect which is unpleasant to the eye. Harder for the encoder, bitrate usage is higher.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Method 2 - Pros: Zero bobbing. Great for the encoder, bitrate usage is lower. Cons: Slightly blurry image from resizing. Slow because of the mvbob filter (don't even think about using leakkernelbob).&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt; &lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
(RESIZE FILTER GOES HERE, check part 7)&lt;br /&gt;
(SHARPENING FILTER GOES HERE, check part 8)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method is commonly used for gameboy footage. Sharpening is probably a good idea, too, but don't go overboard.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Full resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
For full resolution deinterlacing leakkerneldeint or mvbob come into play. If you notice too many &amp;quot;lines&amp;quot; or interlacing artifacts as we like to call it, then lower the threshold value. The negative effect to lowering this is that you end up with more jaggedy edges, and loss of details. Use what you think is best.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### You may have to set order to 0. Try both to see which one works.&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those who want more quality at the cost of encoding speed can use mvbob instead of leakkernelbob. Nate uses this himself, so if you want to go the SDA way, go with mvbob. Beware, this thing is very, very slow. But it comes with a free Frogurt!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
mvbob()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F2 - Half framerate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;High resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This section is for games that run at 30 fps such as Final Fantasy, Kingdom Hearts.&lt;br /&gt;
&lt;br /&gt;
In certain cases gameplay will be in 29.97(I'll just say 30 for ease) fps(25 for PAL), but you still end up with interlaced video. This is because the fields shifted out of order, and in this case it's called combing. All you need to do is shift the fields back with their proper frame and it'll be deinterlaced, or decombed. Sounds simple, but usually these games just seem to be progressive at one point, and combed at another; almost as if it were random. This is fixed by using the Decomb filter with the Telecide() command.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
Telecide()&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
An easy way to check to see if your game runs at 30 fps is to separate the fields and look a section of gameplay frame by frame. Simply use separatefields() in your script. If the game flows frame by frame as if it were normal(except squashed), then it's at full framerate. If movement only occurs every other frame, then it is at 30 fps.&lt;br /&gt;
&lt;br /&gt;
With games that run at half framerate, there might be certain small parts in the game that are actually at full framerate such as menu screens.  Since they are usually just a small part of gameplay, you can just ignore it and let the Decomb filter deinterlace it. &lt;br /&gt;
&lt;br /&gt;
You can also manually tell the Decomb filter to decomb certain parts. You can do so by creating file called decomb.tel in the same directory as the avs file. First change your Telecide() command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Telecide(ovr=&amp;quot;decomb.tel&amp;quot;)&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now open up decomb.tel and tell it what frames you want matched.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
100,200 n&lt;br /&gt;
500,600 n&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This says frames 100-200 and 500-600 will be matched with the next.  Use p for the previous frame and c for the current frame. If you're not sure, just try them all out.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Low resolution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the easiest kind of deinterlacing. You barely even have to think about it. Looking at the picture above, notice all the individual horizontal lines. These show the fields. Every even numbered line is one field, while every odd numbered line is the other field. With half framerate we simply remove one of the fields. This reduces the height of the video by half, we'll take care of the width later on when resizing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;F3 - One third framerate.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Used for games that have problems with flickering sprites, typically what you see in older games. This is probably the trickiest kind of deinterlacing, so you may want to consult with others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### Use complementparity if the motion of the video seems to go back and forth.&lt;br /&gt;
#ComplementParity()&lt;br /&gt;
separatefields()&lt;br /&gt;
selectevery(3)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/SelectEvery&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 6: Trimming===&lt;br /&gt;
&lt;br /&gt;
Trim is used to cut out frames. The numbers inside the brackets represent the range of frames you want to keep. You should have the trim command somewhere after deinterlacing to avoid any confusion. To make it easier to find the frame range numbers, load the avs file into VirtualDub(Mod) since it displays the current frame number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Trim(100,50000)&lt;br /&gt;
&lt;br /&gt;
#Trim(100,35000)++Trim(36000,50000)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Warning:&amp;lt;/b&amp;gt; If you are using the selecteven() command, you will only have half as many frames in your video, so you must divide the values in your Trim() command by two to compensate.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Trim&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 7: Resizing===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 1:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; Never resize to a resolution greater than that of the original source video. This is called &amp;quot;stretching&amp;quot; and does nothing to increase the quality of your video.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Rule 2:&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt; As mentioned in part 5, there's no point deinterlacing to full resolution when the game itself plays in low resolution. Obviously, do not resize videos of these games to full resolution.&lt;br /&gt;
&lt;br /&gt;
Be sure to read Part 8: Sharpening since resizing can possibly make the picture too blurry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for HQ/IQ full resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only time you should be resizing for HQ/IQ is if the aspect ratio is incorrect. People with &amp;lt;b&amp;gt;NTSC DVD&amp;lt;/b&amp;gt; recorders will end up with video at 720x480 resolution, an aspect ratio of 1.5:1. This is a problem since the game you're recording probably plays at an aspect ratio of 1.33:1, or more commonly reffered to as 4:3. In this case you would resize the video to 640x480. &amp;lt;b&amp;gt;PAL DVD&amp;lt;/b&amp;gt; video will come at 720x576 and needs to be resized to 704x576.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(640,480)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(704,576)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Resizing for MQ/LQ low resolution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This step is required to meet SDA standards. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
### NTSC&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
### PAL&lt;br /&gt;
lanczos4resize(352,288)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Resize&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.avisynth.org/ReduceBy2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 8: Sharpening===&lt;br /&gt;
&lt;br /&gt;
When a picture or video has gone through significant resizing you usually end up with a blurry image. This is where sharpening comes in. Those who recorded their computer game with screen capture software are pretty much guaranteed a blurry image when resizing to the MQ resolution. Same with those who chose to deinterlace their video to the MQ resolution with the mvbob + resize method. Do not go overboard with the sharpening, play with the values until it looks right.&lt;br /&gt;
&lt;br /&gt;
Since XSharpen works in the YV12 colorspace, you will have to convert it first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
### Defaults are 30,40&lt;br /&gt;
XSharpen(30,40)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Part 9: Cropping / Adding borders===&lt;br /&gt;
&lt;br /&gt;
You may be tempted to crop out the black border of console recorded footage. It's best to leave them in, otherwise you're going to make more work for yourself dealing with strange resolutions, encoders not accepting them, and possibly using the resize command later only to get an incorrect aspect ratio. Cropping should be used sparingly.&lt;br /&gt;
&lt;br /&gt;
The following code corresponds to the illustration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(10,8,-14,-16)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:crop.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will probably not use the crop and add border commands. A good example of its combined use is if you want to get rid of some noise at the bottom of the video. You would crop it away, then add the border back. Only do this if the noise is along the black border of the video, we don't want to crop away gameplay footage...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Crop(0,0,0,-10)&lt;br /&gt;
Addborders(0,0,0,10)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 10: Color / Brightness===&lt;br /&gt;
&lt;br /&gt;
Be very careful when playing around with color and brightness. If your video is too bright and looks greyish it will be rejected. Feel free to ask others in the [http://speeddemosarchive.com/yabb/YaBB.pl?board=other Tech Support forum] for their opinions about your video.&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Tweak&lt;br /&gt;
&lt;br /&gt;
http://www.avisynth.org/Levels&lt;br /&gt;
&lt;br /&gt;
http://forum.doom9.org/showthread.php?t=93571&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Part 11: SDA StatID===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Tip:&amp;lt;/b&amp;gt; This should be the last thing you do in your script. Make sure the script works without the StatID before continuing.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SDA uses Station ID's to protect the runner's and the site's identities. StatID's are placed at the beginning of a video and shown for a few seconds. They are the next best thing to watermarks. Below is an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:StatIDexample.png]]&lt;br /&gt;
&lt;br /&gt;
SDA realizes that those who encode their own runs and need manual timing can't show the time in the StatID, since final encodes are sent to Radix &amp;lt;i&amp;gt;and then&amp;lt;/i&amp;gt; timed. Until a solution is found, just make one without the time. A partial StatID is better than none.&lt;br /&gt;
&lt;br /&gt;
You will need to install [http://sourceforge.net/project/showfiles.php?group_id=57023 Avisynth 2.5.7 RC 1] or later in order for the script to work. You also need to download the [[Media:SDAlogo.png|SDA logo]] and place it in the same folder as your avisynth script, or make sure the paths are correct in the script.&lt;br /&gt;
&lt;br /&gt;
The script is designed to work with any source file at any resolution and at any framerate. The only thing you need to change is the subtitle. The \n indicates a new line. Place the code at the end of your script.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One thing you should watch out for is the line &amp;quot;clip=last&amp;quot; in the script. Depending on how you do your script, it may be written out differently. Take sample script #2 as an example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Sample scripts==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. DVD source, one segment, for HQ and IQ, deinterlacer: leakkerneldeint, gamma correction, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\leakkerneldeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment3.d2v&amp;quot;),&amp;quot;segment3 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
LeakKernelBob(order=1,threshold=10,sharp=true,twoway=true,map=false)&lt;br /&gt;
Trim(588,37648)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
Levels(0, 1.2, 255, 16, 235)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. DVD source, two segments appended, for LQ and MQ DivX/Xvid, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\leakkerneldeint.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
seg1 = Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -66ms.ac3&amp;quot;).DelayAudio(-0.066)&lt;br /&gt;
seg1.separatefields().selecteven()&lt;br /&gt;
seg1.Trim(76,109763)&lt;br /&gt;
seg1.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
seg2 = Ac3Source(MPEG2source(&amp;quot;segment2.d2v&amp;quot;),&amp;quot;segment2 192Kbps DELAY -32ms.ac3&amp;quot;).DelayAudio(-0.032)&lt;br /&gt;
seg2.separatefields().selecteven()&lt;br /&gt;
seg2.Trim(143,76875)&lt;br /&gt;
seg2.lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=seg1&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++seg1++seg2&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Fraps source, split parts, one segment, for LQ and MQ, statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\Warpsharp.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
avisource(&amp;quot;seg7_part1.avi&amp;quot;)++avisource(&amp;quot;seg7_part2.avi&amp;quot;)++avisource(&amp;quot;seg7_part3.avi&amp;quot;)&lt;br /&gt;
Trim(439,60938)&lt;br /&gt;
lanczos4resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
XSharpen(35,40)  # A little sharper than default 30,40&lt;br /&gt;
&lt;br /&gt;
#StatID version 1.0&lt;br /&gt;
clip=last&lt;br /&gt;
&lt;br /&gt;
SDAlogo = (clip.width &amp;lt; 468 ? ImageSource(&amp;quot;SDAlogo.png&amp;quot;).lanczos4resize(clip.width,round(108.0*clip.width/468.0)) : ImageSource(&amp;quot;SDAlogo.png&amp;quot;))&lt;br /&gt;
FontSize = (clip.width &amp;lt; 640 ? 20 : 36)&lt;br /&gt;
StatID = Blankclip(clip,length=round(clip.framerate*4))&lt;br /&gt;
StatID = Overlay(StatID,SDAlogo,x=(clip.width-SDAlogo.width)/2,y=10)&lt;br /&gt;
StatID = Subtitle(StatID,&amp;quot;Besmir ‘Zoid’ Sheqi\nMetroid Prime: Hard [1:15]\nPart 1&amp;quot;,font=&amp;quot;Verdana&amp;quot;,size=FontSize,text_color=$FFFFFF,align=5,lsp=40)&lt;br /&gt;
&lt;br /&gt;
StatID++clip&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Fraps source, split parts, segmented run, all appended into one video, for HQ and IQ, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
a = avisource(&amp;quot;seg1_1.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)++avisource(&amp;quot;seg1_2.avi&amp;quot;)&lt;br /&gt;
b = avisource(&amp;quot;seg2_1.avi&amp;quot;)++avisource(&amp;quot;seg2_2.avi&amp;quot;)&lt;br /&gt;
c = avisource(&amp;quot;seg3_1.avi&amp;quot;)++avisource(&amp;quot;seg3_2.avi&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
a.trim(100,20877)&lt;br /&gt;
b.trim(16,10988)&lt;br /&gt;
c.trim(875,13000)&lt;br /&gt;
&lt;br /&gt;
AlignedSplice(a,b,c)  # Same as a++b++c&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5a.&amp;lt;/font&amp;gt; DVD source, one segment, for HQ and IQ, deinterlacer: mvbob, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
mvbob()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(600,38000)&lt;br /&gt;
Lanczos4Resize(640,480)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;font color=&amp;quot;#FF9900&amp;quot;&amp;gt;5b.&amp;lt;/font&amp;gt; DVD source, one segment, for MQ and LQ, brightness tweak, no statid&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Loadplugin(&amp;quot;C:\Program Files\DGMPGDec\DGDecode.dll&amp;quot;)&lt;br /&gt;
LoadPlugin(&amp;quot;C:\Program Files\AviSynth 2.5\plugins\ac3source.dll&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Ac3Source(MPEG2source(&amp;quot;segment1.d2v&amp;quot;),&amp;quot;segment1 192Kbps DELAY -48ms.ac3&amp;quot;).DelayAudio(-0.048)&lt;br /&gt;
separatefields()&lt;br /&gt;
selecteven()&lt;br /&gt;
Tweak(bright=10,cont=1.0)&lt;br /&gt;
Trim(300,19000)&lt;br /&gt;
Lanczos4Resize(320,240)&lt;br /&gt;
&lt;br /&gt;
ConvertToYV12()&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkwasabi</name></author>	</entry>

	</feed>