Avisynth v1.0 beta 3 (released Oct 21)
This is a prerelease version of the next major upgrade to Avisynth. It is still not documented, and there are probably some remaining bugs.
The following things have changed since the second beta:
- SeparateFields was not broken in beta 1, and my "fix" in beta 2 actually broke it. It's back the way it was before now.
- There's a new SegmentedDirectShowSource filter which works the same as SegmentedAVISource.
- Fixed DirectShowSource returning an invalid frame rate when the fps option was used.
- Fixed HorizontalReduceBy2 (and consequently ReduceBy2 as well).
- Fixed a crash in BilinearResize/BicubicResize.
- Avisynth now recognizes and reports some exceptions like access violation and division by zero, so you won't get "unknown error" as often.
- AVISource now uses the same method as VirtualDub to locate a video decompressor. This may resolve some problems people were having with this filter.
The following things changed between the first beta and the second beta:
- AddBorders, Letterbox, and SeparateFields are fixed.
- There's an all-new, 100% rewritten DirectShowSource filter which supports a lot more file formats than the old one. It's now almost true that it can read any format which Windows Media Player can play. There are some caveats:
- No sound support yet.
- No support for GRF files. I could add this if there's any demand for it.
- Some decoders (notably MS MPEG-4) will produce upside-down video. You'll have to use FlipVertical.
- DirectShow video decoders are not required to support frame-accurate seeking, and most don't. As long as you just read a portion of the video sequentially you should be fine, but heaven help you if you want to do anything more complicated. This limitation doesn't apply to AVI files, or to any other format for which there's a frame-accurate DirectShow decoder.
- DirectShow video decoders are not even required to tell you the frame rate of the incoming video. Most do, but the ASF decoder doesn't. I may eventually solve this by automatically analyzing the stream (as VirtualDub used to), but for now you have to specify the frame rate using the fps parameter, like this: DirectShowSource("video.asf", fps=15).
- This version automatically detects the Microsoft DV codec and sets it to decode at full (instead of half) resolution. I guess this isn't a caveat. :-)
- I noticed that the MS DV codec upsamples the chroma channels incorrectly, and I added a FixBrokenChromaUpsampling filter to compensate for it. You should put this after DirectShowSource if you're using the MS DV codec, or if you notice off-color lines appearing in interlaced images.
- AVISource now reports decompression errors (as it was supposed to) instead of returning a blank frame.
- I'm in the process of fixing the Premiere export plugin, and I'm also in the process of writing a corresponding plugin for MSPro6, but neither is done.
- Plugins for the previous beta will have to be recompiled.
The following things are new since 0.3. I've probably forgotten some, and I've definitely not had time to implement some, so this list is likely to expand.
- Problems with loading AVS scripts in TMPGEnc should be fixed.
- There's a new external plugin interface, which will be documented this time. Some preliminary documentation is available.
- There's a new interface which allows applications to use avisynth.dll as a video-processing library, without going through AVIFile or using AVS scripts.
- VirtualDub plugin filters are supported, via the LoadVirtualdubPlugin command. Convenient Avisynth-style interfaces to many VirtualDub plugins are available in the file vdfilters.avs, which is included with the DLL above.
- VFAPI plugins (TMPGEnc import plugins) are supported, via LoadVFAPIPlugin.
- Avisynth filters can now take named arguments. The named arguments can be specified in any order, and the filter will choose default values for any that you leave off. This makes certain filters much easier to use. For example, you can now write Subtitle("Hello, World!", text_color=$00FF00, x=100, y=200) instead of Subtitle("Hello, World!", 100, 200, 0, 999999, "Arial", 24, $00FF00).
- File source filters now use the directory containing the script as the base for relative paths. So if you want to load c:\misc\video\junk.avi from within c:\misc\video\myscript.avs, you can use just AVISource("junk.avi").
- The order of the parameters to some Avisynth functions has been rearranged. The most common change was to move the video-clip parameter(s) from the end of the parameter list to the beginning. OOP notation and implicit last now work with the first parameter instead of the last, so many scripts will continue to work unchanged.
- You can now access clip properties in AVS scripts. For example, if the variable clip holds a video clip, then clip.height is its height in pixels, clip.framecount is its length in frames, and so on. You can manipulate these values using all of the usual arithmetic and logical operators (from C), and execute code conditionally with the ?: operator. The full list of properties is: width, height, framecount, framerate, audiorate, audiolength, audiochannels, audiobits, IsRGB, IsYUY2, IsFieldBased, IsFrameBased.
- You can now define and call your own functions in AVS scripts, like this:
function NTSC2PAL(clip c) {
# Fairly good NTSC->PAL conversion. Would be better with Smart Bob. :-)
Assert(c.height == 480, "NTSC2PAL: input clip must have 480 scan lines")
Bob(c, height=576)
ChangeFPS(50)
SeparateFields().SelectEvery(4,0,3)
return Weave()
}
AVISource("ntsc.avi").NTSC2PAL()
- You can now import functions from other scripts with Import, which is useful for subroutine libraries like vdfilters.avs.
- There are new audio processing filters:
- Amplify(clip,amount) - multiply audio samples by "amount"
- Amplify(clip,left,right) - different factors for the two stereo channels
- AmplifydB(clip,amount) - same except values are in dB
- AmplifydB(clip,left,right)
- ResampleAudio(clip,new-sample-rate) - high-quality change of audio sample rate
- There are new filters for changing the frame rate:
- AssumeFPS(clip,new_fps[,sync_audio]) - changes the frame rate without changing the frame count (causing the video to play faster or slower); if sync_audio=true, also changes the audio sample rate to match
- ChangeFPS(clip,fps) - changes the frame rate, deleting or duplicating frames to preserve playback speed
- There are new synthesized source filters (note that many of these parameters are optional and can be referred to by name):
- BlankClip(template-clip,length,width,height,pixel_type,fps,fps_denominator,audio_rate,stereo,sixteen_bit,color) - replaces Blackness; you can now specify all clip properties without having to provide a template
- MessageClip("message",width,height,shrink,text_color,halo_color,bg_color) - produces a clip containing a text message; used internally for error reporting
- ColorBars(width, height) - produces SMPTE color bars scaled to any image size
- Other new filters: FlipVertical (for dealing with broken video codecs that decompress upside-down); ShowSMPTE(clip,framerate) (displays SMPTE time code).
- Miscellaneous new bookkeeping functions: floor, ceil, round (float-to-int conversion); IsBool, IsInt, IsFloat, IsString, IsClip, Defined (predicates); Default (returns x if Defined(x), d otherwise); Eval and Apply (Eval("f(x)") is equivalent to f(x) is equivalent to Apply("f", x)); Import (Evals contents of file); Assert (for error reporting).