VideoHelp Forum
+ Reply to Thread
Results 1 to 30 of 30
Thread
  1. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Post the complete script here
    Quote Quote  
  3. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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!
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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
    Quote Quote  
  5. 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?
    Quote Quote  
  6. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    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?
    Hi jagabo -
    yes. The sample archive provided all the ancillary files in order for the example script to work
    Quote Quote  
  7. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    Well now I just got a different error: AVI Import Filter error: (Unknown) (80040154). I honestly don't know what to do .
    Quote Quote  
  8. That is the error message you get when AviSynth is not installed. Be sure you have the right bitness. If you're using a 32 bit editor/encoder you need 32 bit AviSynth and 32 bit filters. If you're using a 64 bit editor/encoder you need 64 bit AviSynth and 644 bit filters.
    Quote Quote  
  9. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by Pixl_talian View Post
    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
    Quote Quote  
  11. 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 12:41.
    Quote Quote  
  12. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    At least if you download and install Avisynth+, you have the 32 and 64 bit available, dependent on the bitness of the host app
    Quote Quote  
  13. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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."
    Quote Quote  
  14. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by Pixl_talian View Post
    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."
    Smartscreen is just a file reputation tool, Microsoft doesn't know about this file.
    It's fine.
    Quote Quote  
  15. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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.
    Quote Quote  
  16. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    It's looking for the wav file that is included with the VHS effects package. A number
    of other files should be there also:
    Image Attached Thumbnails Click image for larger version

Name:	effect.jpg
Views:	108
Size:	77.1 KB
ID:	54331  

    Last edited by davexnet; 1st Aug 2020 at 15:53.
    Quote Quote  
  17. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    It works. However Virtual Dub keeps crashing and it makes a weird noise when I play the video.
    Quote Quote  
  18. 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.
    Quote Quote  
  19. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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.



    Image
    [Attachment 54336 - Click to enlarge]
    Image
    [Attachment 54337 - Click to enlarge]
    Quote Quote  
  20. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Try dragging the .avs file to a player such as mpc-hc and see if it works.
    Quote Quote  
  21. What are the characteristics of your source video , in terms of dimensions, codec, colorspace ? You can check with mediainfo

    You can try another source filter, instead of DirectShowSource . If it's an AVI , try AVISource, or use FFVideoSource (ffms2 plugin)
    Quote Quote  
  22. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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/
    Image Attached Files
    Last edited by davexnet; 2nd Aug 2020 at 13:09. Reason: forgot to upload the script
    Quote Quote  
  23. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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.


    Image
    [Attachment 54341 - Click to enlarge]
    Image
    [Attachment 54340 - Click to enlarge]
    Quote Quote  
  24. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    The lines beginning with # are just comments.
    The other stuff in that area are some changes I made to get it to work.
    Post the mediainfo (text view) report of your source video here in the thread

    Is your source actually named "video.avi" ?
    Quote Quote  
  25. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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?




    Image
    [Attachment 54343 - Click to enlarge]
    Image
    [Attachment 54342 - Click to enlarge]
    Quote Quote  
  26. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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 ?
    Quote Quote  
  27. Originally Posted by Pixl_talian View Post
    I assume you mean VDub as in Virtual Dub?
    Of course. You'll notice the links both go to the same place.
    Originally Posted by Pixl_talian View Post
    And I think Avisynth is only compatible with Virtual Dub.
    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.
    I already suggested not using VDub to play your video. But that's the least of your problems. The audio and video codecs are what's screwing you up. I'd suggest dumping everything in your bloated script except the source filter and just try to open the video alone to begin with. I don't think AviSource will work but one of the others suggested should.
    Quote Quote  
  28. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    What do you mean by dumping everything? And what is a source filter? And I tried to use MPC-HC to play my video instead of VDub with the effect but it crashed as well when I dragged the effect in. It played the video by itself just fine.
    Quote Quote  
  29. Member
    Join Date
    Jul 2020
    Location
    United States
    Search Comp PM
    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 16:33.
    Quote Quote  
  30. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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)
    When you comment it out and enable the compatible workaround it works fine.
    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 18:15.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!