Recently I have decided to try out the Avisynth VHS effect to get a nice retro effect to an animation that I made. However, when I drag the effect into VirtualDub, I just get this annoying error:
Avisynth open failure:
Script error: expected
(C:/Users/Owner/OneDrive/Desktop/Newfolder/EFFECT.avs, line 21, column 28)
I also didn't know where else to post this thread cause I'm a newbie. But any help would be nice.
+ Reply to Thread
Results 1 to 30 of 30
Post the complete script here
Heres the full script:
#AviSynth Editing Script File - Made for AviSynth v2.58 (Might or might not work on other versions.)
#Drag this file into VirtualDub window.
#Commands in CAPITALS have notes/tips below.
#EXTERNAL FONT IS USED (Camcorder Monospaced)
#Download it from http://badmeangood.com/CAMCORDER_FONT_FAMILY/ -> Click "DOWNLOAD CAMCORDER FONT FAMILY (OPENTYPE)"
#In downloaded ZIP, locate this: CAMCORDER FONT FAMILY -> CAMCORDER MONOSPACED -> CAMCORDER_MS_REG.otf
#Extract and install CAMCORDER_MS_REG.otf font.
#If AVISOURCE below gives an error, use DirectShowSource or better yet, convert it into H.264/AVC or MPEG-4/ASP instead.
#Important! The video must contain an Audio stream!
#== VIDEO INPUT ==#
#SOURCEVIDEO: Your raw footage in AVI format (It should be encoded in H.264/AVC or MPEG-4/ASP)
#Note: You can omit file path if it is in the same folder as this file.
#ADDBORDERS of (32,20,32,20) is between title safe and action safe.
#use (8,0,8,0) for full image area. (4:3 Aspect Ratio source)
#use (8,80,8,80) for widescreen. (16:9 Aspect Ratio source)
#== GREYSCALE ==#
hsyncloss1=mergeARGB(showgreen(loss),showblue(loss ),showblue(loss),showblue(loss)).pointresize(400,4 80)
#== COLOR ==#
#ADDBORDERS: How off-set is the chroma channel from luma (X,Y,0,0) X=Horizontally, Y=Vertically (Both Even Number)
#For NTSC color (Hue Tinting)
#For PAL color (No Tinting, removes blue tint)
colorlossu=mergeARGB(showred(loss),showblue(loss), showblue(loss),showblue(loss)).pointresize(400,480 )
color=mergechroma(coloru,colorv,0.5).coloryuv(gain _y=-256, cont_u=128, cont_v=128)
#== AUDIO ==#
#You can disable the options by putting # at the beginning of the commands below.
#Make sure you don't disable or enable them both! (Hi-Fi or Baseband Audio)
#For Baseband Audio (Default pick, no further work required on audio!)
#Realistic: Equalization uses supereq. Normally use this:
#Compatibility: If the above create error, use this instead: (Not realistic)
#For Hi-Fi Audio (Not quite realistic for the Hi-Fi audio artifect...)
#Important! If the original audio is mono, use this instead:
#For External audio, in case you can do an 80s tape effect, which can be more realistic)
#Use this to extract the original audio [VirtualDub: File -> Save WAV...]
#== FINALIZING ==#
player=BLANKCLIP(length=60, color=$2222DD, fps=29.97, CHANNELS=1, audio_rate=48000).converttoyv12
#BLANKCLIP: Important! Set CHANNELS to 2 if you use Hi-fi audio or External Audio if it is in stereo. Else, set it to 1.
#Use this for Baseband or Hi-Fi Audio only.
#Use this if you use External Audio
finalsignal=overlay(grey, color, mode="add", opacity=1)
finalvideo=overlay(finalsignal, noise, mode="add", opacity=1).LEVELS(40,1,255,0,255).bilinearresize(6 40,480)
#== OUTPUT ==#
#If you don't want an OSD then disable these commands.
Subtitle("> PLAY",48,24,10,160,"Camcorder Monospaced",36,$DDDDDD)
Subtitle(" LP NTSC",48,60,70,161,"Camcorder Monospaced",36,$DDDDDD)
#SUBTITLE(" [HI-FI]",48,24,180,330,"Camcorder Monospaced",36,$DDDDDD)
#SUBTITLE in caps: Disable it if you use Baseband audio.
#== PREVIEWING ==#
#SELECTEVEN or SELECTEVERY: Enable if you want a smooth VirtualDub preview if it is freezing periodically. DISABLE before saving as AVI!
The line in the original effect VHS avs sample was this
This may take a while to debug
Is there are series of BMP files with filenames like:
in a folder called mask where the script is?
Well now I just got a different error: AVI Import Filter error: (Unknown) (80040154). I honestly don't know what to do .
With old software like that it's best to stick with 32 bit. But if you really want to use 64 bit AviSynth I recommend you use AviSynth+ instead of the older AviSynth.
From this Youtube video:
I got a link to
The AviSynth script in that link worked with both 32 bit and 64 bit AviSynth+ (and 32 bit and 64 bit VirtualDub2).
Last edited by jagabo; 1st Aug 2020 at 11:41.
When I try to download Avisynth plus, Windows says its a virus.. Is this true? Or should I just go ahead and download it anyway?
Edit: To be more specific, It says "Microsoft Defender Smartscreen prevented an unrecognized app from starting. Running this app might put your PC at risk."
Okay, I downloaded Avisynth + and restarted my computer. However when I dragged the EFFECT into VirtualDub2, I got another error:
Avisynth open failure: AVIFileSource: couldn't open file 'baseband artifect.wav'
(C:/Users/Owner/OneDrive/Desktop/New folder/EFFECT.avs, line 69.)
Is this a script problem? I"m not sure.
It's looking for the wav file that is included with the VHS effects package. A number
of other files should be there also:
Last edited by davexnet; 1st Aug 2020 at 14:53.
If you're using VDub to play the video, don't. It's not a good player. If there's audio in the script, play the script. If the video and audio are named the same (Movie.avi, Movie.wav, for example), play the video and the audio should also play. Maybe that depends on the player, not sure.
I assume you mean VDub as in Virtual Dub? And I think Avisynth is only compatible with Virtual Dub. I'm not sure if it's compatible with any other video player. The problem I'm having is that when I drag the effect script into virtual dub and play the video, the video won't make any noise except a high pitched noise. When I pause the video, Virtual Dub crashes.
[Attachment 54336 - Click to enlarge]
[Attachment 54337 - Click to enlarge]
The script as written expects the audio of the source file to be sampled at 48000. If it's not some changes to the script are necessary.
Here's a script that works, compare to yours. My version uses the Lsmash source filter, you can download it from here if you don't have it.
Last edited by davexnet; 2nd Aug 2020 at 12:09. Reason: forgot to upload the script
I haven't used MediaInfo at all before but yes, my source is named video.avi to keep it simple. I had also followed a tutorial on Youtube as well and it said to rename the script from Nyan_Cat_Sample.avi to video.avi.
Here are the pictures. Is this what you mean?
[Attachment 54343 - Click to enlarge]
[Attachment 54342 - Click to enlarge]
This script will not work as-is when the source audio is ADPCM audio.
Also the sampling rate should be 48000 otherwise you modify the script even more
I don have such a video to try myself. Can you post a clip ?
The problem I'm having is that when I drag the effect script into virtual dub and play the video, the video won't make any noise except a high pitched noise.
Ahhh nevermind I finally found a fix! I had to change the audio codec from adpcm to aac. Thanks for all the help/advice, though. I appreciate it. Sorry If I'm not that good at coding. I only took like one coding class last year (my freshman year high school).
Last edited by Pixl_talian; 2nd Aug 2020 at 15:33.
Yes, the script is designed for the XP days when most were more likely to have a VFW codec installed so Avisource will work.
Changing the source filter to directshowsource opens in Virtualdub but crashed when you attempted to play it.
Seems to be this line that uses supereq:
#Realistic: Equalization uses supereq. Normally use this: vidaudio=converttomono(originalaudio).amplify(0.3).supereq("vhs.feq") #Compatibility: If the above create error, use this instead: (Not realistic) #vidaudio=converttomono(originalaudio).resampleaudio(16000).amplify(0.7).resampleaudio(48000)
I found shibatch.dll in my plugins folder, I assume that's the relevant dll.
Not sure what is wrong with supereq
EDIT - I figured it out - you have to use ConvertAudioToFloat() on the audio before calling supereq().
Otherwise it sends a horrible screeching noise to the host program which eventually crashes
Last edited by davexnet; 2nd Aug 2020 at 17:15.