Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #41  
07-16-2022, 10:35 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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!
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
07-16-2022, 11:23 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
I've done the three steps what is the next steps? Do I save it or do I somehow run it. Thanks.
Reply With Quote
  #43  
07-16-2022, 12:18 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
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.
Reply With Quote
The following users thank lollo2 for this useful post: DG1965 (07-16-2022)
  #44  
07-16-2022, 12:39 PM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
Thanks lollo2 for the detailed steps. I will give it a go.
Reply With Quote
  #45  
07-17-2022, 06:38 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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?


Attached Images
File Type: jpg virtualdub dub in progress.JPG (40.0 KB, 2 downloads)
Reply With Quote
  #46  
07-17-2022, 07:03 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
Also noticed this on the log I'm not sure if relevent.


Attached Images
File Type: jpg log 1.JPG (42.3 KB, 3 downloads)
File Type: jpg log2.JPG (43.0 KB, 3 downloads)
Reply With Quote
  #47  
07-17-2022, 07:23 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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.


Attached Images
File Type: jpg log4 swapped to virtualdub 1.10.4.JPG (43.3 KB, 2 downloads)
Reply With Quote
  #48  
07-17-2022, 11:43 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
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.
Reply With Quote
The following users thank lollo2 for this useful post: DG1965 (07-17-2022), lordsmurf (07-17-2022)
  #49  
07-17-2022, 12:47 PM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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.
Reply With Quote
  #50  
07-17-2022, 01:12 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I don't know, it depends on many factors. Just try and be prepared to a long wait

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: DG1965 (07-17-2022)
  #51  
07-17-2022, 02:53 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,661
Thanked 2,461 Times in 2,093 Posts
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.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: DG1965 (07-17-2022)
  #52  
07-17-2022, 03:27 PM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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.
Reply With Quote
  #53  
07-23-2022, 06:09 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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)


Attached Images
File Type: jpg I don't know what video_org. means.JPG (19.1 KB, 8 downloads)
Attached Files
File Type: txt part2 script.txt (1.3 KB, 3 downloads)

Last edited by lordsmurf; 07-23-2022 at 06:17 AM. Reason: Added code in post. -LS
Reply With Quote
  #54  
07-23-2022, 06:21 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,661
Thanked 2,461 Times in 2,093 Posts
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.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: DG1965 (07-23-2022)
  #55  
07-23-2022, 06:39 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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
Reply With Quote
  #56  
07-23-2022, 06:45 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,661
Thanked 2,461 Times in 2,093 Posts
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.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: DG1965 (07-23-2022)
  #57  
07-23-2022, 08:38 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
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.


Attached Images
File Type: png Sample script sanlyn.png (30.4 KB, 2 downloads)
Reply With Quote
  #58  
07-23-2022, 09:41 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,661
Thanked 2,461 Times in 2,093 Posts
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.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: DG1965 (07-23-2022)
  #59  
07-23-2022, 09:54 AM
DG1965 DG1965 is offline
Free Member
 
Join Date: Mar 2019
Location: Coventry England
Posts: 72
Thanked 4 Times in 4 Posts
Thanks Lordsmurf. I will take a look at Avsmod.
Reply With Quote
  #60  
07-24-2022, 03:14 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
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!

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: DG1965 (07-24-2022)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
QTGMC error message, no function called? cbehr91 Restore, Filter, Improve Quality 4 09-27-2019 09:06 PM
VirtualDub CCD plugin error? stevevid Restore, Filter, Improve Quality 2 12-11-2018 10:46 PM
Fix 404 not found error message? M Berson Web Development, Design 4 08-02-2016 07:36 AM
JVC DR-M10S 'Disc Error' message? merchantord Video Hardware Repair 9 04-22-2016 11:01 PM
Constant error message pop-ups in Firefox? gracem General Discussion 5 02-11-2012 01:03 PM




 
All times are GMT -5. The time now is 11:15 AM