» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Learn to script
»Discussion fora
»Project page
»External filters

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth



Section 2: AviSynth and frameserving

( Diese Seite in flag-germany.gif Deutsch )

Q2.1: What is frameserving and what is it good for ?

A: An excellent description is found on [Lukes homepage]:

"Frameserving is a process by which you directly transfer video data from one program on your computer to another. No intermediate or temporary files are created. The program that opens the source file(s) and outputs the video data is called the frameserver. The program that receives the data could be any type of video application.

There are two main reasons that you would want to frameserve a video:

  1. Save Disk Space: Depending the on the frameserving application, you can usually edit/process your video as it is being frameserved. Because frameserving produces no intermediate files, you can use a frameserver to alter your videos without requiring any additional disk space. For example, if you wanted to join two video files, resize them, and feed them to another video application, frameserving would allow you to do this without creating a large intermediate file.
  2. Increased Compatibility: To the video application that's receiving the frameserved video, the input looks like a relatively small, uncompressed video file. However, the source file that the frameserver is transferring could actually be, for example, a highly compressed MPEG-1 video. If your video application doesn't support MPEG-1 files, it's not a problem because the application is just receiving standard uncompressed video from the frameserver. This feature of frameserving enables you to open certain types of files in an application that wouldn't normally support them.

Furthermore, because the video application is being fed the source video one frame at a time, it doesn't know anything about the file size of the source video. Therefore, if your application has 2 GB or 4 GB limit on input file size, it won't have any effect on your frameserved video. You could feed 100 GB of video via a frameserver to an application limited to 2 GB and it wouldn't cause a problem."

Q2.2: How do I use AviSynth as a frameserver ?

A: Write a script using a text editor. Load your clip (see Q2.8) in AviSynth, do the necessary filtering and load the AVS-file in encoder/application X (must be an encoder or application which can read AVI-files, see Q2.3 and Q2.4).

Q2.3: How do I frameserve my AVS-file to encoder/application X ?


  1. Frameserving to TMPGEnc, CCE SP, VirtualDub or WMP6.4:
    Just open your AVS-file in TMPGEnc, CCE SP, VirtualDub or WMP6.4 (or whatever encoder/application you use) and have a look at Q2.4.
  2. Frameserving to VFAPI:
    For VFAPI you need to install the [ReadAVS] plugin. Just copy ReadAVS.dll to the VFAPI reader directory and open the reg-file ReadAVS.reg in notepad and change the corresponding path. Save it, and doubleclick on it to merge it with your registry-file.
  3. Frameserving to Premiere or Ulead:
  4. Frameserving to Windows Media 9 Encoder:
    Download Nic's Windows Media 9 Encoder and make sure you also installed the Windows Media 9 codec. Both can be found [here].

Q2.4: Problems when Encoder X reads AVS-files ?


  1. Why can't I open my AVS-file in TMPGEnc (this happens in old versions of TMPGEnc) ?
    • Install VFAPI plugin for TMPGEnc
    • Disable the direct show filters within TMPGEnc and turn off the VirtualDub proxy before frameserving.
    • Add "ConvertToRGB24" at the end of your AVS-file.
    • Install [Huffyuv]/DivX5 codec so that it can do the decompression for you when loading an AVI in TMPGEnc.
    • Install the [ReadAVS] plugin.
  2. CCE SP crashes when reading an AVS-file, what to do ?
    • If you're using Win2k then run CCE in WinNT4-SP5 compatibility mode.
    • If you're frameserving with AviSynth v1.0x/v2.0x put "ResampleAudio(44100)" in your script, even if you don't have any audio in your AVS-file.
    • If you're frameserving with AviSynth v2.5x the ResampleAudio trick doesn't work anymore because it doesn't add a silent audio stream to your video clip. Instead make a script (called "addaudio.avsi") as described [here], and put it in your plugin dir.
  3. Encoders/players (like CCE SP v2.62/v2.64) will not read AVS-files ?
    Many "new" programs do NOT use the Windows functions to read the AVI-files. If they do NOT use those standard Windows functions the AviSynth-script files will not work. Known programs that do NOT use those routines are CCE SP v2.62, Windows Media Encoder vx.x. Furthermore people report problems with Windows Media Player 7.
    • Use CCE SP v2.50 and WMP6.4 (under "Program Files" and "Windows Media Player" you will find a file called "mplayer2.exe", this is WMP6.4). In case that you want to use Windows Media Encoder you can use the AVI Wrapper "makeAVIS" instead, see Q2.3. For Windows Media Encoder 9 have a look at Q2.3.
    • If you still want to use CCE SP v2.62 you can try the following: Frameserve to CCE SP v2.62 with makeAVIS. Create an AVS script and then make a fake AVI with makeAVIS.
    • Cinemacraft says that their CCE SP v2.66 can accept AviSynth scripts. So if you have this version you sould be safe.
  4. Wrong YUY2 Codec causes colorspace errors on AVISynth scripts feeding TMPGEnc. Some time ago I suddenly found that feeding TMPGEnc with an AVISynth script resulted in what looked like a colorspace conversion error; as if the video had been badly dithered down from 24 bit to 8 bit! (..)

Q2.5: How do I frameserve from Premiere/Ulead/Vegas to AviSynth ?

A: You can try the AviSynth compatible frameserver (import) for [PluginPace frameserver (by Satish Kumar)]: For frameserving from SonicFoundry Vegas (and earlier Vegas Video/VideoFactory? versions), Adobe Premiere or Ulead MediaStudio Pro to AviSynth. [discussion].

Q2.6: When frameserving I got the following message: "Script error, there is no function named "xxx (some filter)"" ?

A: You probably installed/registered a version of AviSynth which doesn't contain the filter. Make sure that there are no other versions floating around on your hard disc (there's a possibility that a version will be registered while it is not in your system directory). Check that the right version is registered, see also Q1.19.

Q2.7: I get an unrecognized exception error trying to load an avs file with VirtualDub, using dvd2avi v1.77.3 ?

A: .d2v created with dvd2avi v1.77.3 is NOT compatible with mpeg2dec.dll! Use v1.76 instead. If you still want to use v1.77.3, make sure that you have AviSynth v2.5 installed and mpeg2dec3.dll v1.07 (or a more recent version).

Q2.8: How do I load my clip into AviSynth (video) ?

A: Make a script containing the lines (replace the filename and the path of the filename):

  • AVI-files (with uncompressed WAV, or CBR/VBR MP3-audio (v2.04)):
disabling the audio:
     AviSource("d:\filename.avi", false)
  • AVI-files that AviSource doesn't support (for example "DV type I AVI-files"):
     DirectShowSource("d:\filename.avi")  # no audio support yet
  • Using AviSynth v2.0x and mpeg2dec.dll:
    Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:
  • Using AviSynth v2.5x and MPEGdecoder.dll:
or (only the video stream)
     mpegsource("d:\filename.m2v", -2, "raw")
  • Using AviSynth v2.0x and mpeg2dec.dll:
    Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:
  • Using AviSynth v2.5x and MPEGdecoder.dll:
  • ATSC transport streams (extension *.trp or *.ts):
  • Using AviSynth v2.0x:
    Download mpeg2dec2 and a special version of [dvd2avi]. Don't forget to specify the video and audio pid's in the DVD2AVI.ini file:
  • Using AviSynth v2.0x/v2.5x:
    Download mpeg2dec3 v1.07 (or a more recent version) or mpegdecoder and a special version of [dvd2avi]:
or if you want to used mpegdecoder:
If both methods fail you can try [HDTV2MPEG2] (produces non dvd compliant mpeg2 files) to create a temporary mpeg2 file and import that in AviSynth with dvd2avi. For demuxing AAC audio: use [TSDemux].
The Moonlight [Xmuxer] package has also a bunch of DirectShow filters that deal with muxing and demuxing MPEG-1/2 TS and PVA files.
  • PVA transport streams:
    You are out of luck here. AFAIK the only option is !PVAStrumento.
    The Moonlight [Xmuxer] package has also a bunch of DirectShow filters that deal with muxing and demuxing MPEG-1/2 TS and PVA files.
  • d2v-files (DVD2AVI frameserver files):
  • vdr-files (VirtualDub's frameserver files):
  • ASF-files (the framerate has to be specified, right click on the file in windows explorer):
     DirectShowSource("d:\filename.asf", fps=15)
  • tpr-files (TMPGEnc project files):
    First note that the plugin GreedyHMA is proving to be a better IVTC solution (not to mention *MUCH* easier) than TMPGEnc. So if you want to use TMPGEnc for this get the GreedyHMA plugin (this plugin works in YUV-space). If you still want to import a tpr-file into an AVS-file, there are two possibilities:
  • first one: The TMPGEnc plugin is contained in the VFAPI Plugin zip file (ends with -vfp.zip) which can be download from Dooms site. (This method doesn't always work, some encoders like CCE SP can't read them.)
  • second one: Import the tpr-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB-space). See also [1].
  • aup-files (AviUtl projects):
    I don't know if it is possible to load it directly into AviSynth. Import the aup-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB). See also [2].
  • QuickTime-files (see [3]):
or if that doesn't work download a plugin (can be found in Dooms download section):
     LoadVFAPIPlugin("C:\QTReader\QTReader.vfp", "QTReader")
  • AVS-files:
    Just import it at the beginning of your script:
In v2.05 or a more recent version you can use the autoplugin loading. Just move your AVS-file in the autoloading plugindir, and rename the extension to 'avsi'.

Q2.9: How do I load my clip into AviSynth (audio) ?

A: This can be done in several ways:

  • Using AviSource (with uncompressed WAV, CBR/VBR MP2-audio (starting from v2.04) or CBR/VBR MP3-audio (starting from v2.04)):
Starting from v2.05 you can extract audio from a AVI-file in this way:
  • Use the audio decoder plugin MPASource, see Q3.4 and Q3.5 for importing mp1/mp2/mp3 audio.
  • Put a WAV-header on your [mp2] or mp3 (with Besweet) audio file and use WavSource to import the audio. You also need ACM codecs for [mp2], and for mp3 (Radium codec, see doom's download section). Use WavSource to load the WAV:

Up to v2.07 the audio must be mono or stereo. Starting from v2.5 you can also import uncompressed multichannel audio.

Q2.10: Can I load an audio file other than a WAV-file?

A: Yes:

  • Uncompressed audio files (that is uncompressed WAV-files) can be loaded in all versions up to v2.03.
  • Starting from v2.04 compressed WAV-files can be loaded (currently only MP2/MP3-files with a WAV-header).
  • Starting from v2.5 you can also load uncompressed multichannel audio.
  • Using the MPASource and AC3filter plugins you can import mp1/mp2/mp3 and AC3 audio.

See also Q2.9.

Q2.11: How do I join video and audio ?

A: Make an avs-file containing the lines (change the filenames and paths):

video = AviSource("d:\filename1.avi")
audio = ((AviSource|WavSource))("d:\filename2.wav")
AudioDub(video, audio)
Q2.12: I get an unrecognized exception in the line I use DirectShowSource?

A: Have you got VobSub installed? Have a look at this [thread]. Upgrade to VobSub v2.20 or higher. If someone has an explanation, please post it in the thread.

Back to AviSynthFaq

SourceForge Logo


Edit this document | View document history
Document last modified Sat, 12 Mar 2005 09:50:09