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 3rd April 2012, 11:32   #1  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
Cannot get source pulldown removed correctly

Hi, I have a video that I cannot get to look right.

The first problem is that there is a green bar at the bottom of the clip when I use Telecide, sometimes the green is not there, but then another subtle colour occurs in the same area.

The second and less annoying problem is that Telecide does not seem to fix the interlaced frames all the time.

This the code I tried.
Code:
video = mpeg2source("VTS_01_1.d2v")
audio = nicac3source("VTS_01_1 T80 2_0ch 192Kbps DELAY -133ms.ac3")
audiodub(video,audio)

telecide(guide=1)
decimate()
Here is a sample: Sample
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 3rd April 2012, 12:25   #2  |  Link
gyth
Registered User
 
Join Date: Sep 2011
Posts: 86
What field operation are you using in dgindex?
Your sample is 100% film and force film looks right to me with no further processing.
gyth is offline   Reply With Quote
Old 3rd April 2012, 13:50   #3  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
I use Honor Pulldown Flags, so I should just demux again with Force Film then?

edit: Just did it and it works perfectly, thanks gyth.
__________________
Regards.

Last edited by sigma2x; 3rd April 2012 at 13:58.
sigma2x is offline   Reply With Quote
Old 4th April 2012, 08:38   #4  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
I have another question and think its better to keep it all in one post.

Is there an easy and cheap way to remove the mosquito noise from this same clip?
My code so far is not doing a good job and the edge noise is really apparent when I up-res and sharpen.

I thought undot() would clear the problem but it did not.

this is my current code:
Code:
video = mpeg2source("VTS_01_3.d2v")
audio = nicac3source("VTS_01_3 T80 2_0ch 192Kbps DELAY -144ms.ac3")
audiodub(video,audio)
trim(70,9658)
fft3dgpu(sigma=1,plane=0,bt=4)
undot()
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 4th April 2012, 09:41   #5  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
^mosquito noise can be tricky to deal with. assuming you're dealing with only edge noise, I'd try something like edgecleaner:

Code:
# EdgeCleaner() v1.03 (06/08/2008)
# - a simple edge cleaning and weak dehaloing function
#
# Description:
# Functions have been briefly tested to work with MT on mode 1 and 2 without any problems
#
# Requirements:
# aWarpSharp (SEt's updated version), mt_masktools, Repair (optional), RemoveGrain (optional) and Deen (optional) plugins required
# YV12 input required and mod16 or even mod32 input is preferred since aWarpSharp borks sometimes
#
# Parameters:
# strength (float)      - specifies edge denoising strength (8.0)
# rep (boolean)         - actives Repair for the aWarpSharped clip (true; requires Repair)
# rmode (integer)       - specifies the Repair mode; 1 is very mild and good for halos, 
#                         16 and 18 are good for edge structure preserval on strong settings but keep more halos and edge noise, 
#                         17 is similar to 16 but keeps much less haloing, other modes are not recommended (17; requires Repair)
# smode (integer)       - specifies what method will be used for finding small particles, ie stars; 0 is disabled, 
#                         1 uses RemoveGrain and 2 uses Deen (0; requires RemoveGrain/Repair/Deen)
# hot (boolean)         - specifies whether removal of hot pixels should take place (false)
# fix (boolean)         - fixes an aWarpSharp bug by overlaying a healthy pixel from the source clip; 
#                         good idea to set to false when over-cropping afterwards (true)

function EdgeCleaner(clip c, float "strength", bool "rep", int "rmode", int "smode", bool "hot", bool "fix") {

    strength    = default(strength, 8.0)
    rep         = default(rep, true)
    rmode       = default(rmode, 17)
    smode       = default(smode, 0)
    hot         = default(hot, false)
    fix         = default(fix, false)

    c           = (c.isYV12()) ? c : c.ConvertToYV12()
    strength    = (smode==0) ? strength : strength+4

    #main        = c.aWarpSharp(strength,1) #old aWarpSharp syntax
    main	= c.aWarpSharp2(depth=strength,blur=1) #new aWarpSharp syntax
    main        = (rep) ? Repair(main,c,rmode) : main

    mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()

    final       = (!hot) ? mt_merge(c,main,mask) : Repair(mt_merge(c,main,mask),c,2)
    final       = (fix) ? Overlay(final,c.ConvertToRGB24().Crop(0,1,-c.width+1,-c.height+2),x=0,y=1) : final
    final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

    return final

}

function StarMask(clip c, int "mode") {

    mode        = default(mode, 1)

    clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
    diff        = (mode==1) ? mt_makediff(c,clean) : NOP
    
    final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
                  Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()
    
    return final

}

# Changelog:
#   06/08/2008  v1.03
#       - improved mask that leaves less warping and more original line structure, therefore higher strengths are now safe to use
#       - improved StarMask()
#       - removed super mode
#       - removed srep, sshiqloc, some smodes and VD_SmartSmoothHiQ() due to StarMask() changes
#   01/06/2008  v1.02
#       - added srep parameter
#       - improved particle masking
#   01/06/2008  v1.01
#       - added masking for particles with two parameters; smode and sshiqloc
#   12/05/2008  v1.00
#       - removed line darkening, mode 2 mask, RemoveGrain
#       - assert changed to colorspace conversion to yv12
#       - fixed some logic problems
#       - "fixed" the aWarpSharp black pixel bug
#       - added Repair
although, I find sometimes it wipes details on non-edge areas, so be careful. but it's definitely affective, especially at low strengths.

Last edited by canuckerfan; 4th April 2012 at 09:51.
canuckerfan is offline   Reply With Quote
Old 4th April 2012, 10:36   #6  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
Thanks for that but it fails with this message.
Code:
"Script error: the named argument "depth" to aWarpSharp2 had the wrong type" (EdgeCleaner.avsi, line 36)"
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 4th April 2012, 19:12   #7  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by sigma2x View Post
Thanks for that but it fails with this message.
Code:
"Script error: the named argument "depth" to aWarpSharp2 had the wrong type" (EdgeCleaner.avsi, line 36)"
you probably don't have SEt's version of aWarpSharp. get it here: http://forum.doom9.org/showthread.php?t=147285

edit: whoops, I think I modded the function incorrectly, try this:
Code:
# EdgeCleaner() v1.03 (06/08/2008)
# - a simple edge cleaning and weak dehaloing function
#
# Description:
# Functions have been briefly tested to work with MT on mode 1 and 2 without any problems
#
# Requirements:
# aWarpSharp (SEt's updated version), mt_masktools, Repair (optional), RemoveGrain (optional) and Deen (optional) plugins required
# YV12 input required and mod16 or even mod32 input is preferred since aWarpSharp borks sometimes
#
# Parameters:
# strength (float)      - specifies edge denoising strength (8.0)
# rep (boolean)         - actives Repair for the aWarpSharped clip (true; requires Repair)
# rmode (integer)       - specifies the Repair mode; 1 is very mild and good for halos, 
#                         16 and 18 are good for edge structure preserval on strong settings but keep more halos and edge noise, 
#                         17 is similar to 16 but keeps much less haloing, other modes are not recommended (17; requires Repair)
# smode (integer)       - specifies what method will be used for finding small particles, ie stars; 0 is disabled, 
#                         1 uses RemoveGrain and 2 uses Deen (0; requires RemoveGrain/Repair/Deen)
# hot (boolean)         - specifies whether removal of hot pixels should take place (false)
# fix (boolean)         - fixes an aWarpSharp bug by overlaying a healthy pixel from the source clip; 
#                         good idea to set to false when over-cropping afterwards (true)

function EdgeCleaner(clip c, int "strength", bool "rep", int "rmode", int "smode", bool "hot", bool "fix") {

    strength    = default(strength, 8.0)
    rep         = default(rep, true)
    rmode       = default(rmode, 17)
    smode       = default(smode, 0)
    hot         = default(hot, false)
    fix         = default(fix, false)

    c           = (c.isYV12()) ? c : c.ConvertToYV12()
    strength    = (smode==0) ? strength : strength+4

    #main        = c.aWarpSharp(strength,1) #old aWarpSharp syntax
    main	= c.aWarpSharp2(depth=strength,blur=1) #new aWarpSharp syntax
    main        = (rep) ? Repair(main,c,rmode) : main

    mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()

    final       = (!hot) ? mt_merge(c,main,mask) : Repair(mt_merge(c,main,mask),c,2)
    final       = (fix) ? Overlay(final,c.ConvertToRGB24().Crop(0,1,-c.width+1,-c.height+2),x=0,y=1) : final
    final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

    return final

}

function StarMask(clip c, int "mode") {

    mode        = default(mode, 1)

    clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
    diff        = (mode==1) ? mt_makediff(c,clean) : NOP
    
    final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
                  Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()
    
    return final

}

# Changelog:
#   06/08/2008  v1.03
#       - improved mask that leaves less warping and more original line structure, therefore higher strengths are now safe to use
#       - improved StarMask()
#       - removed super mode
#       - removed srep, sshiqloc, some smodes and VD_SmartSmoothHiQ() due to StarMask() changes
#   01/06/2008  v1.02
#       - added srep parameter
#       - improved particle masking
#   01/06/2008  v1.01
#       - added masking for particles with two parameters; smode and sshiqloc
#   12/05/2008  v1.00
#       - removed line darkening, mode 2 mask, RemoveGrain
#       - assert changed to colorspace conversion to yv12
#       - fixed some logic problems
#       - "fixed" the aWarpSharp black pixel bug
#       - added Repair

Last edited by canuckerfan; 4th April 2012 at 19:16.
canuckerfan is offline   Reply With Quote
Old 4th April 2012, 19:36   #8  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
I have installed the aWarpSharp you linked too and created a new .avsi with the function you posted and the same error persists.
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 4th April 2012, 19:43   #9  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Code:
# EdgeCleaner() v1.03 (06/08/2008)
# - a simple edge cleaning and weak dehaloing function
#
# Description:
# Functions have been briefly tested to work with MT on mode 1 and 2 without any problems
#
# Requirements:
# aWarpSharp (SEt's updated version), mt_masktools, Repair (optional), RemoveGrain (optional) and Deen (optional) plugins required
# YV12 input required and mod16 or even mod32 input is preferred since aWarpSharp borks sometimes
#
# Parameters:
# strength (float)      - specifies edge denoising strength (8.0)
# rep (boolean)         - actives Repair for the aWarpSharped clip (true; requires Repair)
# rmode (integer)       - specifies the Repair mode; 1 is very mild and good for halos, 
#                         16 and 18 are good for edge structure preserval on strong settings but keep more halos and edge noise, 
#                         17 is similar to 16 but keeps much less haloing, other modes are not recommended (17; requires Repair)
# smode (integer)       - specifies what method will be used for finding small particles, ie stars; 0 is disabled, 
#                         1 uses RemoveGrain and 2 uses Deen (0; requires RemoveGrain/Repair/Deen)
# hot (boolean)         - specifies whether removal of hot pixels should take place (false)
# fix (boolean)         - fixes an aWarpSharp bug by overlaying a healthy pixel from the source clip; 
#                         good idea to set to false when over-cropping afterwards (true)

function EdgeCleaner(clip c, int "strength", bool "rep", int "rmode", int "smode", bool "hot", bool "fix") {

    strength    = default(strength, 8)
    rep         = default(rep, true)
    rmode       = default(rmode, 17)
    smode       = default(smode, 0)
    hot         = default(hot, false)
    fix         = default(fix, false)

    c           = (c.isYV12()) ? c : c.ConvertToYV12()
    strength    = (smode==0) ? strength : strength+4

    #main        = c.aWarpSharp(strength,1) #old aWarpSharp syntax
    main	= c.aWarpSharp2(depth=strength,blur=1) #new aWarpSharp syntax
    main        = (rep) ? Repair(main,c,rmode) : main

    mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()

    final       = (!hot) ? mt_merge(c,main,mask) : Repair(mt_merge(c,main,mask),c,2)
    final       = (fix) ? Overlay(final,c.ConvertToRGB24().Crop(0,1,-c.width+1,-c.height+2),x=0,y=1) : final
    final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

    return final

}

function StarMask(clip c, int "mode") {

    mode        = default(mode, 1)

    clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
    diff        = (mode==1) ? mt_makediff(c,clean) : NOP
    
    final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
                  Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()
    
    return final

}

# Changelog:
#   06/08/2008  v1.03
#       - improved mask that leaves less warping and more original line structure, therefore higher strengths are now safe to use
#       - improved StarMask()
#       - removed super mode
#       - removed srep, sshiqloc, some smodes and VD_SmartSmoothHiQ() due to StarMask() changes
#   01/06/2008  v1.02
#       - added srep parameter
#       - improved particle masking
#   01/06/2008  v1.01
#       - added masking for particles with two parameters; smode and sshiqloc
#   12/05/2008  v1.00
#       - removed line darkening, mode 2 mask, RemoveGrain
#       - assert changed to colorspace conversion to yv12
#       - fixed some logic problems
#       - "fixed" the aWarpSharp black pixel bug
#       - added Repair
try that. if the error still persists, I have no idea what's wrong
canuckerfan is offline   Reply With Quote
Old 4th April 2012, 20:03   #10  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
Thanks it works now, definitely an improvement using this function, thank you!
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 4th April 2012, 22:13   #11  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Maybe, fft3d with different parametrization ... what about

Code:
FFT3dFilter(sigma=4,sigma2=5,sigma3=1.5,sigma4=0.5,bw=16,bh=16,ow=8,oh=8,bt=4,plane=0)
__________________
- 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 April 2012, 22:15   #12  |  Link
vdcrim
Registered User
 
Join Date: Dec 2011
Posts: 192
The aWarpSharp and aWarpSharp2 parameters aren't exactly the same. You also have to adapt the 'strength' magnitude, or just use the latest aWarpSharp2 [2012.03.28] with the original EdgeCleaner v1.03:

Code:
# EdgeCleaner() v1.03 (06/08/2008)
# - a simple edge cleaning and weak dehaloing function
#
# Description:
# Functions have been briefly tested to work with MT on mode 1 and 2 without any problems
#
# Requirements:
# aWarpSharp (SEt's updated version), mt_masktools, Repair (optional), RemoveGrain (optional) and Deen (optional) plugins required
# YV12 input required and mod16 or even mod32 input is preferred since aWarpSharp borks sometimes
#
# Parameters:
# strength (float)      - specifies edge denoising strength (8.0)
# rep (boolean)         - actives Repair for the aWarpSharped clip (true; requires Repair)
# rmode (integer)       - specifies the Repair mode; 1 is very mild and good for halos, 
#                         16 and 18 are good for edge structure preserval on strong settings but keep more halos and edge noise, 
#                         17 is similar to 16 but keeps much less haloing, other modes are not recommended (17; requires Repair)
# smode (integer)       - specifies what method will be used for finding small particles, ie stars; 0 is disabled, 
#                         1 uses RemoveGrain and 2 uses Deen (0; requires RemoveGrain/Repair/Deen)
# hot (boolean)         - specifies whether removal of hot pixels should take place (false)
# fix (boolean)         - fixes an aWarpSharp bug by overlaying a healthy pixel from the source clip; 
#                         good idea to set to false when over-cropping afterwards (true)

function EdgeCleaner(clip c, int "strength", bool "rep", int "rmode", int "smode", bool "hot", bool "fix") {

    strength    = default(strength, 8.0)
    rep         = default(rep, true)
    rmode       = default(rmode, 17)
    smode       = default(smode, 0)
    hot         = default(hot, false)
    fix         = default(fix, false)

    c           = (c.isYV12()) ? c : c.ConvertToYV12()
    strength    = (smode==0) ? strength : strength+4

    #main        = c.aWarpSharp(strength, 1) # old aWarpSharp syntax
    main	= c.aWarpSharp2(depth=Round(strength/2), blur=1) # new aWarpSharp syntax
    main        = (rep) ? Repair(main,c,rmode) : main

    mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()

    final       = (!hot) ? mt_merge(c,main,mask) : Repair(mt_merge(c,main,mask),c,2)
    final       = (fix) ? Overlay(final,c.ConvertToRGB24().Crop(0,1,-c.width+1,-c.height+2),x=0,y=1) : final
    final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

    return final

}

function StarMask(clip c, int "mode") {

    mode        = default(mode, 1)

    clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
    diff        = (mode==1) ? mt_makediff(c,clean) : NOP
    
    final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
                  Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()
    
    return final

}

# Changelog:
#   06/08/2008  v1.03
#       - improved mask that leaves less warping and more original line structure, therefore higher strengths are now safe to use
#       - improved StarMask()
#       - removed super mode
#       - removed srep, sshiqloc, some smodes and VD_SmartSmoothHiQ() due to StarMask() changes
#   01/06/2008  v1.02
#       - added srep parameter
#       - improved particle masking
#   01/06/2008  v1.01
#       - added masking for particles with two parameters; smode and sshiqloc
#   12/05/2008  v1.00
#       - removed line darkening, mode 2 mask, RemoveGrain
#       - assert changed to colorspace conversion to yv12
#       - fixed some logic problems
#       - "fixed" the aWarpSharp black pixel bug
#       - added Repair

Last edited by vdcrim; 4th April 2012 at 22:19.
vdcrim is offline   Reply With Quote
Old 4th April 2012, 23:26   #13  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
^whoops. missed that. while I was at it, I changed a few more things:
Code:
# EdgeCleaner() v1.04 (03/04/2012)
# - a simple edge cleaning and weak dehaloing function
#
# Description:
# Functions have been briefly tested to work with MT on mode 1 and 2 without any problems
#
# Requirements:
# aWarpSharp (SEt's updated version), mt_masktools, Repair (optional), RemoveGrain (optional) and Deen (optional) plugins required
# YV12 input required and mod16 or even mod32 input is preferred since aWarpSharp borks sometimes
#
# Parameters:
# strength (float)      - specifies edge denoising strength (10)
# rep (boolean)         - actives Repair for the aWarpSharped clip (true; requires Repair)
# rmode (integer)       - specifies the Repair mode; 1 is very mild and good for halos, 
#                         16 and 18 are good for edge structure preserval on strong settings but keep more halos and edge noise, 
#                         17 is similar to 16 but keeps much less haloing, other modes are not recommended (17; requires Repair)
# smode (integer)       - specifies what method will be used for finding small particles, ie stars; 0 is disabled, 
#                         1 uses RemoveGrain and 2 uses Deen (0; requires RemoveGrain/Repair/Deen)
# hot (boolean)         - specifies whether removal of hot pixels should take place (false)


function EdgeCleaner(clip c, int "strength", bool "rep", int "rmode", int "smode", bool "hot") {

    strength    = default(strength, 10)
    rep         = default(rep, true)
    rmode       = default(rmode, 17)
    smode       = default(smode, 0)
    hot         = default(hot, false)

    c           = (c.isYV12()) ? c : c.ConvertToYV12()
    strength    = (smode==0) ? strength : strength+4

    main	= c.aWarpSharp2(depth=Round(strength/2),blur=1) 
    main        = (rep) ? Repair(main,c,rmode) : main

    mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()

    final       = (!hot) ? mt_merge(c,main,mask) : Repair(mt_merge(c,main,mask),c,2)
    final       = (smode != 0) ? mt_merge(final,c,c.StarMask(smode)) : final

    return final

}

function StarMask(clip c, int "mode") {

    mode        = default(mode, 1)

    clean       = (mode==1) ? c.RemoveGrain(17) : Repair(c.Deen("a3d",4,12,0),c,15).RemoveGrain(21)
    diff        = (mode==1) ? mt_makediff(c,clean) : NOP
    
    final       = (mode==1) ? diff.Greyscale().Levels(40,0.350,168,0,255).removegrain(7,-1).mt_edge("prewitt",4,16,4,16) : \
                  Subtract(mt_merge(clean,c,c.mt_edge("roberts",0,2,0,2).mt_expand(mode=mt_circle(1)).mt_invert()),c).mt_edge("roberts",0,0,0,0).mt_deflate()
    
    return final

}

# Changelog:
#   03/04/2012  v1.04
#	- adapted the code to work with SEt's updated aWarpSharp
#	- removed the redundant fix parametre
#	- increased default strength to 10
#   06/08/2008  v1.03
#       - improved mask that leaves less warping and more original line structure, therefore higher strengths are now safe to use
#       - improved StarMask()
#       - removed super mode
#       - removed srep, sshiqloc, some smodes and VD_SmartSmoothHiQ() due to StarMask() changes
#   01/06/2008  v1.02
#       - added srep parameter
#       - improved particle masking
#   01/06/2008  v1.01
#       - added masking for particles with two parameters; smode and sshiqloc
#   12/05/2008  v1.00
#       - removed line darkening, mode 2 mask, RemoveGrain
#       - assert changed to colorspace conversion to yv12
#       - fixed some logic problems
#       - "fixed" the aWarpSharp black pixel bug
#       - added Repair
if anyone has any improvements for this function, I'd really appreciate it. I use it myself occasionally and I find that it sometimes removes details on non-edges. any ideas?
canuckerfan is offline   Reply With Quote
Old 5th April 2012, 00:11   #14  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Make adjustments to the edge mask for your source so it does not include non-edges, basically swapping out:
Code:
"mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()"
with a better edge mask for your source should do it...?
mastrboy is offline   Reply With Quote
Old 5th April 2012, 02:06   #15  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Quote:
Originally Posted by mastrboy View Post
Make adjustments to the edge mask for your source so it does not include non-edges, basically swapping out:
Code:
"mask        = c.mt_edge("prewitt",4,32,4,32).mt_invert().mt_convolution()"
with a better edge mask for your source should do it...?
what would be a good edge mask for a real life source? unfortunately my avisynth skills hit a wall with that line.

edit: sorry, I don't mean to hijack this thread. I will take this discussion elsewhere.

Last edited by canuckerfan; 5th April 2012 at 02:24.
canuckerfan is offline   Reply With Quote
Old 5th April 2012, 19:45   #16  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
Quote:
Originally Posted by Didée View Post
Maybe, fft3d with different parametrization ... what about

Code:
FFT3dFilter(sigma=4,sigma2=5,sigma3=1.5,sigma4=0.5,bw=16,bh=16,ow=8,oh=8,bt=4,plane=0)
Thanks Didée, your code also cleans up the edge noise quite a bit and in conjunction with edgecleaner its very smooth.

With my code now it average 11-12 fps and with SetMtMode(2) where it is i get around 12-13 fps, is there any reason MtMode has not sped things up further?

My code:
Code:
video = mpeg2source("VTS_01_3.d2v")
audio = nicac3source("VTS_01_3 T80 2_0ch 192Kbps DELAY -144ms.ac3")
audiodub(video,audio)
trim(70,9658)
SetMtMode(2)
FFT3dFilter(sigma=4,sigma2=5,sigma3=1.5,sigma4=0.5,bw=16,bh=16,ow=8,oh=8,bt=4,plane=0)
edgecleaner()
blackmanresize(1024,576,taps=8)
limitedsharpenfaster(smode=4,wide=true,ss_x=3,ss_y=3,strength=115)
addgrain(4,0,0.1)
I have noticed that changing fft3dfilter to fft3dgpu speeds it up to 18fps, maybe I should use that instead.
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 5th April 2012, 20:11   #17  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by sigma2x View Post
is there any reason MtMode has not sped things up further?
For MT mode to have any effect, you need to call SetMTMode() before the first filter in the script (including source filters).
Add SetMTMode(5) at the start.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 6th April 2012, 08:16   #18  |  Link
sigma2x
Registered User
 
Join Date: Dec 2007
Posts: 55
Quote:
Originally Posted by Gavino View Post
For MT mode to have any effect, you need to call SetMTMode() before the first filter in the script (including source filters).
Add SetMTMode(5) at the start.
I have just put SetMTMode(5) at the top of the script as suggested and in video playback, the screen flashes with weird grids and boxes when I use FFT3dGpu and put SetMTMode(2) before it.

When i use FFT3dFilter instead and have SetMTMode(2) before it, it plays back around 20-25fps but jittery, and finally when i put SetMTMode(2) After FFT3dFilter, it plays back around 20-21fps smoothly.

Thank you.
__________________
Regards.
sigma2x is offline   Reply With Quote
Old 4th November 2014, 22:08   #19  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
For the Edgecleaner script, if my clip is YV12, can I take out the
Code:
c           = (c.isYV12()) ? c : c.ConvertToYV12()
?

I don't really know what I'm looking at since I don't know much scripting beyond what I picked up of MS-DOS batch files back in the 80's, but doesn't this call on isYV12() for every "c"?

E: Ok, that doesn't make a lick of difference.

Last edited by kuchikirukia; 4th November 2014 at 22:26.
kuchikirukia is offline   Reply With Quote
Old 4th November 2014, 23:57   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
c.ConvertToYV12() does nothing if already YV12, the 'creator' func just returns the original clip rather than calling the ConvertToYV12 constructor,
takes a few millisecs longer on script startup, after that, no overhead at all.
__________________
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
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:10.


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