Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th January 2021, 12:10   #1  |  Link
knack_liek
Registered User
 
Join Date: Jan 2021
Posts: 1
Avisynth script to remove grain, spots, lines, scratches and dirt.

I am new to the world of Avisynth coding, but I have managed to create (by reading guides to find and download the various necessary plugins), through AvsPmod, a script for removing grain, dirt, lines, scratches and spots.
I did a lot of research to make sure that I have included in the source code sheet everything necessary for the script to work in the correct order, also thanks to the powerful AvsPmod debugging tool.
However, I see no difference in the output of the scripted video file.
Did I write something wrong or is the script missing some basic commands (I attach the script I write below)?
Let me know!



Code:
import("C:\Program Files (x86)\AviSynth\plugins\RemoveDirtMC.avs")
DirectShowSource("videosource", fps= 29.97, convertfps=true)
ConvertToYV12(matrix="rec709")
RemoveDirt(20,false)


DirectShowSource("videosource", fps= 29.97, convertfps=true)
ConvertToYV12(matrix="rec709")
RemoveGrain() 
TurnRight() 
RemoveGrain() 
TurnLeft()


DirectShowSource("videosource", fps= 29.97, convertfps=true)
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\despot.dll")
ConvertToYV12(matrix="rec709")
DeSpot(p1=35, p2=14, mthres=25)


DirectShowSource("videosource", fps= 29.97, convertfps=true)
ConvertToYV12(matrix="rec709")
even = SelectEven().RemoveDirt(80, false)
odd = SelectOdd().RemoveDirt(80, false)
Interleave(even, odd).RemoveDirt(80, false)
knack_liek is offline   Reply With Quote
Old 20th January 2021, 15:15   #2  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,448
Should be like below. Every time you re-source the file, you lose the previous work. Source the file only once.

Code:
import("C:\Program Files (x86)\AviSynth\plugins\RemoveDirtMC.avs")
DirectShowSource("videosource", fps= 29.97, convertfps=true)
ConvertToYV12(matrix="rec709")

RemoveDirt(20,false)

RemoveGrain() 
TurnRight() 
RemoveGrain() 
TurnLeft()

DeSpot(p1=35, p2=14, mthres=25)

even = SelectEven().RemoveDirt(80, false)
odd = SelectOdd().RemoveDirt(80, false)
Interleave(even, odd).RemoveDirt(80, false)
videoh is offline   Reply With Quote
Old 20th January 2021, 17:43   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,475
knack_liek,
FYI, DirectShowSource is probably a "last resort" source filter. It's often not frame accurate (if you jump to a specific frame number you mightn't land on the same frame each time) . Even the DirectShowSource page on the wiki suggests the same. http://avisynth.nl/index.php/DirectShowSource
You're also at the mercy of having system codecs doing the decoding.

For DVD and mpeg2 video: http://avisynth.nl/index.php/DGDecode
For most file types:
http://avisynth.nl/index.php/FFmpegSource
or
http://avisynth.nl/index.php/LSMASHSource
hello_hello is offline   Reply With Quote
Reply

Tags
despot, errors, lines, removedirt, removegrain

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.