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
-
-
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.
SOURCEVIDEO=DirectShowSource("video.avi").bilinear resize(392,480).resampleaudio(48000)
loss=("mask\hsync_%03d.bmp",end=127).assumefps(299 7,100).loop(1000)
#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)
original=converttorgb32(sourcevideo).LEVELS(0,1,25 5,4,200).ADDBORDERS(4,0,4,0).changefps(2997,100)
originalaudio=killvideo(sourcevideo)
#== GREYSCALE ==#
grey1=greyscale(original).bilinearresize(288,480). blur(-1,1).bicubicresize(400,480)
grey2=pointresize(grey1,800,480).crop(0,0,799,480) .addborders(1,0,0,0).bilinearresize(400,480)
hsyncloss1=mergeARGB(showgreen(loss),showblue(loss ),showblue(loss),showblue(loss)).pointresize(400,4 80)
hsyncloss2=invert(hsyncloss1,"A")
greysync1=layer(grey1,hsyncloss1)
greysync2=layer(grey2,hsyncloss2)
grey=overlay(greysync1,greysync2,mode="add",opacit y=1).converttoyv12
#== COLOR ==#
#ADDBORDERS: How off-set is the chroma channel from luma (X,Y,0,0) X=Horizontally, Y=Vertically (Both Even Number)
colorinputu=original.bilinearresize(100,480).blur( 1,0).bilinearresize(400,480).ADDBORDERS(4,2,0,0)
#For NTSC color (Hue Tinting)
colorinputv=converttoyv12(colorinputu).coloryuv(co nt_v=-160).converttorgb32
#For PAL color (No Tinting, removes blue tint)
#colorinputv=colorinputu
colorlossu=mergeARGB(showred(loss),showblue(loss), showblue(loss),showblue(loss)).pointresize(400,480 )
colorlossv=trim(colorlossu,32,0)
coloru=layer(colorinputu,colorlossu).converttoyv12
colorv=layer(colorinputv,colorlossv).converttoyv12
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!)
audnoise=wavsource("baseband artifect.wav").resampleaudio(48000).loop(600)
#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).resampleaud io(16000).amplify(0.7).resampleaudio(48000)
#For Hi-Fi Audio (Not quite realistic for the Hi-Fi audio artifect...)
#audnoise=wavsource("hifi artifect.wav").loop(600)
#vidaudio=originalaudio
#Important! If the original audio is mono, use this instead:
#vidaudio=originalaudio
#For External audio, in case you can do an 80s tape effect, which can be more realistic)
#vidaudio=wavsource("[EXTERNAL AUDIO].wav").resampleaudio(48000)
#Use this to extract the original audio [VirtualDub: File -> Save WAV...]
#RETURN original
#== 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.
finalaudio=mixaudio(vidaudio,audnoise,0.96,0.04)
#Use this if you use External Audio
#finalaudio=vidaudio
noise=avisource("noise-preprocess.avi").bilinearresize(400,480).loop(300)
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)
final=audiodub(finalvideo,finalaudio)
#== OUTPUT ==#
player+final
#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 ==#
#SELECTEVERY(3 ,0,2)
#SELECTEVERY(3,0)
#SELECTEVEN
#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
loss=imagesource("mask\hsync_%03d.bmp",end=127).as sumefps(2997,100).loop(1000)
This may take a while to debug -
Is there are series of BMP files with filenames like:
hsync_000.bmp
hsync_001.bmp
...
hsync_127.bmp
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
.
-
I'm using Virtual Dub 64 bit. Does that mean I need to use Avisynth 64 bit as well? And I can't find anywhere to download Avisynth 64 bit that doesn't lead me to a virus.
-
Look at the software section of this site.
https://www.videohelp.com/download/AviSynthPlus_3.6.1_20200619_vcredist.exe -
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:
https://www.youtube.com/watch?v=ny1nVXibozs
I got a link to
https://mega.nz/file/6MdHFIaa#gKtnvxoyCKpZXNxZve1TmCtd__gwNzZDL0-6WrWjt5k
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.
-
It works. However Virtual Dub keeps crashing and it makes a weird noise when I play the video.
-
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.
https://github.com/HolyWu/L-SMASH-Works/releases/Last edited by davexnet; 2nd Aug 2020 at 12:09. Reason: forgot to upload the script
-
Okay, I might've found the problem. But I'm not exactly sure. I think its because I'm missing whats circled in blue?
The bottom image is my script below the top one.
[Attachment 54341 - Click to enlarge]
[Attachment 54340 - Click to enlarge] -
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 ? -
Of course. You'll notice the links both go to the same place.
You think wrong.
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:
Code:#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 crashesLast edited by davexnet; 2nd Aug 2020 at 17:15.
Similar Threads
-
Can't open an AviSynth script in VirtualDub2
By Bruce Banner in forum EditingReplies: 4Last Post: 7th Jul 2019, 19:43 -
AviSynth script error on meGUI
By vancew90 in forum EditingReplies: 16Last Post: 16th Jan 2019, 06:42 -
AVS script compression failure in VirtualDub2 / Lagarith RGB
By abolibibelot in forum Video ConversionReplies: 19Last Post: 20th Dec 2018, 02:07 -
avisynth open failure:FFVideoSource: Video codec not found using vafe
By NightBreaker in forum Video ConversionReplies: 1Last Post: 7th May 2018, 08:26 -
Avisynth open failure:AVIS...couldn't locate a decompressor for fourcc HFYU
By CZbwoi in forum RestorationReplies: 18Last Post: 17th Apr 2016, 16:33