Difference between revisions of "Avs"
From SDA Knowledge Base
Ballofsnow (Talk | contribs) (walkthrough pics) |
Ballofsnow (Talk | contribs) (walkthrough) |
||
Line 29: | Line 29: | ||
<u>Walkthrough</u> | <u>Walkthrough</u> | ||
− | * Line by line through script with pictures. | + | * <s>Line by line through script with pictures.</s> |
<u>The script</u> | <u>The script</u> | ||
Line 69: | Line 69: | ||
IMPORTANT NOTE: AviSynth scripting is an advanced topic. All beginners are recommended to use [[Anri-chan]] instead. | IMPORTANT NOTE: AviSynth scripting is an advanced topic. All beginners are recommended to use [[Anri-chan]] instead. | ||
− | + | [[Glossary of terms]] | |
Line 158: | Line 158: | ||
<br> | <br> | ||
− | <div id="walkthrough" style="background:# | + | <div id="walkthrough" style="background:#198d3a;width:100%;"><font size="+1" color="#FFFFFF"> Walkthrough of a typical AviSynth script</font></div> |
− | + | Before starting your own script you should have an idea of how AviSynth operates. The following script is typical for DVD video. AviSynth will execute each line of code sequentially; in this walkthrough you will see what the video looks like after each step. | |
− | |||
<pre><nowiki> | <pre><nowiki> | ||
Ac3Source(MPEG2source("VTS_01_1.d2v", upconv=1),"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") | Ac3Source(MPEG2source("VTS_01_1.d2v", upconv=1),"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") | ||
Line 171: | Line 170: | ||
− | + | <b>A glance at the work folder</b> | |
+ | |||
+ | As you can see, the VOB has already been processed by DGIndex generating the files: | ||
+ | * VTS_01_1.d2v | ||
+ | * VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3 | ||
[[Image:AviSynth_walkthrough_workfolder.png]] | [[Image:AviSynth_walkthrough_workfolder.png]] | ||
− | + | <b>Load audio/video</b> | |
− | Ac3Source(MPEG2source("VTS_01_1.d2v", upconv=1),"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") | + | I open my_AviSynth_script.avs in Notepad and add the line below to load the Ac3 audio and MPEG2 video. VirtualDub shows that both have loaded succesfully. |
+ | |||
+ | <font color=orange>Ac3Source(</font><font color=magenta>MPEG2source("VTS_01_1.d2v", upconv=1)</font><font color=orange>,"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")</font> | ||
[[Image:AviSynth_walkthrough_loadsource.png]] | [[Image:AviSynth_walkthrough_loadsource.png]] | ||
− | + | <b>Deinterlace</b> | |
− | mvbob() | + | I've identified that the video is D1 F1 3D (will go into this later) so the appropriate deinterlacing method is mvBob. Notice how the number of frames has doubled from approximately 10000 frames to 20000. |
+ | |||
+ | <font color=orange>mvbob()</font> | ||
[[Image:AviSynth_walkthrough_deinterlace.png]] | [[Image:AviSynth_walkthrough_deinterlace.png]] | ||
− | + | <b>Trimming the fat</b> | |
− | trim(17451,17470) | + | I've decided, for the sake of this walkthrough, to <u>keep</u> only 20 frames. |
+ | |||
+ | <font color=orange>trim(17451,17470)</font> | ||
[[Image:AviSynth_walkthrough_trim.png]] | [[Image:AviSynth_walkthrough_trim.png]] | ||
− | + | <b>Resize</b> | |
− | Lanczos4Resize(640,480) | + | My NTSC DVD has a resolution of 720x480. I need to resize to 640x480 resolution so that the aspect ratio is correct and everything doesn't look so wide. |
+ | |||
+ | <font color=orange>Lanczos4Resize(640,480)</font> | ||
[[Image:AviSynth_walkthrough_resize.png]] | [[Image:AviSynth_walkthrough_resize.png]] | ||
− | + | <b>Extra: increase the brightness</b> | |
− | Tweak(bright=30,cont=1.0) | + | Here is an extra step I took since I wasn't happy with the darkness of the video. |
+ | |||
+ | <font color=orange>Tweak(bright=30,cont=1.0)</font> | ||
[[Image:AviSynth_walkthrough_tweakbright.png]] | [[Image:AviSynth_walkthrough_tweakbright.png]] | ||
+ | |||
+ | |||
+ | There are more commands you will use in your script, but the above is the essential part. |
Revision as of 13:50, 11 April 2009
quick link to old guide
quick link to wiki editing
Anchors
Snow's new AviSynth guide. Yeah, I hope I actually finish this.
Ideas for layout
- Custom table of contents, not so linear.
- Use PNG! Lossless is cool.
- Color headings.
Ideas for guide
- No more follow-these-steps-blindly instructions this time.
- Include more pictures. Use thumbnails when necessary.
- At the start of each section, show a typical script in progress.
- Include exercises with downloadable packages containing a video and a partial script.
Stuff to do:
Getting setup
- Introduction
-
Setting up a work environment -
Installation
Walkthrough
-
Line by line through script with pictures.
The script
- Loading the source files
- Appending
- Deinterlacing
- Trimming
- Resizing
- Sharpening
- Cropping / Adding borders
- Color / Brightness
- SDA StatID
- QuickTime compatibility
Extras
- Sample scripts
- Script verification
Fixes
- Fixing Constant audio desync
- Fixing Progressive audio desync
Table of contents:
IMPORTANT NOTE: AviSynth scripting is an advanced topic. All beginners are recommended to use Anri-chan instead.
File extensions
You'll very likely need to rename file extensions but they may be hidden by the operating system.
- open Windows Explorer
- open the Tools menu
- select Folder Options
- select the View tab
- choose to Show hidden files and folders
- uncheck Hide extensions for known file types
- click OK to apply changes.
Association of avs file extension with text editor
Now that you can see file extensions, let's associate the avs file extension with Notepad or other text editor of your choice.
- open Windows Explorer
- open the File menu
- select New
- select Text Document
- rename the new text file to New Text Document.avs. It should show up as an unknown type.
- open the avs file or right-click and select Open With. Windows will ask which program you want to use.
- select Notepad in the list
- place a checkmark in the box that says Always use the selected program to open this kind of file
- click OK
Download and install a stable release version of AviSynth
The picture below identifes a stable release.
Download and install necessary AviSynth plugins
- Go to Start menu
- [All] Programs
- AviSynth
- Plugin Directory. (This is where AviSynth stores its plugins.)
- Copy the files from inside the AviSynth plugins zip file to the Avisynth plugins directory window you just opened.
The plugins directory should look similar to what's shown in the picture. AviSynth will automatically load dll and avsi files.
Special instructions for those working with DVD sources
If you followed the instructions on the DVD page properly you should already have DGMPGDec installed. You need to copy a dll file from this directory to the AviSynth plugins directory in order for AviSynth to be able to load DVD video.
- navigate to the DGMPGDec directory. Should be C:\Program Files\DGMPGDec
- copy DGDecode.dll to the AviSynth plugins directory.
Download and install VirtualDub
This program will be useful for testing your script as you go along.
Verify that everything is installed properly
Download the following package and unzip the contents anywhere you'd like. Run VirtualDub and drag and drop the avs file into the window. You should see a frame that says "So far so good..".
Before starting your own script you should have an idea of how AviSynth operates. The following script is typical for DVD video. AviSynth will execute each line of code sequentially; in this walkthrough you will see what the video looks like after each step.
Ac3Source(MPEG2source("VTS_01_1.d2v", upconv=1),"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3") mvbob() trim(13801,13900) Lanczos4Resize(640,480)
A glance at the work folder
As you can see, the VOB has already been processed by DGIndex generating the files:
- VTS_01_1.d2v
- VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3
Load audio/video
I open my_AviSynth_script.avs in Notepad and add the line below to load the Ac3 audio and MPEG2 video. VirtualDub shows that both have loaded succesfully.
Ac3Source(MPEG2source("VTS_01_1.d2v", upconv=1),"VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")
Deinterlace
I've identified that the video is D1 F1 3D (will go into this later) so the appropriate deinterlacing method is mvBob. Notice how the number of frames has doubled from approximately 10000 frames to 20000.
mvbob()
Trimming the fat
I've decided, for the sake of this walkthrough, to keep only 20 frames.
trim(17451,17470)
Resize
My NTSC DVD has a resolution of 720x480. I need to resize to 640x480 resolution so that the aspect ratio is correct and everything doesn't look so wide.
Lanczos4Resize(640,480)
Extra: increase the brightness
Here is an extra step I took since I wasn't happy with the darkness of the video.
Tweak(bright=30,cont=1.0)
There are more commands you will use in your script, but the above is the essential part.