digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Avisynth plugin VirtualDub error message? (https://www.digitalfaq.com/forum/video-restore/12856-avisynth-plugin-virtualdub.html)

DG1965 07-16-2022 10:35 AM

Thanks Lollo2. I'm really relieved that the script is now working. I was beginning to think I would never find out what I was doing wrong.
I never mentioned to you that my os was windows 7. At the time I didn't think it was relevant. I'm sure if I had you would have figured it out.
I will go and try your steps. I will read about ffmpeg, I don't know that much about, yet!

DG1965 07-16-2022 11:23 AM

I've done the three steps what is the next steps? Do I save it or do I somehow run it. Thanks.

lollo2 07-16-2022 12:18 PM

VirtualDub -> File -> Save as AVI...

this will create a new file with the restored video. Be careful that the size of the created file will be at least as the original file (the double if you deinterlace). Just for test you can use the trim commands in VirtualDub to save only a portion: https://www.weethet.nl/english/video_cutavis.php

At some point in time you may want to compare the original video and restored. You can do it inside your avs script http://www.digitalfaq.com/forum/vide...html#post85085 using the following; return command is disabled and replaced with stackhorizontal command:
Code:

#return(video_restored)

stackhorizontal(\
subtitle(video_org.SelectEvery(1,0,0),"video_org",size=20,align=2),\
subtitle(video_restored,"video_restored",size=20,align=2)\
)

or with interleave command
Code:

#return(video_restored)

interleave(\
subtitle(video_org.SelectEvery(1,0,0),"video_org",size=20,align=2),\
subtitle(video_restored,"video_restored",size=20,align=2)\
)

If the script with the comparison is to heavy to run, you have to create the output file (or a portion of it, and then you can compare a trimmed version of the input with the generated segment). Let me know if you need indications for that.

DG1965 07-16-2022 12:39 PM

Thanks lollo2 for the detailed steps. I will give it a go.

DG1965 07-17-2022 06:38 AM

1 Attachment(s)
Just in the process of the virtualdub save as AVI . I see what you mean lollo2 regarding the new projected file size being twice the size 163mb compared to the original 89mb. The estimated time for I assume completion is 2 hours 50 mins and counting. Is this normal for a 10 second clip?

DG1965 07-17-2022 07:03 AM

2 Attachment(s)
Also noticed this on the log I'm not sure if relevent.

DG1965 07-17-2022 07:23 AM

1 Attachment(s)
I aborted the save avi dub virtualdub 1.9.11 after approx. 1 hour and switched to virtualdub 1.10.4 instead this is the new log info. thanks.

lollo2 07-17-2022 11:43 AM

Quote:

The estimated time for I assume completion is 2 hours 50 mins and counting. Is this normal for a 10 second clip?
Your script is heavy. To accelerate, you can split the operations in 3 different scripts: the first to deinterlace, the second to denoise, the third to sharpen. But each time you have to save the output of each script with VirtualDub, which will be loaded in the next script.

first script:
Code:

video_org=AviSource("family holiday 2004 3.avi")

# cropping
        crop_left=10
        crop_top=8
        crop_right=16
        crop_bottom=10
video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)

# plugins directory
plugins_dir="<AviSynth plugin directory>"

        # QTGMC
Import(plugins_dir + "QTGMC.avsi")
        # Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")
        # Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

        # TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.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")

        # LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

### de-interlacing
deinterlaced=video_org_crop.AssumeTFF().QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)

### convert to YV16
deinterlaced_yv16=deinterlaced.convertToYV16()

return(deinterlaced_yv16)

second script:
Code:

deinterlaced_yv16=AviSource("<the name of the saved video from first script>.avi")

# cropping
        crop_left=10
        crop_top=8
        crop_right=16
        crop_bottom=10
video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)

# plugins directory
plugins_dir="<AviSynth plugin directory>"

        # QTGMC
Import(plugins_dir + "QTGMC.avsi")
        # Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")
        # Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

        # TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.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")

        # LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

### denoising
denoised_yv16=deinterlaced_yv16.TemporalDegrain2(degrainTR=3)

### convert to YUY2
denoised=denoised_yv16.convertToYUY2()

### convert to YV12
denoised_yv12=denoised.convertToYV12()

return(denoised_yv12)

third script:
Code:

denoised_yv12=AviSource("<the name of the saved video from second script>.avi")

# cropping
        crop_left=10
        crop_top=8
        crop_right=16
        crop_bottom=10
video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)

# plugins directory
plugins_dir="<AviSynth plugin directory>"

        # QTGMC
Import(plugins_dir + "QTGMC.avsi")
        # Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")
        # Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

        # TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.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")

        # LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

### sharpening
sharpened_yv12=denoised_yv12.LSFmod(defaults="slow")

### convert to YUY2 with chroma from YUY2 color space
sharpened=sharpened_yv12.convertToYUY2().MergeChroma(denoised)

### add borders
video_restored=sharpened.addborders((crop_left+crop_right)/2-1,(crop_top+crop_bottom)/2,(crop_left+crop_right)/2+1,(crop_top+crop_bottom)/2)

return(video_restored)

As alternative you could use multithreading, but I am not familiar with it.

DG1965 07-17-2022 12:47 PM

Thanks lollo2 you are fantastic. I'm a scripting disaster. I had to abort both attempts as the estimated times were going above 5 hours for a 10 second clip. I knew I must be doing something wrong. What would be the expected avi save/dub timescale for a 10 second clip? I thought maybe a couple of minutes probably naively.

lollo2 07-17-2022 01:12 PM

I don't know, it depends on many factors. Just try and be prepared to a long wait :wink2:

lordsmurf 07-17-2022 02:53 PM

Deinterlace is very fast in the x64, which is a main reason I process in multi steps. 64 first, 32 next.

The scripts are very heavy, lots of operations. But sometimes that's what it takes, to get results you want. Multipass is the key.

I look forward to seeing your before/after. ;)

I've not had much time to follow this thread closely, and I'm glad lollo2 is helping you out. He and I sometimes disagree on workflow hardware, but his Avisynth work is usually quite good. I don't think he'll steer you wrong.

Just wanted to inject some words of encouragement for you. This seems to be progressing nicely. :)

DG1965 07-17-2022 03:27 PM

Thanks Lordsmurf. Lollo2 has been amazing and very, very patient! Thank you for the encouragement. I'm sure everyone has been in the same place as me, you spend all weekend and evenings trying to make it work and for weeks nothing goes right. I finally got a script to load, that in itself has given me a really major boost. I definitely couldn't have got this far without everyone's help.

My Dell M6800 is 64x but I'm probably not competent enough yet to change things about, as everything is set up for 32bit.

DG1965 07-23-2022 06:09 AM

2 Attachment(s)
I was able to upload the first script into virtualdub and saved it as "part1complete.avi" but I've got this error message on the attached script for part2? Thanks.

Code:

deinterlaced_yv16=AviSource("C:\Users\Dell\Desktop\part1complete.avi")

# cropping
    crop_left=10
    crop_top=8
    crop_right=16
    crop_bottom=10
video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)

# plugins directory
plugins_dir="<AviSynth plugin directory>"

    # QTGMC
Import(plugins_dir + "QTGMC.avsi")
    # Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")
    # Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

    # TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.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")

    # LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

### denoising
denoised_yv16=deinterlaced_yv16.TemporalDegrain2(degrainTR=3)

### convert to YUY2
denoised=denoised_yv16.convertToYUY2()

### convert to YV12
denoised_yv12=denoised.convertToYV12()

return(denoised_yv12)


lordsmurf 07-23-2022 06:21 AM

I hate this style of scripting. It's backwards, hard to understand, and needlessly complex.
I can't help you much here.

This is line 8
Code:

video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)
It's some sort of variable. For what, I don't know. Cropping, I assume.

The usual problem is you're trying to access a variable without first declaring it.

DG1965 07-23-2022 06:39 AM

Thanks Lordsmurf. I thought that I could just copy the script into notepad and it would load. With a bit of fiddling I got the first script going but everything I've tried with part2 ends this way. Is scripting always this temperamental ? Thanks

lordsmurf 07-23-2022 06:45 AM

It's hard to undo variable style scripts, it's messy and complex. You have to redeclare variables.

I also don't like to manually import everything, and so you have to do that again, or else it defaults to the default (which is what I use).

selur agrees with me, as did sanlyn.
johnmeyer is one of the few folks I know that likes the backwards scripting.

I say "backwards" because you sort of back into the operations after outlining and declaring everything. As opposed to using scripting without load and declare. For some complex operations, it's needed. For others, like cropping, it's just needless.

It is preference. But I can't stand it.

DG1965 07-23-2022 08:38 AM

1 Attachment(s)
Thank you Lordsmurf. When I read your answer I realise how little I know. I'm not sure if I'm making a simple task complicated or scripting is really complex. I've seen a lot of scripts similar to the attached script, which are constructed in a different way. I didn't know how virtualdub would know how to find the plugins without a path. Is this one of the way you script? Sorry if I sound ignorant. Thanks.

lordsmurf 07-23-2022 09:41 AM

VirtualDub doesn't find anything. Avisynth scripts, and then creates a virtual video file. That virtual file is used by VirtaulDub like any other video file. So it's all about the Avisynth scripts.

You're skipping a step here.
Use AvsPmod to preview and script at the same time. I never waste time scripting, saving, opening in VirtualDub, etc.

No ignorant, Avisynth has a learning curve.

I just don't have lots of extra time to dive deep into something like this right now.

DG1965 07-23-2022 09:54 AM

Thanks Lordsmurf. I will take a look at Avsmod.

lollo2 07-24-2022 03:14 AM

Quote:

I was able to upload the first script into virtualdub and saved it as "part1complete.avi" but I've got this error message on the attached script for part2?
Remove or comment the lines video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom) in script 2 and 3. It was a bad cut & paste from my side, sorry.

Quote:

I hate this style of scripting. It's backwards, hard to understand, and needlessly complex.
I understand and accept that you are not an expert of AviSynth in general and AviSynth scripts in particular :), but that style is direct and easy to
understand and to follow. In addition it allows to avoid errors where implicit "last" reference to video is bad managed. One example here: https://forum.videohelp.com/threads/...-s#post2662924, many others on videohelp and doom9 forums.

Quote:

I also don't like to manually import everything, and so you have to do that again, or else it defaults to the default (which is what I use).
selur agrees with me, as did sanlyn.
johnmeyer is one of the few folks I know that likes the backwards scripting.
Same as before. And it's strange that you dislike the specific DLLs loading approach, because you experienced the probems it causes when a generic
autoload is performed: https://forum.videohelp.com/threads/...ns#post2595004.
Better to follow jagabo and johnmeyer suggestions! ;)

DG1965 07-24-2022 08:07 AM

Thanks lollo2. I will remove that line. I will let you know how I get on. Thanks.

lordsmurf 07-24-2022 08:27 AM

Quote:

Originally Posted by lollo2 (Post 86102)
I understand and accept that you are not an expert of AviSynth in general and AviSynth scripts in particular

That's not really accurate. The issue is as I stated: it's somewhat backwards. Sometimes even the call/run is before the variable declare, which is much further down the script, but the encapsulated "whole run" nature of the script, vs. a line-by-line, allows it. It can be hard to follow along. I had to get help with trying to un-octopus johnmeyer's excellent script (which was based on videofred's), because it wasn't in logical order of operations, and jumped all over the place. I almost got the impression that john himself didn't know how to un-octopus it, and somebody else helped me with that.

Quote:

but that style is direct and easy to understand and to follow.
Not really. It probably takes lots of practice writing in that style to understand it. Other languages are really no different, such as CSS. There is a logical order flow method, and a non-order method (that follows other logics). It's often preference, but sometimes due to need. So I understand why it's done, I just hate it for basic scripts. It's hard not just for newbies, but even those of us with experience.

Quote:

and it's strange that you dislike the specific DLLs loading approach, because you experienced the probems it causes when a generic
autoload is performed: https://forum.videohelp.com/threads/...ns#post2595004.
That's not what I wrote. Read it again. That was a roundabout case of conflicts with no clear solution. It wasn't a mere DLL loading scenario. Part of the problem was the documentation sucked, so Google and guessing was needed. And the dev of a filter was an a-hole, no surprise there either. As I wrote, excellent video tool, maybe the best, but the loose open-source nature has warts.

Quote:

Better to follow jagabo and johnmeyer suggestions!
In general, definitely. I'm good, they're better. No issue admitting that. :2cents:

You have skills, too. Just different than mine. :salute:

DG1965 here is mostly just copying and pasting scripts, and I doubt he's going to pick up the coding easily, to be somewhat self reliant. Perhaps we, you and I, or even just you, should write a guide here, showing both methods. Simple stuff like crop, etc. Then it's help cut-and-paste newbies actually lean the scripting fundamentals. Most documentation is chronological, not encapsulated with variables,

lollo2 07-24-2022 09:35 AM

Quote:

I had to get help with trying to un-octopus johnmeyer's excellent script (which was based on videofred's), because it wasn't in logical order of operations,
johnmeyer did only cosmetic changes to videofred script, which was and is confusing, bringing some improvement, but nox fixing everything in term of readability.
If you look to the scripts suggested to DG1965 as starting point, they are straightforward, from A to B in seguence, every step at the right place in time, generating a dedicated "output"

Quote:

Not really. It probably takes lots of practice writing in that style to understand it.
It only adds an "output" at each step. For example, the filter sequence
Code:

### de-interlacing
deinterlaced=video_org_crop.AssumeTFF().QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)

### convert to YV16
deinterlaced_yv16=deinterlaced.convertToYV16()

### denoising
denoised_yv16=deinterlaced_yv16.TemporalDegrain2(degrainTR=3)

### convert to YUY2
denoised=denoised_yv16.convertToYUY2()

### convert to YV12
denoised_yv12=denoised.convertToYV12()

### sharpening
sharpened_yv12=denoised_yv12.LSFmod(defaults="slow")

### convert to YUY2 with chroma from YUY2 color space
sharpened=sharpened_yv12.convertToYUY2().MergeChroma(denoised)

### add borders
video_restored=sharpened.addborders(crop_left,crop_top,crop_right,crop_bottom)

return(video_restored)

can be replaced by
Code:

AssumeTFF()

QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)

convertToYV16()

TemporalDegrain2(degrainTR=3)

convertToYUY2()

denoised=last

convertToYV12()

LSFmod(defaults="slow")

MergeChroma(denoised)

addborders(crop_left,crop_top,crop_right,crop_bottom)

where an intermediate output must be created for MergeChroma operation. In this specific case is easy, but when you need to filter using several previous intermediate results can be difficult and source of errors, in particular when dealing with mask generations and operations like Overlay()

Quote:

That's not what I wrote. Read it again. That was a roundabout case of conflicts with no clear solution. It wasn't a mere DLL loading scenario.
Yes, it was. If you load the DLLs with their dependency in each script without any "autoload" feature your problem is fixed:
My project needs FilterX, which I've never used.
But FilterX needs DLL1 to be updated
Updating DLL1 breaks FilterY, so FilterY needs update.
But FilterZ has no update, and to use it, must store old DLL1 (henceforth DLL2) elsewhere, call it separate.
To use both Y+Z together in same script, even more scripting-fu skills are needed to juggle DLL1+DLL2.


Quote:

Part of the problem was the documentation sucked, so Google and guessing was needed. And the dev of a filter was an a-hole, no surprise there either. As I wrote, excellent video tool, maybe the best, but the loose open-source nature has warts.
We all agree on that ;)

Quote:

Perhaps we, you and I, or even just you, should write a guide here, showing both methods. Simple stuff like crop, etc. Then it's help cut-and-paste newbies actually lean the scripting fundamentals.
An example is just above. Writing a complete guide for AviSynth is a big task, and in this forum there are several posts from sanlyn very helpful to start. I will try to write one more small guide based on DG1965's video in the near future


All times are GMT -5. The time now is 01:56 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.