Difference between revisions of "AviSynth"

From SDA Knowledge Base

Jump to: navigation, search
Line 13: Line 13:
 
==The avisynth script==
 
==The avisynth script==
  
The work folder for this guide is "C:\Program Files\video processing\" where all source files are located.
+
The work folder for this guide is "C:\video processing\" where all source files are located.
  
Create a .txt document with a name of your choice, we'll name it vob. 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 -> Folder Options -> View and uncheck "Hide extensions for known filetypes".
+
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 -> Folder Options -> View and uncheck "Hide extensions for known filetypes".
  
Open vob.avs in Notepad or any text editor.
+
Open the avs file in Notepad or any text editor.
  
  
 
<b>Part 1: Loading the plugins</b>
 
<b>Part 1: Loading the plugins</b>
  
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 vob.avs. Change the file paths if needed.
+
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.
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 34: Line 34:
  
 
<b>Part 2: Loading the source files</b>
 
<b>Part 2: Loading the source files</b>
 +
 +
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.
 +
* avisource("video.avi")
 +
* directshowsource("video.avi")
 +
* MPEG2source("video.d2v")
 +
* Ac3source(video, "sound.ac3")
 +
* Wavsource("sound.wav")
 +
* Mpasource("sound.mpa")
 +
* AudioDub(video, sound)
 +
 +
 +
<font color="green"><b>Advanced tip:</b> 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.</font>
 +
 +
 +
If you used a <b>capture card</b> or <b>screen capture software</b> 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.
 +
<pre><nowiki>
 +
### Video and audio are already combined
 +
avisource("C:\video processing\video.avi")
 +
 +
### Video and audio are split
 +
#AudioDub(avisource("C:\video processing\video.avi"), wavsource("C:\video processing\audio.wav"))
 +
</nowiki></pre>
 +
Notice the # before AudioDub. This is telling avisynth to skip over this line. If you need to use this line, remove the # and add one before the first avisource command.
 +
 +
 +
If you used a <b>DVD recorder</b> then your video and audio is most likely split. Make sure you've gone over the [[DVD|DVD page]] before continuing.
 +
<pre><nowiki>
 +
AC3source(MPEG2source("C:video processing\vob.d2v"),"C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.ac3")
 +
#AudioDub(MPEG2source("C:video processing\vob.d2v"),MPASource("C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.mpa"))
 +
</nowiki></pre>
 +
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.
 +
 +
 +
<b>Part 3: Fixing audio delay</b>
 +
 +
This will only work if the audio desync is constant and not progressive.

Revision as of 15:19, 25 August 2006

Introduction

Avisynth rocks my socks.


Installation / plugins

Go to http://www.avisynth.org/ and download the latest non-alpha version of Avisynth. It is currently at 2.5.6a. Install the program.

With Avisynth installed, go to Start menu -> [All] Programs -> Avisynth -> Plugin Directory. This will open the directory 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 avisynth script

The work folder for this guide is "C:\video processing\" where all source files are located.

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 -> Folder Options -> View and uncheck "Hide extensions for known filetypes".

Open the avs file in Notepad or any text editor.


Part 1: Loading the plugins

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.

Loadplugin("C:\Program Files\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ac3source.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ac3source.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Warpsharp.dll")

Part 2: Loading the source files

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.

  • avisource("video.avi")
  • directshowsource("video.avi")
  • MPEG2source("video.d2v")
  • Ac3source(video, "sound.ac3")
  • Wavsource("sound.wav")
  • Mpasource("sound.mpa")
  • AudioDub(video, sound)


Advanced tip: 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.


If you used a capture card or screen capture software 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.

### Video and audio are already combined
avisource("C:\video processing\video.avi")

### Video and audio are split
#AudioDub(avisource("C:\video processing\video.avi"), wavsource("C:\video processing\audio.wav"))

Notice the # before AudioDub. This is telling avisynth to skip over this line. If you need to use this line, remove the # and add one before the first avisource command.


If you used a DVD recorder then your video and audio is most likely split. Make sure you've gone over the DVD page before continuing.

AC3source(MPEG2source("C:video processing\vob.d2v"),"C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.ac3")
#AudioDub(MPEG2source("C:video processing\vob.d2v"),MPASource("C:\video processing\vob T01 2_0ch 192Kbps DELAY -66ms.mpa")) 

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.


Part 3: Fixing audio delay

This will only work if the audio desync is constant and not progressive.

Personal tools