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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th February 2008, 13:20   #121  |  Link
Kumo
Registered User
 
Join Date: Apr 2006
Posts: 57
now i see, thanks.should i put "dup()" at the beginning or at the end of the script?does it work better on untouched or denoised frames?
Kumo is offline   Reply With Quote
Old 15th February 2008, 22:08   #122  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
I think it would depend on both your source and your script. Post your script and either describe your sources, or post a small sample.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 16th February 2008, 10:22   #123  |  Link
Kumo
Registered User
 
Join Date: Apr 2006
Posts: 57
the source is a japanese ntsc r2 anime dvd.here is my script
Code:
DGDecode_mpeg2source("E:\kor\VTS_01sample.d2v",info=3)
ColorMatrix(hints=true)
o  = last
ox = o.width()
oy = o.height()

crop_L =  4
area_L = 32

crop_T =  4
area_T = 32

crop_R =  4
area_R = 32

crop_B =  0
area_B =  0

stackvertical(
\   stackhorizontal(
\       o.spline16resize(area_L,area_T,crop_L, crop_T,area_L-crop_L,area_T-crop_T),
\       o.spline16resize(ox-area_L-area_R,area_T, area_L,crop_T,ox-area_L-area_R,area_T-crop_T),
\       o.spline16resize(area_R,area_T,ox-area_R,crop_T,area_R-crop_R,area_T-crop_T) ),
\   stackhorizontal(
\       o.spline16resize(area_L,oy-area_T-area_B, crop_L,area_T,area_L-crop_L,oy-area_T-area_B),
\       o.crop(area_L,area_T,-area_R,-area_B),
\       o.spline16resize(area_R,oy-area_T-area_B, ox-area_R,area_T,area_R-crop_R,oy-area_T-area_B) ) )

source = last
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
dfttest(sigma= 0.8)

LimitedSharpenFaster(ss_x=1.1, ss_y=1.1, smode=4, strength=150,undershoot= 10)
dup()
are others filters in the correct order?thanks
Kumo is offline   Reply With Quote
Old 16th February 2008, 23:03   #124  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
That's a good place to put dup. You could put it before sharpening as well, as long as it's after deinterlacing and denoising.

Merlin, it's actually for both of the reasons you listed.
foxyshadis is offline   Reply With Quote
Old 17th February 2008, 00:18   #125  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
I understood that, it's just that Kumo wanted to know about the reason for the lower bitrate, and bitrate specifically had to do with the noise, while overall size dealt with the duplicate frames.

And thanks.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 17th February 2008, 11:55   #126  |  Link
Kumo
Registered User
 
Join Date: Apr 2006
Posts: 57
Quote:
Originally Posted by foxyshadis View Post
That's a good place to put dup. You could put it before sharpening as well, as long as it's after deinterlacing and denoising.

Merlin, it's actually for both of the reasons you listed.
will it speedup the process if i put right after denoisers?i mean, will others filters be faster working on dups instead of original frames?
Kumo is offline   Reply With Quote
Old 17th February 2008, 18:02   #127  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Since the sharpeners and other random things at the end (in your other thread) are purely spatial, it won't affect speed at all.
foxyshadis is offline   Reply With Quote
Old 19th February 2008, 21:48   #128  |  Link
Kumo
Registered User
 
Join Date: Apr 2006
Posts: 57
i'm trying to use dup in a script to encode an '80s japanese anime dvd.i get jerky video ,specially in slow zoom or vertical scrolls(calling it with default settings).how could be an ultra-safe(to avoid jerkyness) setting?would it help in lowering wasted bitrate anyway?
Kumo is offline   Reply With Quote
Old 19th February 2008, 23:50   #129  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
Your encoding to x264, correct? The fact is that x264 handles duplicate frames so well that it almost isn't worth it to use dup. The only real benefit is when it comes to denoising.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 2nd July 2008, 22:56   #130  |  Link
egrimisu
Registered User
 
egrimisu's Avatar
 
Join Date: Jan 2008
Location: Romania - neighbor of Dracula
Posts: 327
Where to put DUP in this script + if i put something in wrong order tell me:

DGDecode_mpeg2source("D:\Work Hanbun no Tsuki ga Noboru Sora\Hanbun_no-Tsuki_ga_Noboru_Sora_01.DVD(MPEG2.WAV)[Misu]_Track1.d2v", cpu=0)
setmtmode(2)
dup()
setmemorymax(1024)
SmartFade(dgm=true)
source = last
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)
fluxsmoothST(5,5)
fft3dfilter(sigma=0.8, bt=1, bw=32, bh=32, ow=16, oh=16, plane=4, dehalo=0, ncpu=2)
ttempsmooth()
#FastLineDarkenMOD(strength=16,thinning=0)
#limitedsharpenfaster(Smode=4)
#maa()
gradfun2db(thr=1.2)
crop (4,0,-4,0)
Spline36resize(720,480)
egrimisu is offline   Reply With Quote
Old 12th December 2008, 04:36   #131  |  Link
SilentTweak
Registered User
 
Join Date: Oct 2007
Posts: 15
Is Dup considered fairly dangerous to use? Like I want to use Dup(Threshold=2.1), does anyone see any problems this might cause with Anime? Like maybe rape mouths? Or is that unlikely to happen? Like for example I want to use Dup to fix frames like these: http://rapidshare.com/files/172566014/DupFix.rar.html 01 is the broken frame 02 is the next frame being dupped for 01. So 01 becomes 02 when using Dup. Thing I'm worried about is if Dup causes any problems with miscalculating mouth movement at a setting of 2.0 to 3.0.
SilentTweak is offline   Reply With Quote
Old 12th December 2008, 17:30   #132  |  Link
thetoof
Sleepy overworked fellow
 
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
High threshold is more likely to introduce losses in motion fluidity (jerks (especially slow pans and zooms), small movements will disappear (mouth movement...), etc...)
There was an attempt at creating a motion adaptative dup function some time ago:
Code:
# Dupped() by Corran
#
# This filter requires a YUV source. Use converttoyv12 if needed
# before calling dupped()
#
# thresh = Used to determine when to delare a frame as new
# Use stats=true to help determine the best value for your source
# Lower number = more sensitive. (Default=16)
# panthresh=1.7 This is used to determine when to consider a frame
# part of a low motion scene. (Default=1.65)
# stats = Enable/disable display of stats. (Default=false | Not shown)
# (Last = last frame, this = this frame, next = next frame)
# showme = Enable/disable display of video that most stats are
# derived from. (Default=false | Not shown)
#
# Do not use with SetMTMode(). This function requires the frames to be
# accessed sequentially. Instead, use MT() to mulit-thread on a per-filter basis.
#
# Example:
# dupped(thresh=20,panthresh=1.7,stats=true,showme=true) 

function dupped(clip clip, int "thresh", float "panthresh", bool "stats", bool "showme")
{
global a = default(clip, last)
global thresh = default(thresh, 16)
global panthresh = default(panthresh, 1.65)
global stats = default(stats, False)
showme = default(showme, False)

	function replaceframe(clip clip, int oldframe, int newframe)
	{
		a = default(clip, last)
		trim(a,0,oldframe-1)++Trim(a,newframe,newframe)++trim(a,oldframe+1,Framecount(a))
	}

b = a #for later use with showme conditional (it isn't passed to scriptclip)
global newframe = a
a = scriptclip(a,"""
	b = a.duplicateframe(1)
	d = a.deleteframe(1)
	c = subtract(a,b)
	YMinMax = YPlaneMinMaxDifference(c)
	YAbvMed = YPlaneMax(c)-YPlaneMedian(c)
	YBelMed = YPlaneMedian(c)-YPlaneMin(c)
	YAbvBelMedDiff = Abs(YAbvMed - YBelMed)
	new = (YMinMax>=thresh || YAbvBelMedDiff>=10)
	YMinMax2 = !new ? YPlaneMinMaxDifference(subtract(a,d)) : 255
	YMinMax3 = (YMinMax2<=thresh ) ? YPlaneMinMaxDifference(subtract(b,d)) : 255
	pan = (YMinMax3 != 255 && YMinMax3!=0 && YMinMax3>=(YMinMax+YMinMax2)/2*panthresh)
	stats ? subtitle(a,"YMinMax(last,this) = "+string(YMinMax)).\
		subtitle("YAbvBelMedDiff(last,this) = "+string(YAbvBelMedDiff),y=54) \
	      : a
	newframe = (current_frame<=1 || current_frame>=Framecount()-1) ? current_frame : newframe
	stats ?	!new ? subtitle("YMinMax(this,next) = "+string(YMinMax2),y=18) : subtitle("YMinMax(this,next) = Null",y=18) : last
	stats ?	(YMinMax3!=255) ? subtitle("YMinMax(last,next) = "+string(YMinMax3)+"|"+string(ceil((YMinMax+YMinMax2)/2*panthresh)),y=36) : subtitle("YMinMax(last,next) = Null",y=36) : last	

	newframe = (new || pan)	? current_frame	: newframe

	stats ? subtitle("Last New Frame = "+string(newframe),y=90) : last
	(stats && pan) ? subtitle("(Slow pan/zoom or action detected)",y=108) : last
	(current_frame != newFrame) ? replaceframe(current_frame,newFrame) : last
	
	return last
""")
a = showme ? stackvertical(a,subtract(b,b.duplicateframe(1))) \
	   : a
return a
}
Have fun testing! Dupped(settings)
__________________
AnimeIVTC() - v2.00
-http://boinc.berkeley.edu/-
Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p)
thetoof is offline   Reply With Quote
Old 12th December 2008, 19:01   #133  |  Link
wyti
Insane Encoder
 
wyti's Avatar
 
Join Date: Feb 2008
Location: Lausanne (Switzerland)
Posts: 142
or if you want to not taking risk, use a low blksize (8 if possible)
so small movements are detected pretty well (a mouth move does about 4% IIRC)
so you don't have any problem with the treshold = 3.0 and don't kill small movements
__________________
Only two things are infinite, the universe and human stupidity, and I’m not sure about the former.
wyti is offline   Reply With Quote
Reply


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 08:55.


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