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 26th February 2010, 22:36   #1  |  Link
iMaiden
Registered User
 
iMaiden's Avatar
 
Join Date: Aug 2009
Posts: 28
Dup Filter for Avisynth

I recently found the dup filter here

http://neuron2.net/dup/dupnew.html

But it does not seem to compare the target frame with the reference frame. It seems to compare the frame with itself. On the information it says:

Dupe 2.3
Copyright 2003-2007 Donald Graft/Klaus Post

frm 25: diff from frm 25 = 0.00%
using frm 25

I am using direct show to import a MP4. and then running the dup command. There are no other filters in my chain.

Am I miss'in something easy?



I am using avisynth 2.5

Last edited by iMaiden; 26th February 2010 at 22:38.
iMaiden is offline   Reply With Quote
Old 26th February 2010, 22:39   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Give your full script.
Guest is offline   Reply With Quote
Old 26th February 2010, 23:03   #3  |  Link
iMaiden
Registered User
 
iMaiden's Avatar
 
Join Date: Aug 2009
Posts: 28
loadplugin("Z:\LIBRARY\avisynth\directshowsource.dll")

loadplugin("Z:\LIBRARY\avisynth\dup.dll")



DirectShowSource("z:\little_boy\og\MVI_8193.mp4")

dup(threshold=.1,show=true,blksize=8,blend=true,chroma=true,maxcopies=20)


converttorgb32(matrix="PC.709")

ImageWriter("z:\little_boy\8193\fin",type="tif")
iMaiden is offline   Reply With Quote
Old 28th February 2010, 07:20   #4  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
Can I post here? I detected something is wrong with the dup filter. I found some incompatibility with tempgauss, I cant even preview in avsp, with the new Didee's modification. With beta1u it was failing at encode time. Besides dup.dll there is any other filters or routines it uses that can conflict with tempgauss's?

Quote:
global MeGUI_darx = 257
global MeGUI_dary = 200

setmemorymax(768)

SetMTmode(5)
DGDecode_MPEG2Source("takashinakamura.d2v")
SetMTmode(2)
ColorMatrix(dest=2,hints=false,interlaced=true) #dest 2 to 607/470, dest 1 to 709

crop(8,0,-18,0)
tempgaussmc_beta2(2,2,3,EdiMode="NNEDI2",qual=3)
SRestore(FRate=23.976)
Dup(threshold=9,blend=false,copy=true,chroma=false,blksize=8,show=false)
Lanczos4Resize(704,height)

trim(5700,5800)

Distributor()
Edit: forget about it, srestore isnt mt asissted I was also running cross versions of avisynth and mt, my fault.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 4th March 2010 at 11:42.
Dogway is offline   Reply With Quote
Old 4th March 2010, 05:47   #5  |  Link
iMaiden
Registered User
 
iMaiden's Avatar
 
Join Date: Aug 2009
Posts: 28
I am left to assume that this filter does not work with my source video or does not work at all with mp4's or avi's. Has anybody had any luck using this filter with this source type?
iMaiden is offline   Reply With Quote
Old 4th March 2010, 06:42   #6  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I expect you are just misinterpreting the output, but unfortunately I do not have any time to think about it right now.
Guest is offline   Reply With Quote
Old 4th March 2010, 11:30   #7  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Quote:
Originally Posted by Dogway View Post
Can I post here? I detected something is wrong with the dup filter. I found some incompatibility with tempgauss, I cant even preview in avsp, with the new Didee's modification. With beta1u it was failing at encode time. Besides dup.dll there is any other filters or routines it uses that can conflict with tempgauss's?
Just for fun, try commenting out the Srestore line.
Does it still crash?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 4th March 2010, 11:39   #8  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,352
upss sorry, I didnt edit it was an old post, its solved now. But related to it right now Im processing srestore and dup as setmtmode(5), I dont know which way is better, but dup being an old filter made sense to me.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 6th November 2014, 03:24   #9  |  Link
Max73
Registered User
 
Join Date: May 2010
Location: The Netherlands
Posts: 4
Updated Dup log, increased sensitivity for low contrast motion

As a reply to iMaiden, the one initiating this post, (I know it is ancient), i dared updating the dup v2.30 into dup1 v2.32.

Function name and dll are now called Dup1 so one can easily compare results in stackhorizontal of both Dup 2.30 and Dup1 2.32.

With the original 2.30 i had difficulties preventing blend when small portion of the video showed motion in low contrast areas (e.g. moving clouds out of a window), unless one would set the threshold so low (<1%) that correct duplicates would not be detected. After few days testing I feel that this in the new v2.32 is solved. Now a Threshold around 1.5 served me good for BlkSize=32 and a good quality anime @ 640x480.

Also, the debug (show) interface was not too helpful, it had a couple of fixes (see below).

Changes (2014-11-11)

- Show metric (when show=true) also when reading the first frame outside a set of duplicates (instead of diff from x to x = 0)

- Skip border blocks in worst block metric calculation, they are more noisy

- Added a simple motion metric to denoise decisions
> old_metric = SumAbsDiff[] = Sum(Abs(Diff)) : more sensitive to high contrast any motion, less sensitive in low contrast motion, more noisy
> lc_motion_metric = abs(SumSigDiff[]) = Abs(Sum(Diff)) : more sensitive to large motion in low contrast, less noisy (pos and neg noise cancels out)
> new metric = 32/BLKSIZE * (old_metric/2 + lc_motion_metric): highest_Sum refers to this now

- Show Largest sum block in overlay (when show=true), for new metric (much brighter), and old one (little brighter)

- settings (personal preference): Dup(threshold =1.50,chroma=false,show =true, copy=true, maxcopies=20, blend=true, blksize=32,debug=false)

P.S.: a downsize of v2.32, the new metric is not implemented in isse but just in C, and needs unrolling.
Attached Files
File Type: 7z dup232src.7z (96.1 KB, 259 views)

Last edited by Max73; 12th November 2014 at 00:12. Reason: more tested, and improved
Max73 is offline   Reply With Quote
Old 6th November 2014, 05:09   #10  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,685
It is strange to bring this particular thread back from the grave. If you are interested in more recent "technology" created for this purpose, I suggest you search for posts by StainlessS, especially in his long RT_Stats thread.
johnmeyer is offline   Reply With Quote
Old 14th November 2014, 01:06   #11  |  Link
Max73
Registered User
 
Join Date: May 2010
Location: The Netherlands
Posts: 4
@ johnmeyer,
I see your point, and checked out RT_stats, a lot of stuff there, but did not see there a clear way to blend "almost identical" frames

I found that this little "dup filter" does its job pretty well, especially if preceded by stab. I just shared the same frustration of Maiden in setting the parameters right, which motivated me to upload an updated Dup1 (the original is to be found here, which fixed this issue among other changes (see previous post, 6th November, updated the 12th).
Max73 is offline   Reply With Quote
Old 14th November 2014, 01:12   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@Max73, a moderator recently posted that the best way to ensure speedy approval of attachment is 'Report' your own post with attachment.
Perhaps its now time to report your post, pending about 8 days now.
__________________
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 14th November 2014, 02:27   #13  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
Re-uploads have to be re-approved, looks like that happened earlier this week. I didn't noticed the edits, approved now.
foxyshadis is offline   Reply With Quote
Old 22nd November 2014, 07:31   #14  |  Link
Elegant
Registered User
 
Join Date: Jul 2014
Posts: 55
@Max73, this might sound odd but can you create a x64 build? Kind of hitting the cap for what I'm doing.
Elegant is offline   Reply With Quote
Old 29th July 2015, 20:42   #15  |  Link
Seedmanc
Registered User
 
Join Date: Sep 2010
Location: Russia
Posts: 85
@Max73 it keeps giving me exceptions, seems to be random.
Seedmanc is offline   Reply With Quote
Old 18th November 2015, 00:59   #16  |  Link
tartak
Registered User
 
Join Date: Jul 2009
Posts: 13
Same for me, since upgrading to avisynth 2.6 (st). Access violation.
tartak is offline   Reply With Quote
Old 19th November 2015, 21:48   #17  |  Link
tartak
Registered User
 
Join Date: Jul 2009
Posts: 13
Fixed access viloation bugs, updated to 2.6

These access violation bugs were a simple case of using uninitialized variables (a small miracle they did not pop up right away). Fixed two of these and updated to 2.6 api. Compiled in VS 2015.
Attached Files
File Type: 7z dup232a_src.7z (100.5 KB, 1087 views)
tartak is offline   Reply With Quote
Old 21st December 2020, 13:56   #18  |  Link
nji
Registered User
 
Join Date: Mar 2018
Location: Germany
Posts: 200
I've got 2 simple question on it:

The filter compares neighboured frames, right?
If that's the case:
What about the scenario when the frames slowly "shift" away,
all neighboured differences low, but the differences to the
string's starting frame getting very high?
How to handle the scenario?

What's the behaviour/ use when copy = false?
nji is offline   Reply With Quote
Old 21st December 2020, 21:10   #19  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,340
Quote:
Originally Posted by nji View Post
What's the behaviour/ use when copy = false?
copy=false means it does not replace with duplicates. It's used for debugging purposes, so you can "see" what is going on with show=true, so you can adjust the settings such as threshold and blksize


Quote:
The filter compares neighboured frames, right?
If that's the case:
What about the scenario when the frames slowly "shift" away,
all neighboured differences low, but the differences to the
string's starting frame getting very high?
How to handle the scenario?
Yes, direct neighbor only

This filter will not adjust for that differences drift scenario .

Not sure if there are any other options
poisondeathray is offline   Reply With Quote
Old 22nd December 2020, 02:58   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Duplicty2 script function can do what you are referring to, control via LagMax.
https://forum.doom9.org/showthread.p...ght=Duplicity2

Code:
    Function Duplicity2(clip c,"Mode"=0,Float "ThG"=1.0,Float "ThB"=ThG*2.0, Int "ThP"=64,Float "IgP"=0.0,Int "ThK"=7,
        \ Int "MaxDupLen"=9,Int "LagMax"=MaxDupLen,Int "MaxInterp"=Min(9,MaxDupLen),
        \ int "BlkW"=64,int "BlkH"=BlkW,int "OLapX"=BlkW/2,Int "OLapY=BlkH/2",
        \ Int "X"=0,Int "Y"=0,Int"W"=0,Int "H"=0,Float "CW"=0.0,Bool "ChromaI"=False,Bool "AltScan"=False,
        \ Int "SPad"=16, Int "SSharp"=1, Int "SRFilter"=4,                             [* MSuper          *]
        \ Int "ABlkSize"=16, Int "AOverlap"=4,   Int "ASearch"=3,Int "ADct"=0,         [* MAnalyse        *]
        \ Int "RBlkSize"=8,  Int "ROverlap"=2,   Int "RthSAD"=100,                     [* MRecalculate    *]
        \ Float "Iml"=200.0, Bool "IBlend"=True, Int "IthSCD1"=400, Int "IthSCD2"=130, [* MFlowInter      *]
        \ Int "OthSCD1"=400,Int "OthSCD2"=130,                                         [* Dupe Detect Override @ Scene Change *]
        \ String "OverRide"="",String "Frames"="Frames.txt",Bool "Ranges"=True,Bool "FrameAsRange"=False,
        \ Bool "Show"=True,Bool "Verb"=True,Bool "ShowBlk"=True,Bool "Dim"=True,Bool "ShowDot"=False,
        \ Bool "InterpFast"=True,String "DBase"=""
        \ )

    # ...

        MaxDupLen,    Default 9. Maximum permitted detection length of duplicate run, If detected dupe run exceeds this setting,
                      then it is totally ignored and presumed to be a static scene.

        LagMax,       Default MaxDupLen. Setting to a low number (min 1) will limit the distance of the Anchor frame prior to
                      the current frame, eg setting LagMax=1, would always do LoMo/Dupe compare with the current frame and its
                      predecessor. Maybe best left alone.

    # ...
EDIT: It also has 3 simultaneous detectors, frame global, block, and single pixel.
Can detect eg small eye movement whereas other detector would totally miss it.
__________________
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 December 2020 at 03:04.
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 05:43.


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