VideoHelp Forum
+ Reply to Thread
Page 1 of 4
1 2 3 ... LastLast
Results 1 to 30 of 98
Thread
  1. I'm a novice or newb using avisynth with any program.

    I have added plugins to avisynth as other errors appeared.
    Those seem to be fixed now.

    I may install avisynth+ but I wanted to get avisynth working if I can.

    I tried to keep the code simple.
    These are the errors:
    Image
    [Attachment 81580 - Click to enlarge]


    Image
    [Attachment 81581 - Click to enlarge]
    Quote Quote  
  2. Filters are automatically applied one after the other using a variable called Last, unless you assign a clip to a variable yourself, which you've done. TemporalDegrain2 is complaining because it expects to see a clip, but it's not getting one.

    Code:
    V = ffms2("source")
    A = LWLibavAudioSource("source")
    V.TemporalDegrain2(degrainTR=0) # or TemporalDegrain2(V, degrainTR=0)
    or

    Code:
    ffms2("source")
    A = LWLibavAudioSource("source")
    TemporalDegrain2(degrainTR=0)
    For the second example the video is assigned to the variable Last.
    The audio is assigned to the variable "A" so it doesn't change the value of Last.
    Last is automatically used as the input for TemporalDegrain2() like this.

    Code:
    ffms2("source")
    A = LWLibavAudioSource("source")
    TemporalDegrain2(clip=Last, degrainTR=0)
    You can also assign Last to a variable.

    Code:
    ffms2("source")
    A = LWLibavAudioSource("source")
    
    X = Last
    FilterA()
    Y = last
    FilterB()
    FilterC()
    
    return X   # would return the source video, unfiltered
    return Y   # would return the output of FilterA
    For the second error:

    Code:
    V = ffms2("source")
    A = LWLibavAudioSource("source")
    AudioDub(V, A)
    I'm not sure that zero would be a valid value for TemporalDegrain2's degrainTR argument but I could be wrong.

    Dump Avisynth and install Avisynth+. There's no point starting out with an obsolete version.
    And when you do, don't forget to add Prefetch(x) to the end of your script otherwise Avisynth+ will run in single threaded mode (where "x" is an integer specifying the number of threads). TemporalDegrain2 is quite slow, and in single threaded mode it might be slow enough to be impractical.
    http://avisynth.nl/index.php/SetFilterMTMode#Prefetch
    Last edited by hello_hello; 19th Aug 2024 at 11:14.
    Quote Quote  
  3. Originally Posted by hello_hello View Post
    I'm not sure that zero would be a valid value for TemporalDegrain2's degrainTR argument but I could be wrong.
    I was trying what I believe would be the simplest setting first.

    http://avisynth.nl/index.php/TemporalDegrain2
    Suggested settings for removing the grain, sorted by increasing source grain
    degrainTR=0,postFFT=0 (aka Undot)
    degrainTR=0,postFFT=1,postSigma=value between 0 and 1
    degrainTR=1,grainLevel=-1,postFFT=0
    degrainTR=1,grainLevel=0,postFFT=0
    degrainTR=1,grainLevel=0,postFFT=1,postSigma=value between 0 and 1
    degrainTR=1,grainLevel=1,postFFT=0
    degrainTR=1,grainLevel=1,postFFT=1,postSigma=value between 0 and 2
    degrainTR=1,grainLevel=2,postFFT=0
    degrainTR=1,grainLevel=2,postFFT=1,postSigma=value between 0 and 2
    degrainTR=2,grainLevel=2,postFFT=1,postSigma=value between 0 and 2
    degrainTR=2,grainLevel=3,postFFT=1,postSigma=value between 0 and 2

    Any degrainTR above 0 not work for very fast-paced films with many particles flying around (explosions, rain). In this case only this setting will work:
    degrainTR=0,postFFT=1,postSigma=value between 0 and 4

    Originally Posted by hello_hello View Post
    Dump Avisynth and install Avisynth+. There's no point starting out with an obsolete version.
    This is what I plan to do but I want to try the settings you suggest first.
    As I will probably use avisynth on one computer & avisynth+ on another computer.

    Both these computers are 32-bit OS's.
    Quote Quote  
  4. There's really no point using Avisynth. Some newer functions will only work with Avisynth Plus, but it's quite backwards compatible. If a plugin or function works with Avisynth it's bound to work with Avisynth+. And the original Avisynth isn't multi-threaded, which could be why you're having trouble with TemporalDegrain2.
    Quote Quote  
  5. Now I think about it, TemporalDegrain2 won't work with Avisynth. It'll result in an "unexpected character" error, probably complaining about finding a square bracket in the script. The wiki is out of date.

    http://forum.doom9.net/showthread.php?t=175798
    Dec 21, 2021: v2.4.0 (This and later releases need AviSynth 3.7.1+)
    Quote Quote  
  6. I get "unrecognized exception" but it means close to the same to me as "unexpected character".
    I believe you are correct about TemporalDegrain2 not working with avisynth.
    All codes I tested resulted with an error.

    The second example now works with "audio" instead of "video".
    I copied & pasted this & got the wrong one.

    It will take me a bit to install avisynth+.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by cholla View Post

    It will take me a bit to install avisynth+.
    Avisynth plus can be installed over the old version. It will detect it and offer to back it up.
    Then if you uninstall the plus version later, it will put it back as it was.
    Works well
    Quote Quote  
  8. Originally Posted by cholla View Post
    I get "unrecognized exception" but it means close to the same to me as "unexpected character".
    I believe you are correct about TemporalDegrain2 not working with avisynth.
    All codes I tested resulted with an error.

    The second example now works with "audio" instead of "video".
    I copied & pasted this & got the wrong one.

    It will take me a bit to install avisynth+.
    Earlier versions of Avisynth Plus that don't support square brackets in scripts will produce an "unexpected character" error message or something to that effect. At least that's my experience. The original Avisynth might produce a different error message for the same problem. I don't actually know though, so it could be due something else. If the plugins you're using are the latest versions, maybe one of them doesn't play nice with the original Avisynth anymore.

    Installing Avisynth+ should be easy as there's two installers. One includes the runtime files Avisynth requires while the other does not. The exe with vcredist in the file name is the one with the runtime files included.
    https://github.com/AviSynth/AviSynthPlus/releases
    Quote Quote  
  9. I forgot to mention that ffms2 can open both audio and video, but the audio is disabled by default. A value of -1 means the first audio stream in the file is decoded.

    ffms2("source" atrack=-1)
    or
    FFmpegSource2("source", atrack=-1)

    Attached are a couple of functions you can also use. FFMS3 is called FFMS3 so it'll co-exist with FFMS2.
    LibavSource2 does the same thing for lsmash (combining LWLibavVideoSource & LWLibavAudioSource).

    Both functions have the audio enabled by default, and they both have a vtrack argument, allowing you to disable the video and decode only the audio.
    vtrack=-2 disables the video and atrack=-2 disables the audio. Obviously you should only disable one of them at a time.
    Image Attached Files
    Quote Quote  
  10. Originally Posted by davexnet View Post
    Originally Posted by cholla View Post
    It will take me a bit to install avisynth+.
    Avisynth plus can be installed over the old version. It will detect it and offer to back it up.
    Then if you uninstall the plus version later, it will put it back as it was.
    Works well
    That part works & I knew about it from installing Avisynth plus before.
    I never got Avisynth plus to work then,
    What I meant by "It will take me a bit to install avisynth+" is what I've been doing today adding plugins until it works.
    Seems to be working now.

    @ hello_hello,
    I had the version that did not include the runtime files but it was working so maybe I had the runtime files installed.
    I went ahead & uninstalled that version & installed the version with the runtime files.
    I wish I had known before I installed the version without.
    I DLed & placed the two .avsi files in the plugins folder.
    avisynth + seems to be working now.
    The avs script I tested with is fairly simple but it does work without errors usingVDub2.

    What code did you use in this post #15 for the TemporalDeGrain2 ?
    Or the complete avs script used.
    Horse TemporalDeGrain2 (Avisynth).mkv (26.41 MB, 8 views)
    https://forum.videohelp.com/threads/415579-Converting-old-MPEG2-videos-to-HEVC-how-muc...ve#post2747075
    Last edited by cholla; 19th Aug 2024 at 15:57.
    Quote Quote  
  11. If I set "TemporalDegrain2(degrainTR=x) to any setting except ) 0 I get this error:
    Image
    [Attachment 81677 - Click to enlarge]


    I added the "neo-fft3d.dll" that is related to it.
    Before that I was getting an error that avisynth needed it.
    "fftwf_malloc" is a part of "neo-fft3d.dll" as far as I can tell & not available seperately.
    Quote Quote  
  12. FFTW 3.3.5 is a Fourier transform library required by neo-fft3d, fft3d and possibly a couple of other plugins. It's shown as a dependency on the wiki.
    http://avisynth.nl/index.php/Neo_FFT3D
    http://www.fftw.org/download.html

    It was once the case that some plugins required the dll to be named libfftw3f-3.dll and some required it to be named fftw3.dll. I don't know if that's still the case but it can't hurt to put it in the Windows/System32 folder with both names so you're covered. To make it easy there's a zip file attached with the two 32 bit dlls included.

    I deleted the script I used for the Horse sample but I'm fairly sure it was this.
    The source file is an MKV rather than the original m2ts as I remuxed it with MKVToolNixGUI to make it easier to extract the audio and convert to AAC.

    Code:
    FFVideoSource("D:\Horse.mkv", cachefile="D:\Horse.ffindex")
    CropResize(1920,1080, 60,0,-60,-0, Resizer="Resize8")
    TemporalDeGrain2(degrainTR=2, grainLevel=2)
    Prefetch(8)
    CropResize is in my signature. It'll apply the specified cropping of 60 pixels each side to remove the black, then it'll crop the top and bottom (in this case) to ensure the video can be resized to 1920x1080 without distorting it. If you don't want that, use standard cropping and resizing.

    If I was encoding the whole video though, I'd probably do this so it's denoised after the black is cropped (because there's no point denoising that), and before it's resized (as the resizing will upscale).

    Code:
    FFVideoSource("D:\Horse.mkv", cachefile="D:\Horse.ffindex")
    Crop(60,0,-60,-0)
    TemporalDeGrain2(degrainTR=2, grainLevel=2)
    CropResize(1920,1080, Resizer="Resize8") # you can remove Resizer="Resize8" and it'll resize with Spline36Resize
    GradFun3()   # from the DitherTools plugin
    Prefetch(8)
    To stretch it:

    Code:
    FFVideoSource("D:\Horse.mkv", cachefile="D:\Horse.ffindex")
    Crop(60,0,-60,-0)
    TemporalDeGrain2(degrainTR=2, grainLevel=2)
    Spline36Resize(1920,1080)
    GradFun3()
    Prefetch(8)
    Even though stretching is evil and the main idea behind CropResize is to prevent it, with CropResize you can control how much the video is cropped and/or stretched by fudging the input display aspect ratio.

    Crop(60,0,-60,-0)
    CropResize(1920,1080) or CropResize(1920,1080, InDAR=5.0/3.0)
    Would result in maximum cropping and therefore no stretching when it's resized to 1920x1080 (the aspect ratio after cropping the black is 5:3 or 1.66667 and it'll be cropped to 16:9 before it's resized).

    Crop(60,0,-60,-0)
    CropResize(1920,1080, InDAR=16.0/9.0)
    Would cause CropResize to assume the 1800x1080 video remaining after cropping is supposed to display as 16:9, so it'll stretch it to 1920x1080 without applying any additional cropping.

    Any InDAR between 1.66667 and 1.77778 will give you some sort of compromise between how much the video is cropped and therefore how much it's stretched. You can use one of the cropping previews to preview the cropping (the video isn't resized while the cropping preview is enabled).

    No Stretching.
    Crop(60,0,-60,-0)
    CropResize(1920,1080, CPreview=2)

    Image
    [Attachment 81716 - Click to enlarge]


    Medium stretching.
    Crop(60,0,-60,-0)
    CropResize(1920,1080, InDAR=1.72222, CPreview=2)

    Image
    [Attachment 81717 - Click to enlarge]


    Maximum stretching.
    Crop(60,0,-60,-0)
    CropResize(1920,1080, InDAR=16.0/9.0, CPreview=2)

    Image
    [Attachment 81718 - Click to enlarge]


    All of the above of course uses standard resizing rather than warped resizing.
    The CropResize version my signature links to will display slightly different text for the preview. I fiddled with it a bit for the version I used above but it's is not quite ready to upload yet.
    Image Attached Files
    Last edited by hello_hello; 22nd Aug 2024 at 11:32.
    Quote Quote  
  13. @ hello_hello,
    I used the .mts file. first.
    Then I created a .mkv file as you did.
    At least maybe the same way.
    I demuxed the .mts file with MKVToolNixGUI to .mkv & .m4a files.
    Then with ffmpeg converted the .m4a file from DTS to acc.
    Then muxed the back together with MKVToolNixGUI.
    At first I'm trying to keep the script even simpler.
    I do not have a "cachefile="D:\Horse.ffindex")"
    or a Horse.ffindex file. How do I create one ?
    I could not use that in the script.
    This is the simpler script I used:
    Code:
    FFVideosource("Horse.mkv")
    TemporalDegrain2(degrainTR=2, grainLevel=2)
    Prefetch(2)
    If I can get it working with this script then I will try the more complex scripts.

    I did the same using the .mts file instead.
    Both the same results:
    Avisynth open failure:
    neo fft3d: Library function is missing: fftwf malloc
    Quote Quote  
  14. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Make sure you have FFTW 3.3.5 installed properly.
    The 64 version of fftw3.dll should be copied into \Windows\System32\
    and the 32 bit version of fftw3.dll should be copied into \Windows\Syswow64\
    Quote Quote  
  15. @ davexnet,
    I already followed those instructions after I found out about the "bassakards" way to do it.
    There is no \Windows\Syswow64\ on Windows 7 32-bit.
    hello_hello posted the fftw3.dll & Alwyn also link me to some.
    They turned out to be the same files.
    Quote Quote  
  16. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by cholla View Post
    @ davexnet,
    I already followed those instructions after I found out about the "bassakards" way to do it.
    There is no \Windows\Syswow64\ on Windows 7 32-bit.
    hello_hello posted the fftw3.dll & Alwyn also link me to some.
    They turned out to be the same files.
    Good point. I forgot you were running a 32 bit OS.
    Have you tried running the AVSInfoTool? It may help to identify any errors in your Avisynth installation.
    Quote Quote  
  17. Yes I have the AVSInfoTool.
    On my Lenovo the one I have a fresh install of avisynth & avisynth plus it shows no errors & lists the plugins.
    On my Dell it doesn't work & shows "No information".
    Both are installed & show in Programs & Features.
    Also show in CCleaner, & two other uninstallers I have.

    Here is an odd fact Windows 7 32-bit does have a registry key named :"WOW6432Node"
    Quote Quote  
  18. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    There is no need to mess with Windows system folders.
    As we said several times, load that specific DLLs with the LoadDLL plugin:

    Code:
    	# FFTW
    loadPlugin(<path>\LoadDll.dll")
    loadDll(<path>\libfftw3f-3.dll")
    BTW, in general is always better to individually load all the required filters rather than randomnly put them in the plugins folder. But 99% of the people do the second.
    Quote Quote  
  19. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    BTW, in general is always better to individually load all the required filters rather than randomnly put them in the plugins folder. But 99% of the people do the second.
    Why, exactly, is it "better"? "Randomly"? How do you "randomly" put a file in a particular plugins folder?

    As for putting in the paths to every dependency I need for a particular video (if I can remember them), no thanks. I'm quite happy to chuck all the plugins in the plugins folder and actually get on with doing what I want, which is to open a video and work on it, not waste time copying and pasting paths to plugin files.
    Quote Quote  
  20. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by Alwyn View Post
    Why, exactly, is it "better"? "Randomly"? How do you "randomly" put a file in a particular plugins folder?
    Because you have full control of what is loaded, including the dependancies of the filters. They are all update indipendently each other, and sometimes incompatibilities appear. Probably your usage of AviSynth is minimalist, so not relevant here.

    Originally Posted by Alwyn View Post
    As for putting in the paths to every dependency I need for a particular video (if I can remember them), no thanks. I'm quite happy to chuck all the plugins in the plugins folder and actually get on with doing what I want, which is to open a video and work on it, not waste time copying and pasting paths to plugin files.
    Do whatever you want, nobody cares. You were not even able to run a simple QTGMC or Inverse Telecine for years, so definitevley not a reference. BTW, you can avoid pasting paths by defining a global variable, but that's probably out of your knowledge.
    Quote Quote  
  21. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Nice fella, that Lollo.
    Quote Quote  
  22. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Originally Posted by Lollo
    LoadDLL plugin
    Can't find it on the net anywhere. Would you be so kind as to attach it here.
    Quote Quote  
  23. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by Alwyn View Post
    Originally Posted by Lollo
    LoadDLL plugin
    Can't find it on the net anywhere. Would you be so kind as to attach it here.
    Sure!

    LoadDll.zip

    BTW I see that Selur already gave you some indication: https://forum.videohelp.com/threads/415671-Easier-AVISynth#post2747721
    Quote Quote  
  24. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thank you.
    I see that Selur already gave you some indication:
    Nothing of relevance there regarding where this DLL actually is on the net...
    Quote Quote  
  25. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    To save me 1/2 an hour of experimentation, is loaddll bitness agnostic? It works for both 32 and 64 bit?
    Quote Quote  
  26. Originally Posted by lollo View Post
    but that's probably out of your knowledge.
    It is certainly beyond my knowledge.
    So is using the LoadDLL plugin.
    Even with the script:
    Code:
    	# FFTW
    loadPlugin(<path>\LoadDll.dll")
    loadDll(<path>\libfftw3f-3.dll")
    I believe the problem is with the TemporalDegrain2.avsi and/or the neo-fft3d.dll.
    Avisynth open failure:
    neo fft3d: Library function is missing: fftwf malloc
    Unless you believe the libfftw3f-3.dll is the cause of the Avisynth open failure .
    Why does
    Code:
    TemporalDegrain2(degrainTR=0)
    load in VDub2
    but
    Code:
    TemporalDegrain2(degrainTR=1)
    Or any number above 0. I believe the settings for TemporalDegrain2(degrainTR= are -1through 6 .
    Creates the error.
    Searching yeilds very little information on " fftwf malloc".
    Quote Quote  
  27. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Why does
    Code:
    TemporalDegrain2(degrainTR=0)
    load in VDub2
    but
    Code:
    TemporalDegrain2(degrainTR=1)
    Or any number above 0. I believe the settings for TemporalDegrain2(degrainTR= are -1through 6 .
    Creates the error.

    If you look to TD2 code, you will see that neo_fft3d is called only when degrainTR>0:

    Code:
      dgLimit = (degrainTR>0 && firstStepD && limitFFT==1) ? dgO.neo_fft3d(y=LumaD?3:2, u=ChromaD?3:2, v=ChromaD?3:2, sigma=limitSigma, sigma2=dgS2, sigma3=dgS3, sigma4=dgS4, bt=3, bw=limitBlksz, bh=limitBlksz, ow=dgOv, oh=dgOv, ncpu=fftThreads ) : \
    ...
    I ignore your installation and set-up, and why it fails. What may help is that you do not automatically load all the plugins but one by one starting from the primary.
    This is my set-up, AviSynth 2.60 32-bit, just as example (YMMV):

    Code:
    # plugins directory
    plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"
    
    	# TemporalDegrain2
    Import(plugins_dir + "TemporalDegrain-v2.2.1.avsi")
    	# RgTools
    loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
    	# MaskTools2
    loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")
    	# MVTools
    loadPlugin(plugins_dir + "mvtools-2.7.41-with-depans20200430\x86\mvtools2.dll")
    	# FFT3DFilter
    loadPlugin(plugins_dir + "FFT3dFilter-v2.6\x86\fft3dfilter.dll")
    	# FFTW
    loadPlugin(plugins_dir + "LoadDll\LoadDll.dll")
    loadDll(plugins_dir + "fftw-3.3.5-dll32\libfftw3f-3.dll")
    Start just adding the TD2 line. It will complain about RegTools missing. Add RegTools. It will complain about MaskTools2 missing. Add MaskTools2. And so on.

    edit: If you are not able to solve, just let me know. I can send you a basic set-up to start with, and then you can upgrade as wished

    edit2: example attached. Install AviSynt 2.60, unzip the cholla.zip dir and load the file example.avs in VirtualDub, after replacing my source file with yours. It should work. From there, you can upgrade the plugins, the filters and AviSynth.

    cholla.zip
    Last edited by lollo; 23rd Aug 2024 at 13:31.
    Quote Quote  
  28. Thanks lollo,
    I will give this a try.
    To make it clear I installed AviSynthPlus_3.7.3_20230715_vcredist.exe
    I chose the setup option to keep avisynth.
    My version is 2.60 32-bit.
    Quote Quote  
  29. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    To save me 1/2 an hour of experimentation, is loaddll bitness agnostic? It works for both 32 and 64 bit?
    I did spend an hour. And I think I have an answer my own question. It appears that Loaddll doesn't work in 64bit VDub. I put the loaddll provided by Lollo into the plugins64 folder (as well as , and got a 32bit warning on any script I tried to open in 64bit:

    Image
    [Attachment 81765 - Click to enlarge]


    I didn't try the linking, because I assume it will still be loading Loaddll and the same error would therefore occur.

    Can someone (@Lollo, @Selur?) please verify then that Loaddll does not work in 64bit.
    Quote Quote  
  30. If you're running 32 bit AviSynth loaddll() will only open 32 bit dll files. If you're running 64 bit AviSynth loaddll() will only load 64 bit dll files.

    If you are opening an AviSynth script with 64 bit VirtualDub you are using 64 bit AviSynth and can only load 64 bit dlls.
    Quote Quote  



Similar Threads

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