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 10th November 2011, 20:16   #1  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
New Plugin: Decomet 0.4

Name: Decomet
Version: 0.4
Author: jmac698
Description: An Avisynth C plugin to reduce the appearance of black streaks and white lines, also called dropouts. Works by selecting the clean pixels from two separate recordings of the video.
Usage: decomet(clip1, clip2), where the clips are separate recordings of the same video. The videos must be edited to the same start point and stay in sync.

http://www.sendspace.com/file/aetchs
jmac698 is offline   Reply With Quote
Old 10th November 2011, 20:48   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
A source, a source, my kingdom for a source.

EDIT: Post the source & I'll see if I can do a quick convert to CPP interface,
without changing any of the active code. Of course, I dont speak C
interface, but I'll give it a bash. Dont worry about the source being
in an unkempt state, we is all messy sometimes.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 10th November 2011 at 20:57.
StainlessS is offline   Reply With Quote
Old 10th November 2011, 20:59   #3  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
Really? Your whole kingdom?
Code:
            if (aY1>=BThresh && aY1<=WThresh && bY1>=BThresh && bY1<=WThresh) {
               dest_data[x]   = (aY1 + bY1) / 2; // if both in safe range repl w avg(a,b)
               dest_data[x+1] = (aU + bU) / 2;
               dest_data[x+3] = (aV + bV) / 2;
            } else {
               dest_data[x]   = aY1; // else don't change
               dest_data[x+1] = aU;
               dest_data[x+3] = aV;
            } 
            if (aY2>=BThresh && aY2<=WThresh && bY2>=BThresh && bY2<=WThresh) {
               dest_data[x+2]   = (aY2 + bY2) / 2; // if both in safe range repl w avg(a,b)
               dest_data[x+1] = (aU + bU) / 2;
               dest_data[x+3] = (aV + bV) / 2;
            } else {
               dest_data[x+1] = aU;
               dest_data[x+2] = aY2;
               dest_data[x+3] = aV;
            }

            if (aY1>=WThresh && bY1<aY1 && bY1>BThresh) { // if a is white, take b if darker (but not black)
			   dest_data[x]   = bY1; // Take b luma
			   dest_data[x+1] = bU; // ... and chroma
			   dest_data[x+3] = bV;
            } 
            if (aY2>=WThresh && bY2<aY2 && bY1>BThresh) {
			   dest_data[x+1] = bU;
			   dest_data[x+2] = bY2;
			   dest_data[x+3] = bV;
            } // color of b is taken if any Y were replaced
            if (aY1<=BThresh && bY1>aY1 && bY1<WThresh) { // if a is black, take b if lighter (but not white)
			   dest_data[x]   = bY1;
			   dest_data[x+1] = bU;
			   dest_data[x+3] = bV;
            } 
            if (aY2<=BThresh && bY2>aY2 && bY2<WThresh) {
			   dest_data[x+1] = bU;
			   dest_data[x+2] = bY2;
			   dest_data[x+3] = bV;
            }
I'm not releasing the full source now. Really, no one wants to look at it.
jmac698 is offline   Reply With Quote
Old 10th November 2011, 21:03   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
Really, my entire kindom and all sub dominions.

OK, thought it might be an easier way of doing the C->CPP thing if you already new what it was supposed to do.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 10th November 2011, 21:09   #5  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
Oh I see, you'd offer to convert it to CPP? That would be really nice, however wait until I clean it up to the point that I actually do understand it
It's only in the barely just got it working stage.
jmac698 is offline   Reply With Quote
Old 10th November 2011, 21:39   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
Oh, you missed the EDIT:, when you do post source, give us a PM if I dont get back to you within a couple
of days and I'll do the convert. It should hopefully be easy for a simplish plug.
I got so far into converting AVSInpaint() to CPP, but that is really not too easy to understand, the
interface is embedded within the active code and is hard to figure out what should be extracted.
I shall go back to it sometime.
If you can, keep the active code departmentalized from the interface, twould make it easier for me.

EDIT you could also PM me a source link if you were unwilling to publish.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 10th November 2011 at 21:41.
StainlessS is offline   Reply With Quote
Old 8th March 2012, 17:36   #7  |  Link
cherbette
Registered User
 
Join Date: Nov 2011
Posts: 23
Would something like this work best using several different VCR's to make the 2 or 3 different rips to decomet?
cherbette is offline   Reply With Quote
Old 8th March 2012, 17:52   #8  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
Hi Cherbette!
The Decomet plugin is meant for the difficult case of only 2 passes. If you are willing to take the time to make 3 passes, you can use the median technique instead. I haven't tried passes from different VCR's, but I know that in the case of one tape, there was the least noise on just one of the VCR's, so I didn't really have much choice.

Based on the way the comets always appear in different places, I don't see any advantage to using different VCR's.
jmac698 is offline   Reply With Quote
Old 8th March 2012, 18:19   #9  |  Link
cherbette
Registered User
 
Join Date: Nov 2011
Posts: 23
What is the median technique and which would you recommend? I can send you a screencap if you'd like of the video in question...it's really strange the comets seem to disappear when I pause the video but all three VCR's I've played it on have comets active during playback.
cherbette is offline   Reply With Quote
Old 8th March 2012, 18:21   #10  |  Link
cherbette
Registered User
 
Join Date: Nov 2011
Posts: 23
Also the sendspace link to the plugin above is no longer active

Last edited by cherbette; 8th March 2012 at 18:57.
cherbette is offline   Reply With Quote
Old 8th March 2012, 23:15   #11  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
oh! that's a real pain. Digital decay is a serious problem these days, there's rare plugins you can hardly find anymore.
For help in identifying your problem, please view http://forum.videohelp.com/threads/3...omets-dropouts
That contains an example and description of the types of comet noise I've run into.
You can post your screenshot also if you like, I'm happy to compare how it looks for others.
The median technique has been covered a few times, let me search a link.
jmac698 is offline   Reply With Quote
Old 14th March 2012, 02:51   #12  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
Here's a thread about it
http://forum.videohelp.com/threads/3...87#post2146687
jmac698 is offline   Reply With Quote
Old 16th July 2012, 05:32   #13  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
see under new plugins & utilities
http://forum.doom9.org/showthread.ph...76#post1582976

Updated link.
jmac698 is offline   Reply With Quote
Old 19th July 2017, 10:53   #14  |  Link
Busty
Registered User
 
Join Date: Sep 2016
Posts: 9
I'm trying to get decomet to work here and am struggling with the script. I don't have any knowledge about that, so I already expected the script to not work:-)

This is what I try as a script:

Quote:
avisynth_install_dir="C:\Program Files\AviSynth\Plugins-to-load"
plugin1_fn="avisynth_c.dll"
Cplugin1_fn="Decomet.dll"
LoadPlugin(avisynth_install_dir+plugin1_fn)
LoadCPlugin(avisynth_install_dir+Cplugin1_fn)

clean=colorbars(width=360, height=240, pixel_type="YUY2")#Clean clip
clip1=addcomets(clean)#noisy clip1
clip2=addcomets(clean)#a different noisy clip2
decomet(clip1,clip2)
stackhorizontal(clip1.subtitle("Original 'A'"),clip2.subtitle("Original 'B'"),last.subtitle("Decomet cleaned version"))

function whiteline(clip template) {
template.blankclip(width=template.width/4, height=1,color_yuv=$EB8080)
}

clip1=AVISource("myvideo1.avi").AssumeTFF()
clip2=AVISource("myvideo2.avi").AssumeTFF()
decomet(clip1, clip2)
I get the error
Quote:
"Avisynth open failure: Script error: there is no function named "addcomets" (C:\Program Files\Avisynth\Plugins\decomet.avs, line 8)
What exactly am I doing wrong here and how would be the right way? Thanks for any help!
Busty is offline   Reply With Quote
Old 19th July 2017, 13:58   #15  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,089
Quote:
Originally Posted by Busty View Post
What exactly am I doing wrong here and how would be the right way? Thanks for any help!
You're calling your clips as functions. Change the folllowing:

Quote:
clip1=addcomets(clean)#noisy clip1
clip2=addcomets(clean)#a different noisy clip2
to something like

Quote:
clip1=clean #noisy clip1
clip2=clean #a different noisy clip2
Reel.Deel is offline   Reply With Quote
Old 19th July 2017, 22:13   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
I dont know how you are getting past the LoadPlugin/LoadCPlugin lines, you need a '\' between "C:\Program Files\AviSynth\Plugins-to-load" and plug name.
(just add it to end of the "C:\Program Files\AviSynth\Plugins-to-load\" line.)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 21st July 2017, 07:47   #17  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,862
Agreed. Also, the demo script I included, creates an artificial sample of the problem, then shows the plugin removing it. To use it practically, load your two clips and call decomet.
Code:
avisynth_install_dir="C:\Program Files\AviSynth\Plugins-to-load\"
plugin1_fn="avisynth_c.dll"
Cplugin1_fn="Decomet.dll"
LoadPlugin(avisynth_install_dir+plugin1_fn)
LoadCPlugin(avisynth_install_dir+Cplugin1_fn)

clip1=AVISource("myvideo1.avi").AssumeTFF()
clip2=AVISource("myvideo2.avi").AssumeTFF()
decomet(clip1, clip2)
@StainlessS
I lost all my sources long ago, but the snippet I posted is enough to recreate it. It's still a useful plugin, as there's still none like it.
I can probably program C++ now btw, since technically I've learned Python, Java, Objective-C and Swift by now Swift is nice, reminds me of Python. I can see why people love Python, it should be the new basic. My favourite language will always be 6502 assembly though.

Last edited by jmac698; 21st July 2017 at 07:52.
jmac698 is offline   Reply With Quote
Old 21st July 2017, 10:17   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
Quote:
I lost all my sources long ago
I think I have the CPP version somewhere, I'll also see if I have C and post link to both a little later today.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 21st July 2017, 11:21   #19  |  Link
amayra
Quality Checker
 
amayra's Avatar
 
Join Date: Aug 2013
Posts: 209
there any hope to see Decomet full source code ?
__________________
I love Doom9
amayra is offline   Reply With Quote
Old 21st July 2017, 13:09   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,056
Quote:
Originally Posted by StainlessS View Post
I think I have the CPP version somewhere, I'll also see if I have C and post link to both a little later today.
Sorry, I dont have it

Think I mixed up DeComet and DeMosaic (de-Bayer) when thinking of what source I had, here DeMosaic. (original C and CPP mod, with source):- http://www.mediafire.com/file/4cii55...emosaicCPP.zip
EDIT: And DeMosaic thread:- https://forum.doom9.org/showthread.p...light=demosaic
EDIT: I dont think that you ever published or supplied to me the full DeComet source.

Some posted alternatives to DeComet here:- http://forum.doom9.org/showthread.ph...et#post1800999


here Decomet alternatives, DeClick (DGraft) and DePulse/DepulseC(with source):- http://www.mediafire.com/file/e56wv9...9eu/DeStuff.7z
EDIT: The above Destuff.7z uses recent-ish version of 7Zip and may not decompress with some versions of WinZip/WinRar.

EDIT: Always amazes me to see color coming out of BW image
Code:
#LoadPlugin("DemosaicCPP.dll")          # Standard CPP plugin, can go in Plugins dir

ImageSource("image.jpg")
ConvertToYV12()
o=Last
DemosaicCPP(xoffset = 1, yoffset = 0, method = "bilinear")
#DemosaicCPP(xoffset = 1, yoffset = 0, method = "nearest")

RGBAdjust(r=1.0, g=1.1, b=1.8, a=1.0, rb=0.0, gb=0.0, bb=0.0, ab=0.0, rg=1.00, gg=1.00, bg=1.00, ag=1.00, analyze=false)

Return StackVertical(o.ConvertToRGB32.Sub("Source"),Last.Sub("DeMosaic"))

Function Sub(clip c,string tit){
    S="Subtitle(String(current_frame,"+Chr(34)+"%.f] "+tit+Chr(34)+"))"StackVertical(c.BlankClip(height=20).ScriptClip(S),c)
}


EDIT: BW image contained in DeMosaic zip file.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 22nd July 2017 at 01:12.
StainlessS is offline   Reply With Quote
Reply

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 06:15.


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