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. |
3rd April 2012, 11:32 | #1 | Link |
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()
__________________
Regards. |
4th April 2012, 08:38 | #4 | Link |
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. |
4th April 2012, 09:41 | #5 | Link |
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 Last edited by canuckerfan; 4th April 2012 at 09:51. |
4th April 2012, 19:12 | #7 | Link | |
Registered User
Join Date: Jul 2005
Posts: 317
|
Quote:
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. |
|
4th April 2012, 19:43 | #9 | Link |
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 |
4th April 2012, 22:13 | #11 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
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!) |
4th April 2012, 22:15 | #12 | Link |
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. |
4th April 2012, 23:26 | #13 | Link |
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 |
5th April 2012, 00:11 | #14 | Link |
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()" |
5th April 2012, 02:06 | #15 | Link | |
Registered User
Join Date: Jul 2005
Posts: 317
|
Quote:
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. |
|
5th April 2012, 19:45 | #16 | Link | |
Registered User
Join Date: Dec 2007
Posts: 55
|
Quote:
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)
__________________
Regards. |
|
6th April 2012, 08:16 | #18 | Link | |
Registered User
Join Date: Dec 2007
Posts: 55
|
Quote:
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. |
|
4th November 2014, 22:08 | #19 | Link |
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. |
4th November 2014, 23:57 | #20 | Link |
HeartlessS Usurer
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 ??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|