VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. lets say that from frame 0 to 34067 i want to use like 5 filters and then from 34068,34314 a different one and then join them

    what is the easiest way to do it?

    EDIT:

    source=Mpeg2Source("D:\VIDEO_TS.d2v", CPU2="ooooxx").TFM().TDecimate(Mode=1).ColorMatrix (mode="rec.601->rec.709").ColorYUV(cont_y=5, cont_u=-60, cont_v=0,gamma_y=-30)
    a=Trim(source,0,34067)
    b=Trim(source,34068,34313)
    c=Trim(source,34314,0)
    a = a.Hysteria(strength=6.0, maxchg=26, lowthresh=15, highthresh=20).McTemporalDenoise(settings="high"). nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720).Hysteria(strength=5.0, maxchg=28).Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3).nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080).Blur(1.0)
    b = b.nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720).nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080)
    c = c.Hysteria(strength=6.0, maxchg=26, lowthresh=15, highthresh=20).McTemporalDenoise(settings="high"). nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720).Hysteria(strength=5.0, maxchg=28).Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3).nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080).Blur(1.0)
    a+b+c

    its this ok ? (a and c are one line it just doesnt fit here)
    Last edited by zanzar; 1st Dec 2016 at 19:58.
    Quote Quote  
  2. Yes, it's OK - but I suggest you organize your code into functions, like this:
    Code:
    Mpeg2Source("D:\VIDEO_TS.d2v", CPU2="ooooxx")
    TFM
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-60, cont_v=0, gamma_y=-30)
    
    return
    \   fa.Trim(0, 34067)
    \ + fb.Trim(34068, 34313)
    \ + fa.Trim(34314, 0)
    
    function fa(clip C)
    {
    	C
    	Hysteria(strength=6.0, maxchg=26, lowthresh=15, highthresh=20)
    	McTemporalDenoise(settings="high")
    	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    	Hysteria(strength=5.0, maxchg=28)
    	Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080)
    	Blur(1.0)
    	return Last
    }
    
    function fb(clip C)
    {
    	C
    	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080)
    	return Last
    }
    
    #function fc(clip C)
    #{
    #	C
    #	Hysteria(strength=6.0, maxchg=26, lowthresh=15, highthresh=20)
    #	McTemporalDenoise(settings="high")
    #	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    #	Hysteria(strength=5.0, maxchg=28)
    #	Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    #	nnedi3_rpow2(2, cshift="spline36resize", fwidth=1920, fheight=1080)
    #	Blur(1.0)
    #	return Last
    #}
    Putting filters on separate lines makes them easier to comment out for testing.
    You will also get better error feedback: the line number will usually point to the exact filter that is causing the trouble.

    Note use of "\" for line continuation, and the implicit Last variable.

    After re-formatting the code this way, it became obvious that fa() and fc() were identical, so fc() was commented out and fa() called twice.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!