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 24th May 2014, 14:13   #61  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Just had a look at the 3x2 cursor clip.
This shows differences from previous frame (already posted this previously)
Code:
SHOW=False

#aviName="D:\avs\avi\in\painting test for avisynth.avi.AVI"
aviName="D:\avs\avi\in\capture-1.avi.AVI"

Avisource(AviName)

Prev=DeleteFrame(FrameCount-1).SelectEvery(1,-1)
Clipdelta(Prev,Last,true,SHOW)
ScriptClip("""RT_SubTitle("%d",current_frame)""")
return Last

# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
    amp=Default(amp,false)
    show=Default(show,false)
    c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
    c1=clip1.subtract(clip2)
    c1=(amp)?c1.levels(127,1.0,129,0,255):c1
    return (show)?c1.Merge(c2):c1
}
and this (already posted) shows difference between frame 2200 and current frame, (play from 2200)
Code:
#FRAME=372
FRAME=2200

SHOW=False
#aviName="D:\avs\avi\in\painting test for avisynth.avi.AVI"
aviName="D:\avs\avi\in\capture-1.avi.AVI"

Avisource(AviName)

A=trim(FRAME,-1)
A=A.FreezeFrame(1,Last.FrameCount-1,0)
Clipdelta(a,Last,true,SHOW)
ScriptClip("""RT_SubTitle("%d",current_frame)""")
return Last

# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
    amp=Default(amp,false)
    show=Default(show,false)
    c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
    c1=clip1.subtract(clip2)
    c1=(amp)?c1.levels(127,1.0,129,0,255):c1
    return (show)?c1.Merge(c2):c1
}
If you play from 2200, it shows rubbish being generated on the frame, some on the left (close but not that close to edits)
and a lot of rubbish on the right (nowhere near edits).
I was wondering if it might actually be CamStudio that is causing the rubbish problems (including cloud around the cursor problem),
it might be a good idea to try another screen cap software if you have access to one.
You can locate rubbish by using first script above, just watch for unexplained 'gunk' appearing, and then use 2nd script
setting FRAME to a few frames before the rubbish appears.

I'm not sure I can do anything so long as the rubbish keeps appearing, I think something really has to go, either the paint package, or
CamStudio, would also be good if you could find a way of not recording the cursor.
__________________
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; 24th May 2014 at 14:42.
StainlessS is online now   Reply With Quote
Old 20th July 2014, 19:32   #62  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Hi StainlessS

I came back, I will provide sample without cursor (I found a way to record without it), You may be right and perhaps is the recording app or even the painting app, lets try just without cursor, maybe you could find a way to get rid of 70% of the undos.
eduardobedoya is offline   Reply With Quote
Old 20th July 2014, 19:44   #63  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Hi there ed,
Sorry bout not getting any further, but is still on back burner, no further release of RT_stats since then, still working on it.
As I dont like continually battering my head against the wall, I have been doing a few other things in between, but keep going
back to both your problem, and a Scene Change detector which I am trying to perfect. I will not release another RT until I have achieved both.
Leave a link if your like and I'll DL and add it to my queue of things to do.

Good to hear about the cursor, 'sort of' looking forward to having another go at 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 ???
StainlessS is online now   Reply With Quote
Old 11th September 2014, 22:33   #64  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,371
removed off-topic posts. @Seedmanc if you have problems with the rules in some circumstances you know where to report them (and that's not here).
Wilbert is offline   Reply With Quote
Old 19th September 2014, 21:26   #65  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Hi Ed, just a sitrep.

Still banging away at your problem, using new version RT_Stats, not having a great deal of luck as yet because of the crud pixels
in UNDO's. Especially where there are several undo's in succession where one undo frame acquires 17,800+ crud pixels of error up to about 5 luma levels.
Its hard to tell difference bwetween crud and edit.

Anyway, just thought I'de say that you should not delete your account or anything like that, I am still busy.

Here a log of what I just got a few moments ago on your most recent sample, script completely different to previous, think I need to
go back and use some of the tactics in an earlier attempt.
Code:
Fsel_Eduardobedoya_Batch.Log
LumaTol=0.015000 EDIT_T = 0.002000 KeepMax=1
YV12=True PC709=True CROPPING=128,128,328,128

1/1 ] Processing D:\ED\Last capture without cursor.avi.AVI
QWIK Scan DBase creation = 0.00 Secs (0.00 Mins)
34,75 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=1.004695E-003 @ 34<-->76)
117,207 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=5.156109E-004 @ 117<-->208)
276,388 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=9.560631E-004 @ 276<-->389)
418,462 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=4.763737E-004 @ 418<-->463)
482,591 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.116602E-004 @ 482<-->592)
612,668 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=7.792190E-005 @ 612<-->669)
713,811 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=3.735278E-003 @ 713<-->812)
826,849 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=3.665093E-003 @ 826<-->850)
879,912 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.001653E-003 @ 879<-->913)
919,1011 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=1.656476E-002 @ 919<-->1012)
1118,1151 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=4.518918E-003 @ 1118<-->1152)
1211,1221 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=5.032871E-003 @ 1211<-->1222)
1259,1311 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=4.758210E-004 @ 1259<-->1312)
1391,1418 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=3.862937E-004 @ 1391<-->1419)
1553,1593 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.724504E-004 @ 1553<-->1594)
1608,1647 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.812926E-004 @ 1608<-->1648)
1690,1722 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=9.748528E-004 @ 1690<-->1723)
1727,1769 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=9.030099E-004 @ 1727<-->1770)
1784,1811 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.906874E-004 @ 1784<-->1812)
1826,1878 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=1.137328E-003 @ 1826<-->1879)
1879,1902 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=1.205303E-003 @ 1879<-->1903)
1923,1953 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=4.327153E-004 @ 1923<-->1954)
1957,1987 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=2.155287E-004 @ 1957<-->1988)
2016,2089 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=1.071564E-003 @ 2016<-->2090)
2095,2128 *** SKIPPING earlier duplicate sequence and UNDOS (Crud=6.532177E-004 @ 2095<-->2129)


Kept 409 of 2150 frames [1464x824 143.33 secs (2.39 Mins) @ 15.00 FPS]
File CrudMax = 1.656476E-002 CrudMaxFrame=1012 FramesSearched=395266
QWIK SCAN 420.76 Secs (7.01 Mins) InFPS=5.11 OutFPS=0.97 FramesSearchedFPS=939.41

 fn="D:\ED\Last capture without cursor.avi.AVI"
 Avisource(fn)
 ScriptClip("Subtitle(String(current_frame))")
 PathAndNode="D:\ED\Last capture without cursor.avi"
 CmdFrames=PathAndNode+"_Frames.txt"
 Ranges=PathAndNode+"_Ranges.txt"
 Ex=Exist(CmdFrames)
 (Ex) ? FrameSel_CmdReWrite(Ranges,cmd=CmdFrames,reject=False) : NOP # Informational ONLY
 (Ex) ? FrameSel(cmd=CmdFrames,reject=False) : NOP
 Return Last
 
D:\ED\Last capture without cursor.avi.AVI  Tot File Time = 421.20 Seconds (7.02 Mins)


TOTAL Time = 421.21 Seconds (7.02 Mins)

Global CrudMax =1.656476E-002


DONE
EDIT: I'm cropping off the thumbnail, dont need additional crud from that. Also note, that the new sample also has a lot of visible crud
at the bottom of frame that I have not noticed before, anyway, cropping it off for better detection.
__________________
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; 19th September 2014 at 22:01.
StainlessS is online now   Reply With Quote
Old 8th October 2014, 01:36   #66  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
@Eduardobedoya,
Here tis at last, hope you did not close you D9 account (or cut off your ear, tis the artistic way I hear [with my one good ear]).

Part 1 of 2 (glue them back together into a single script)

Code:
# ############################
# Fsel_Eduardobedoya_Batch.avs, by StainlessS
# Remove Undos from painting captures.
########################################################################
THRESH          = 0.01      # (0.01) Max LumaTol due to crud between undone/undo frames. (set about double CrudMax)
                            # (CrudMax only valid as Check when results are satisfactory)
                            # Upper Limit for self tuning LumaTol.
#
LUMATOL_SCALE   = 1.0       # (1.0) Range 1.0 -> 2.0. Should never need change from 1.0.
                            # LumaTol is self tuning but could possibly be in error where without this setting would fail miserably.
                            # If self tune LumaTol is set too low then will not find matching UNDONE frames. This setting allows
                            # to increase LumaTol as LumaTol is multiplied by it, and then restricted at upper limit by THRESH above.
                            # If ever need to be changed, suggest something like 1.00001. (temporary change only)
#
LUMATOL_ADD     = 0.0       # (0.0) Range 0.0 -> 1.0. Additional adjustment added to LumaTol, probably never necessary, but if so then
                            # something like 0.000001. Applied before limiting to THRESH as above.
#
MIN_EDITLEN     = 4         # (4) An edit has to be at least this many frames long (frames between UNDONE and UNDO, exclusive)
OVR_PIXCNT_THR  = 4         # (4) Thresh for RT_LumaPixelsDifferentCount, only pixel differences greater than this are counted.
OVR_PIXCNT_LIM  = 50        # (50)If RT_LumaPixelsDifferentCount(Thresh=OVR_PIXCNT_THR) greater than this then is OVERRIDDEN as false detection.
                            # Above OVR_ settings for detecting override where difference between undone/undo is too visible (ie not crud).
#
ScanAheadSecs   = 10 * 60   # Search ahead range in seconds
ChromaWeight    = 1.0/3.0   # (1.0/3.0) YUV Chroma Weighting, 0.0 -> 1.0
FPS             = 15.0      # Play speed for output script.
VERBOSITY       = 0         # (0) 0 to 3. Debug & logging verbosity.
########################################################################
# Chop off crud around outsides
GLOBAL CROP_L    = 128  # Crop Left
GLOBAL CROP_T    = 128  # Crop Top
GLOBAL CROP_R    = 328  # Crop Right (Including that thumbnail with the delayed UNDO and additional crap)
GLOBAL CROP_B    = 128  # Crop Bottom
########################################################################
# During Testing
GLOBAL CREATE    = True
GLOBAL DELETE_DB = True
########################################################################
GLOBAL PC709  = True
GLOBAL CROP_L = (CROP_L / 4) * 4    GLOBAL CROP_T = (CROP_T / 4) * 4
GLOBAL CROP_R = (CROP_R / 4) * 4    GLOBAL CROP_B = (CROP_B / 4) * 4
FSEL_TITLE="Select AVI files"
FSEL_DIR="."
FSEL_FILT="Avi files|*.avi"
FSEL_MULTI=True
AVIFILE_LIST = RT_FSelOpen(title=FSEL_TITLE,dir=FSEL_DIR,filt=FSEL_FILT,multi=FSEL_MULTI)
Assert(AVIFILE_LIST.IsString,"RT_FSelOpen: Error="+String(AVIFILE_LIST))
NFILES=RT_TxtQueryLines(AVIFILE_LIST)                                           # Query Number of lines in String ie number of files.
myName="Fsel_Eduardobedoya_Batch: "
LOG="Fsel_Eduardobedoya_Batch.Log"
RT_WriteFile(LOG,"%s\n",LOG,Append=False)

S=RT_String("THRESH = %f LUMATOL_SCALE=%f LUMATOL_ADD=%f\nMIN_EDITLEN=%d     OVR_PIXCNT_THR=%d       OVR_PIXCNT_LIM=%d",
    \ THRESH,LUMATOL_SCALE,LUMATOL_ADD,MIN_EDITLEN,OVR_PIXCNT_THR,OVR_PIXCNT_LIM)
RT_WriteFile(LOG,"%s",S,Append=True)
RT_DebugF("%s",S,name=myName)

S=RT_String("ScanAheadSecs=%d ChromaWeight=%f  OutFPS=%f",ScanAheadSecs,ChromaWeight,FPS)
RT_WriteFile(LOG,"%s",S,Append=True)
RT_DebugF("%s",S,name=myName)

S=RT_String("PC709=%s CROPPING=%d,%d,%d,%d",PC709,CROP_L,CROP_T,CROP_R,CROP_B)
RT_WriteFile(LOG,"%s",S,Append=True)
RT_DebugF("%s",S,name=myName)

GLOBAL Global_CrudMax   = 0.0
Global Global_PixCntMax = 0

Crud_S="""
    AMP=True
    PCTHRESH=@
    aviName=$@@$
    PC709=@@@
    Path=RT_FilenameSplit(AviName,3)
    Node=RT_FilenameSplit(AviName,4)
    CrudFrames = Path + $CrudInspect_Frames_$ + Node + $.TXT$
    Avisource(AviName)
    Crop(CROP_L,CROP_T,-CROP_R,-CROP_B)
    ConvertToYV12(matrix=(PC709)?$PC.709$:$PC.601$)
    NUMBERSCLIP=FrameSel(Cmd=CrudFrames,Ordered=True,SHOW=TRUE)
    NUMBERSCLIP=NUMBERSCLIP.CROP(0,0,20*10,1*20).POINTResize(20*10*2,1*20*2)
    NA=NUMBERSCLIP.SelectEven
    NB=NUMBERSCLIP.SelectODD
    FrameSel(Cmd=CrudFrames,Ordered=True)
    A=SelectEven
    B=SelectODD
    DELTA = Clipdelta(A,B,AMP)
    DELTA = DELTA.OVERLAY(NA,X=0,Y=DELTA.HEIGHT-NA.HEIGHT).OVERLAY(NB,X=DELTA.WIDTH-NB.WIDTH,Y=DELTA.HEIGHT-NA.HEIGHT)
    DELTA
    SC=$$$
        pc=RT_LumaPixelsDifferentCount(A,B)
        pct=RT_LumaPixelsDifferentCount(A,B,THRESH=PCTHRESH)
        ld=RT_LumaDifference(A,B)
        fd=RT_FrameDifference(A,B)
        S=RT_String($UNDO=%d]  LumaDif=%f  FrameDif=%f  LumaPixelsDifferent=%d  LumaPixelsDifferentByMoreThan_%d=%d$,current_frame,ld,fd,pc,PCTHRESH,pct)
        Subtitle(S,size=24,font=$Courier New$)
    $$$
    ScriptClip(SC)
    return Last

    # Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
    Function ClipDelta(clip clip1,clip clip2,bool $amp$,bool $show$) {
        amp=Default(amp,false)
        show=Default(show,false)
        c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
        c1=clip1.subtract(clip2)
        c1=(amp)?c1.levels(127,1.0,129,0,255):c1
        return (show)?c1.Merge(c2):c1
    }
"""

GSCript("""
    TOTSTART = RT_TimerHP
    For(i=0,NFILES-1) {
        START = RT_TimerHP
        FN=RT_TxtGetLine(AVIFILE_LIST,i)                                        # Filename of avi file i
        S=RT_String("\n%d/%d ] Processing '%s'\n",i+1,NFILES, FN)
        RT_DebugF(S,name=myName)
        RT_WriteFile(LOG,"%s",S,Append=True)

        DropUndo(FN,Crud_S,ScanAheadSecs,thresh=THRESH,Min_EditLen=MIN_EDITLEN,
            \ log=LOG,ChromaWeight=ChromaWeight,fps=FPS,
            \ ovr_pixcnt_thr=OVR_PIXCNT_THR,ovr_pixcnt_lim=OVR_PIXCNT_LIM,
            \ LumaTol_Scale=LUMATOL_SCALE,LumaTol_Add=LUMATOL_ADD,Verbosity=VERBOSITY)

        T = RT_TimerHP - START
        S=RT_String("%d/%d '%s'  Tot File Time = %.2f Seconds (%.2f Mins)",i+1,NFILES,FN, T,T/60.0)
        RT_DebugF(S,name=myName)
        RT_WriteFile(LOG,"%s",S,Append=True)
    }
    T = RT_TimerHP - TOTSTART
    S=RT_String("\nBATCH TOTAL Time = %.2f Seconds (%.2f Mins)\nGlobal CrudMax=%f\nGlobal MaxLumaPixelsDifferentBy_%d = %d",
        \ T,T/60.0,GLOBAL_CrudMax,OVR_PIXCNT_THR,Global_PixCntMax)
    RT_DebugF(S,name=myName)
    RT_WriteFile(LOG,"%s",S,Append=True)
    S=RT_String("\nDONE\n\n%s",S)
    S=RT_StrReplace(S,Chr(10),"\n")
""")


Return blankclip(length=24*60*60*24).Subtitle(S,Align=5,Y=100,lsp=0,Size=30)
EDITED:
__________________
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; 9th October 2014 at 12:01.
StainlessS is online now   Reply With Quote
Old 8th October 2014, 01:48   #67  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Part 2 of 2
Code:
Function DropUndo(String AviName,String Crud_S,Float "ScanAheadSecs",Float "THRESH",Int "Min_EditLen",
        \ String "Log",Float "ChromaWeight",float "fps",Int "ovr_pixcnt_thr",Int "ovr_pixcnt_lim",
        \ Float "LumaTol_Scale",Float "LumaTol_Add", Int "Verbosity") {
    myName="DropUndo: "
    ScanAheadSecs=Float(Default(ScanAheadSecs,10.0*60.0))
    THRESH=Float(Default(THRESH,0.02))
    MIN_EDITLEN=Default(MIN_EDITLEN,4)
    LOG = Default(LOG,"DropUndo.LOG")
    ChromaWeight = Float(Default(ChromaWeight,1.0/3.0))
    FPS = Float(Default(FPS,FPS))
    OVR_PIXCNT_THR=Default(OVR_PIXCNT_THR,4)
    OVR_PIXCNT_LIM=Default(OVR_PIXCNT_LIM,50)
    LumaTol_Scale = Float(Default(LumaTol_Scale,1.0))
    LumaTol_Add   = Float(Default(LumaTol_Add,0.0))
    VERBOSITY=Default(VERBOSITY,0)

    Assert(Exist(AviName),myName+AviName+" Does Not Exist")

    Avisource(AviName)
    ORG=Last

    Crop(CROP_L,CROP_T,-CROP_R,-CROP_B)                                           # Crop crud
    ConvertToYV12(Matrix=(PC709)?"PC.709":"PC.601")

    Assert(ScanAheadSecs>0.0,myName+"ScanAheadSecs Must be greater than zero")
    Assert(THRESH>0.0, myName+"THRESH Must be greater than zero")
    Assert(MIN_EDITLEN>0,myName+"Greater than zero please")
    Assert(ChromaWeight>=0.0 && ChromaWeight<=1.0,    myName+"ChromaWeight range 0.0 -> 1.0")
    Assert(OVR_PIXCNT_THR>=0 && OVR_PIXCNT_THR<=8,    myName+"OVR_PIXCNT_THR range 0 -> 8")
    Assert(OVR_PIXCNT_LIM>=0 && OVR_PIXCNT_LIM<=100,  myName+"OVR_PIXCNT_LIM range 0 -> 100")
    Assert(LumaTol_Scale>=1.0 && LumaTol_Scale<=2.0,  myName+"LUMATOL_SCALE range 1.0 -> 2.0")
    Assert(LumaTol_Add>=0.0 && LumaTol_Add<=1.0,      myName+"LUMATOL_ADD range 0.0 -> 1.0")
    Assert(VERBOSITY>=0 && VERBOSITY<=3,              myName+"VERBOSITY range 0 -> 3")

    Path = RT_FilenameSplit(AviName,3)                                            # Drive + Dir
    Node = RT_FilenameSplit(AviName,4)                                            # Name
    PathAndNode = Path+Node                                                       # Drive + Dir + Name
    CMDFrames=PathAndNode+"_Frames.TXT"
    Ranges=PathAndNode+"_Ranges.TXT"
    ScriptFile=Path+"_AVS_"+Node+"_SelectFrames.AVS"
    CrudScript = Path + "_CRUD_INSPECT_" + Node + ".AVS"
    CrudFrames = Path + "CrudInspect_Frames_" + Node + ".TXT"
    Fnd_S = RT_String("CROP_L\nCROP_T\nCROP_R\nCROP_B\n$\n@@@\n@@\n@\n")
    Rep_S = RT_String("%d\n%d\n%d\n%d\n%c\n%s\n%s\n%d",CROP_L,CROP_T,CROP_R,CROP_B,34,PC709,RT_GetFullPathName(AviName),OVR_PIXCNT_THR)
    Crud_S = RT_StrReplaceMulti(Crud_S,Fnd_S,Rep_S)

    ScanAheadFrames = Int(ScanAheadSecs*FrameRate)
    DB=PathAndNode+".DB"
    PREVDB=PathAndNode +  "_Prev.DB"
    NEXTDB=PathAndNode +  "_Next.DB"

    RT_FileDelete(CMDFrames)                                                       # Delete any existing frames file
    RT_FileDelete(Ranges)                                                          # Delete any existing Ranges file
    RT_FileDelete(CrudFrames)
    RT_FileDelete(CrudScript)

    ### TEMPLATE script
    FrameSel_Select="""
        Show=False                                                                      # Set True to show original Frame Number
        fn="%s"
        Avisource(fn)
        (Show) ? ScriptClip("Subtitle(String(current_frame))") : NOP
        PathAndNode="%s"
        CmdFrames=PathAndNode+"_Frames.txt"
        Ranges=PathAndNode+"_Ranges.txt"
        Ex=Exist(CmdFrames)
        (Ex) ? FrameSel_CmdReWrite(Ranges,cmd=CmdFrames,reject=False) : NOP             # Informational ONLY
        (Ex) ? FrameSel(cmd=CmdFrames,reject=False) : NOP
        Return Last.AssumeFPS(%f)
    """

    ###
    Select_S = FrameSel_Select
    Select_S = RT_StrReplaceDeep(RT_StrReplace(Select_S,Chr(9)," "),"  "," ")           # TAB and SPACE compact
    Select_S = RT_String(Select_S,AviName,PathAndNode,FPS)                              # Insert filenames

    FramesSearched  = 0
    CrudMax         = 0.0
    CrudMaxFrame    = -1
    PixCntMax       = 0
    PixCntMaxFrame  = -1
    Kept            = 0

    GSCript("""
        if(CREATE) {
            START = RT_TimerHP
            RT_QwikScanCreate(DB,prevdb="",nextdb=NEXTDB,debug=true)
            T= RT_TimerHP - START
            S = RT_String("QWIK Scan DBase creation = %.2f Secs (%.2f Mins)",T,T/60.0)
            RT_WriteFile(LOG,"%s",S,Append=True)
        }
        START = RT_TimerHP
        LastFrame=FrameCount-1
        RT_DebugF(" QWIK Scanning file ... Please Wait",name=myName)

        for(i=LastFrame,0,-1) {
            SKIP = False
            if(i > 0) {
                PreUndoDif = RT_FrameDifference(Last,Last,n=i,n2=i-1,ChromaWeight=ChromaWeight)
                FramesSearched = FramesSearched + 1
                if(PreUndoDif > 0.0) {
                    StartFrame = Max(i-ScanAheadFrames,0)
                    EndFrame   = (i - 1 - MIN_EDITLEN)

                    # We are looking for an UNDONE frame that is more similar to i frame than i-1.
                    # If i is an UNDO frame then UNDONE frame will be more similar to i than i-1, so LumaTol estimate will find it fast.
                    # Alternatively, if i is not an UNDO frame then LumaTol estimate will speed up NOT FINDING frame.
                    # If estimate greater than THRESH, then i could still be an UNDO frame just i-1 is quite a lot different to i frame, so we
                    # limit LumaTol to THRESH assuming well set for Crud max.
                    # Below two lines speed up whole script significantly (rather than just using THRESH setting for LumaTol).

                    # arg frame order IS SIGNIFICANT (we are matching to i frame, estimate is for i-1).
                    LumaTol = LumaTol_Scale * RT_QwikScanEstimateLumaTol(Last,Last,n=i,n2=i-1) + LumaTol_Add
                    LumaTol = (LumaTol>THRESH) ? THRESH : LumaTol

                    DifThresh = PreUndoDif*0.999999                              # We are looking for BETTER match, NOT equal

                    if(VERBOSITY>=1) {
                        S = RT_String("%5d]    NEWSEARCH: SearchStart=%d SearchEnd=%d Seeking FDif <= %E {LumaTol=%E}",
                                \ i,StartFrame,EndFrame,DifThresh,LumaTol)
                        RT_DebugF("%s",S,name=myName)
                        RT_WriteFile(LOG,"%s",S,Append=True)
                    }
                    For(j=StartFrame,EndFrame) {
                        MaxDistance =  EndFrame - j
                        if(VERBOSITY>=2) {
                            S = RT_String("             SEARCH: SearchStart=%d MaxDistance=%d",j,MaxDistance)
                            RT_DebugF("%s",S,name=myName)
                            RT_WriteFile(LOG,"%s",S,Append=True)
                        }
                        # XP=3, strictly better than, ie left most frame (first found, furthest from i).
                        # MaxDistance limits search to exclude MIN_EDITLEN frames.
                        Result=RT_QwikScan(Last,j,Last,i,DB,NEXTDB,lumatol=LumaTol,Flags=$04,fd=DifThresh,maxdistance=MaxDistance,XP=3)
                        if(Result>=0) { # Exit Condition succeeds
                            FramesSearched = FramesSearched + (QWKS_BM_FD_FRM-j+1)
                            if(VERBOSITY>=2) {
                                S = RT_String("              MATCH: Frame=%5d FrameDifference=%E ",QWKS_BM_FD_FRM,QWKS_BM_FD)
                                RT_DebugF("%s",S,name=myName)
                                RT_WriteFile(LOG,"%s",S,Append=True)
                            }
                            CrudPix=RT_LumaPixelsDifferentCount(Last,Last,n=i,n2=QWKS_BM_FD_FRM,Thresh=OVR_PIXCNT_THR)
                            FramesSearched = FramesSearched + 1
                            if(CrudPix <= OVR_PIXCNT_LIM) {
                                YCrudDif = RT_QwikScanEstimateLumaTol(Last,Last,n=i,n2=QWKS_BM_FD_FRM)   # Crud measured by LumaTol estimate
                                FramesSearched = FramesSearched + 1
                                if(YCrudDif > CrudMax) {
                                    CrudMax         = YCrudDif
                                    CrudMaxFrame    = i
                                }
                                if(CrudPix > PixCntMax) {
                                    PixCntMax = CrudPix
                                    PixCntMaxFrame = i
                                }
                                RT_WriteFile(CrudFrames,"%d\n%d",QWKS_BM_FD_FRM,i,Append=True)
                                if(VERBOSITY==0) {
                                    S=RT_String("%5d] UNDO: Matched %d -> %d : Skip %d to %d : (FDif=%E : LumaPixelsDifferentBy_%d = %d)",
                                        \ i,QWKS_BM_FD_FRM,i,QWKS_BM_FD_FRM+1,i,QWKS_BM_FD,OVR_PIXCNT_THR,CrudPix)
                                } Else {
                                    S=RT_String("               UNDO: Matched %d -> %d : Skip %d to %d : (FDif=%E : LumaPixelsDifferentBy_%d = %d)",
                                    \ QWKS_BM_FD_FRM,i,QWKS_BM_FD_FRM+1,i,QWKS_BM_FD,OVR_PIXCNT_THR,CrudPix)
                                }
                                RT_DebugF("%s",S,name=myName)
                                RT_WriteFile(LOG,"%s",S,Append=True)
                                i = QWKS_BM_FD_FRM                                      # Skip edited Frames up to and including UNDO frame
                                j = EndFrame                                            # Break
                            } Else {
                                if(VERBOSITY>=2){
                                    S=RT_String("           OVERRIDE: LumaPixelsDifferentBy_%d = %d (I -> Matched Frame)",OVR_PIXCNT_THR,CrudPix)
                                    RT_DebugF("%s",S,name=myName)
                                    RT_WriteFile(LOG,"%s",S,Append=True)
                                }
                                j = QWKS_BM_FD_FRM                                      # Continue search
                            }
                        } Else { # Result < 0, Exit condition fails
                            FramesSearched = FramesSearched + MaxDistance + 1           # Searched full extent
                            if(VERBOSITY>=3) {
                                if(QWKS_BM_FLAGS!=0) {                                  # Got a Best Match Only
                                    S = RT_String("          NOT FOUND: Best Match Frame=%5d FDif=%E",QWKS_BM_FD_FRM,QWKS_BM_FD)
                                } Else {                                                # Did not even get a Best match
                                    S = RT_String("          NOT FOUND: No Best Match:")
                                }
                                RT_DebugF("%s",S,name=myName)
                                RT_WriteFile(LOG,"%s",S,Append=True)
                            }
                            j = EndFrame                                                # Break
                        }
                    }      # End for j
                } Else {   # PreUndoDif <= 0.0
                    if(VERBOSITY>=2) {
                        d = i-1
                        for(k=d-1,0,-1) {
                            Dif = RT_FrameDifference(Last,Last,n=i,n2=k,ChromaWeight=ChromaWeight)
                            FramesSearched = FramesSearched + 1
                            if(Dif == 0.0) {
                                d = k
                            } Else {
                                k = - 1
                            }
                        }
                        S=RT_String("%5d]    IDENTICAL: Frames %d to %d : Skipping Frames %d to %d",i,d,i,d+1,i)
                        RT_DebugF("%s",S,name=myName)
                        RT_WriteFile(LOG,"%s",S,Append=True)
                        i = d+1     # Retry at d
                    }
                    SKIP = True # Dont write i
                }
            } # i == 0
            if(!SKIP || i==0) {
                if(VERBOSITY>=3) {
                    if(i==0)    {S=RT_String("%5d]      WRITING: Frame",i) }
                    Else        {S=RT_String("            WRITING: Frame") }
                    RT_DebugF("%s",S,name=myName)
                    RT_WriteFile(LOG,"%s",S,Append=True)
                }
                RT_WriteFile(CMDFrames,"%d",i,Append=True)
                Kept = Kept + 1
            }
        }

    RT_WriteFile(ScriptFile,"%s",Select_S)
    RT_WriteFile(CrudScript,"%s",Crud_S)
    (DELETE_DB) ? RT_FileDelete(DB)     : NOP
    (DELETE_DB) ? RT_FileDelete(NEXTDB) : NOP
    T = RT_TimerHP - START
    FT=FrameCount / FrameRate
    S=RT_String("\nKept %d of %d frames [%dx%d %.2f secs (%.2f Mins) @ %.2f FPS]",Kept, FrameCount,ORG.Width,ORG.Height,FT,FT/60.0,FrameRate)
    RT_DebugF(S,name=myName)
    RT_WriteFile(LOG,"%s",S,Append=True)
    S=RT_String("File Max Successful CrudMax = %E CrudMaxFrame=%d",CrudMax,CrudMaxFrame)
    RT_DebugF(S,name=myName)
    RT_WriteFile(LOG,"%s",S,Append=True)
    S=RT_String("File Max Successful LumaPixelsDifferentBy_%d = %d @ Frame = %d",ovr_pixcnt_thr,PixCntMax,PixCntMaxFrame)
    RT_DebugF(S,name=myName)
    RT_WriteFile(LOG,"%s",S,Append=True)
    S=RT_String("QWIK SCAN %.2f Secs (%.2f Mins) InFPS=%.2f OutFPS=%.2f FramesSearched=%d FramesSearchedFPS=%.2f",
            \ T,T/60.0,FrameCount/T,Kept/T,FramesSearched,FramesSearched/T)
    RT_DebugF(S,name=myName)
    RT_WriteFile(LOG,"%s",S,Append=True)
    Global Global_CrudMax   = Max(Global_CrudMax,CrudMax)
    Global Global_PixCntMax = Max(Global_PixCntMax,PixCntMax)
    """)
    Return 0
}
EDITED: Minor mods and a little tinkering, zip updated.

Only tested on your most recent clip without the cursor.
Sorry bout the wait, sick as a parrot of seeing your lovely artwork, gets a little tired after about 200+ processings.
Think it works pretty good and quite fast too.

Generates the output processing avs for each input clip and also generates a 'crud viewer' script so you can judge settings.

Here: script in zip: LINK REMOVED

And incase you do not still have the original clip without cursor, here tis: http://www.mediafire.com/download/9v...out+cursor.avi
EDIT: TechSmith codec version, needs conversion to compressed RGB before script use, as in earlier posts.

Good luck.
__________________
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; 17th December 2014 at 21:44.
StainlessS is online now   Reply With Quote
Old 8th October 2014, 02:22   #68  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Did this on Core Duo 2.4GHz whilst on-line and Antivirus running, VERBOSITY=0 (Too long for previous post).
Code:
Fsel_Eduardobedoya_Batch.Log
THRESH = 0.010000 LUMATOL_SCALE=1.000000 LUMATOL_ADD=0.000000
MIN_EDITLEN=4     OVR_PIXCNT_THR=4       OVR_PIXCNT_LIM=50
ScanAheadSecs=600 ChromaWeight=0.333333  OutFPS=15.000000
PC709=True CROPPING=128,128,328,128

1/1 ] Processing 'D:\ED\Last capture without cursor.avi.AVI'
QWIK Scan DBase creation = 94.49 Secs (1.57 Mins)
 2124] UNDO: Matched 2095 -> 2124 : Skip 2096 to 2124 : (FDif=6.532177E-004 : LumaPixelsDifferentBy_4 = 0)
 2085] UNDO: Matched 2073 -> 2085 : Skip 2074 to 2085 : (FDif=9.394840E-006 : LumaPixelsDifferentBy_4 = 0)
 2072] UNDO: Matched 1992 -> 2072 : Skip 1993 to 2072 : (FDif=1.100854E-003 : LumaPixelsDifferentBy_4 = 9)
 1984] UNDO: Matched 1957 -> 1984 : Skip 1958 to 1984 : (FDif=2.155287E-004 : LumaPixelsDifferentBy_4 = 4)
 1951] UNDO: Matched 1923 -> 1951 : Skip 1924 to 1951 : (FDif=4.327153E-004 : LumaPixelsDifferentBy_4 = 2)
 1900] UNDO: Matched 1816 -> 1900 : Skip 1817 to 1900 : (FDif=2.470290E-003 : LumaPixelsDifferentBy_4 = 14)
 1809] UNDO: Matched 1784 -> 1809 : Skip 1785 to 1809 : (FDif=2.906874E-004 : LumaPixelsDifferentBy_4 = 1)
 1768] UNDO: Matched 1727 -> 1768 : Skip 1728 to 1768 : (FDif=9.030099E-004 : LumaPixelsDifferentBy_4 = 7)
 1716] UNDO: Matched 1693 -> 1716 : Skip 1694 to 1716 : (FDif=8.908519E-004 : LumaPixelsDifferentBy_4 = 4)
 1643] UNDO: Matched 1608 -> 1643 : Skip 1609 to 1643 : (FDif=2.812926E-004 : LumaPixelsDifferentBy_4 = 0)
 1588] UNDO: Matched 1553 -> 1588 : Skip 1554 to 1588 : (FDif=2.917927E-004 : LumaPixelsDifferentBy_4 = 0)
 1431] UNDO: Matched 1426 -> 1431 : Skip 1427 to 1431 : (FDif=1.199224E-004 : LumaPixelsDifferentBy_4 = 1)
 1411] UNDO: Matched 1391 -> 1411 : Skip 1392 to 1411 : (FDif=4.951633E-004 : LumaPixelsDifferentBy_4 = 0)
 1309] UNDO: Matched 1259 -> 1309 : Skip 1260 to 1309 : (FDif=4.758210E-004 : LumaPixelsDifferentBy_4 = 1)
 1219] UNDO: Matched 1186 -> 1219 : Skip 1187 to 1219 : (FDif=2.571976E-003 : LumaPixelsDifferentBy_4 = 11)
 1149] UNDO: Matched 1112 -> 1149 : Skip 1113 to 1149 : (FDif=4.598498E-003 : LumaPixelsDifferentBy_4 = 13)
 1048] UNDO: Matched 1039 -> 1048 : Skip 1040 to 1048 : (FDif=9.947477E-006 : LumaPixelsDifferentBy_4 = 0)
  985] UNDO: Matched 938 -> 985 : Skip 939 to 985 : (FDif=6.108304E-003 : LumaPixelsDifferentBy_4 = 24)
  928] UNDO: Matched 914 -> 928 : Skip 915 to 928 : (FDif=2.305052E-003 : LumaPixelsDifferentBy_4 = 9)
  908] UNDO: Matched 870 -> 908 : Skip 871 to 908 : (FDif=2.127102E-003 : LumaPixelsDifferentBy_4 = 8)
  850] UNDO: Matched 828 -> 850 : Skip 829 to 850 : (FDif=3.548486E-003 : LumaPixelsDifferentBy_4 = 12)
  807] UNDO: Matched 713 -> 807 : Skip 714 to 807 : (FDif=3.715935E-003 : LumaPixelsDifferentBy_4 = 20)
  668] UNDO: Matched 612 -> 668 : Skip 613 to 668 : (FDif=7.792190E-005 : LumaPixelsDifferentBy_4 = 1)
  588] UNDO: Matched 482 -> 588 : Skip 483 to 588 : (FDif=2.116602E-004 : LumaPixelsDifferentBy_4 = 0)
  460] UNDO: Matched 420 -> 460 : Skip 421 to 460 : (FDif=3.868463E-005 : LumaPixelsDifferentBy_4 = 0)
  390] UNDO: Matched 370 -> 390 : Skip 371 to 390 : (FDif=3.039507E-005 : LumaPixelsDifferentBy_4 = 0)
  368] UNDO: Matched 276 -> 368 : Skip 277 to 368 : (FDif=9.245627E-004 : LumaPixelsDifferentBy_4 = 3)
  205] UNDO: Matched 117 -> 205 : Skip 118 to 205 : (FDif=5.156109E-004 : LumaPixelsDifferentBy_4 = 1)
   65] UNDO: Matched 0 -> 65 : Skip 1 to 65 : (FDif=1.008011E-003 : LumaPixelsDifferentBy_4 = 2)

Kept 410 of 2150 frames [1920x1080 143.33 secs (2.39 Mins) @ 15.00 FPS]
File Max Successful CrudMax = 2.074689E-003 CrudMaxFrame=1149
File Max Successful LumaPixelsDifferentBy_4 = 24 @ Frame = 985
QWIK SCAN 107.41 Secs (1.79 Mins) InFPS=20.02 OutFPS=3.82 FramesSearched=424888 FramesSearchedFPS=3955.89 :)
1/1 'D:\ED\Last capture without cursor.avi.AVI'  Tot File Time = 202.10 Seconds (3.37 Mins)

BATCH TOTAL Time = 202.10 Seconds (3.37 Mins)
Global CrudMax=0.002075
Global MaxLumaPixelsDifferentBy_4 = 24
EDIT: Redone without Antivirus, with updated script.
EDIT: Requires latest RT_Stats v1.43 (posted earlier today) for RT_QwikScanEstimateLumaTol().

EDIT: Will be quicker if you move the canvas from time to time, and the more you crop would also increase speed but have to ensure
edits are central.
__________________
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; 9th October 2014 at 12:10.
StainlessS is online now   Reply With Quote
Old 24th October 2014, 01:28   #69  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks StainlessS

Thanks StainlessS, very much, I've been very occupied, I have not had time even to paint,
I will check it out ASAP, I dont remember very well how I used to use Avisynth, and the scripts in batch, but I wil try to get back everything, do I have to paste those two scripts into a single one? or are two batchs steps?

please tell me, was it easier to delete the duplicated frames in a video recorded without cursor? was there still a cloudy mood in the painting strokes? was there still inequality between undo and redo images in the painting?
what porcentage of the duplicated frames were accuracy deleted by the script?

Thanks advanced man, I will post my test ASAP. thanks

Last edited by eduardobedoya; 24th October 2014 at 01:31.
eduardobedoya is offline   Reply With Quote
Old 26th October 2014, 04:57   #70  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
eduardobedoya,
The two posts were only because the script would not fit in one post (16kb limit on D9 user forum, [20kb in devs]).
Just download the zip, is already a single avisynth script.

Quote:
please tell me, was it easier to delete the duplicated frames in a video recorded without cursor?
Absolutely, but still difficult. (thankyou for that, I would still be banging my head against the wall if you had not removed cursor).

Quote:
was there still inequality between undo and redo images in the painting?
Yes, The provided script also creates a Crud inspection script, ie a script that shows the "inequality" so you can judge if it got it wrong.
(A solid lump of 'crud' might signify that it got it wrong).
EDIT: You can change AMP=True to AMP=False in crud inspection script to view crud without amplification.
EDIT: Crud Inspection script, solid lump of crud might indicate bad detection and wrong UNDO, viewing result
script would show if any detection missed (UNDO not removed).

"what porcentage of the duplicated frames were accuracy deleted by the script?",

Well tis my belief that 100% were accurately deleted, and none deleted in error, I watched though entire clip at 1 FPS (without blinking, [mostly]
and I could not see any errors at all).

I will not be doing any further work on this I am currenly otherwise occupied doing other stuff, sorry.
EDIT: Its done and working with user configurable settings and so is pretty much complete, only other mods would be tinkering
with output formatted logs etc.

Hope you are happy with results and appologies for the obscene amount of time it took to arrive.
be gud.

EDIT: There were a number of frames that had only a few (grouped) pixels changed, I could not tell whether these were intentional
edits or more mistakes in the paint program, if they were not within an UNDONE/UNDO region they are left in as they also affect all
following frames.
__________________
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; 29th October 2014 at 21:04.
StainlessS is online now   Reply With Quote
Old 15th November 2014, 20:15   #71  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks StainlessS, Ill check it out asap

Thanks man, I will try it asap. Thanks again.

EDIT: jajaja. I didn't cut my ear., just now Im having time to check this and remember how to use your radical script.
Yes I still have the without cursor video, testing it as soon as I get it back how to do it.
Thanks man, programmers are digital engineers, you rule.

Last edited by eduardobedoya; 6th December 2014 at 21:39.
eduardobedoya is offline   Reply With Quote
Old 7th December 2014, 23:05   #72  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
StainlessS --Eureka--

Hi StainlessS
Finally I tested it, it worked like a charm

First I converted tsc2 codec into UtVideo RGB VCM
then I run the Second batch

here I post the Second batch log...

Code:
Fsel_Eduardobedoya_Batch.Log
THRESH = 0.010000 LUMATOL_SCALE=1.000000 LUMATOL_ADD=0.000000
MIN_EDITLEN=4     OVR_PIXCNT_THR=4       OVR_PIXCNT_LIM=50
ScanAheadSecs=600 ChromaWeight=0.333333  OutFPS=15.000000
PC709=True CROPPING=128,128,328,128

1/1 ] Processing 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Last capture without cursor UtVideo RGB VCM.avi'
QWIK Scan DBase creation = 74.33 Secs (1.24 Mins)
 2124] UNDO: Matched 2095 -> 2124 : Skip 2096 to 2124 : (FDif=6.504545E-004 : LumaPixelsDifferentBy_4 = 1)
 2085] UNDO: Matched 2073 -> 2085 : Skip 2074 to 2085 : (FDif=9.947477E-006 : LumaPixelsDifferentBy_4 = 0)
 2072] UNDO: Matched 1992 -> 2072 : Skip 1993 to 2072 : (FDif=1.087038E-003 : LumaPixelsDifferentBy_4 = 9)
 1984] UNDO: Matched 1957 -> 1984 : Skip 1958 to 1984 : (FDif=2.133181E-004 : LumaPixelsDifferentBy_4 = 5)
 1951] UNDO: Matched 1923 -> 1951 : Skip 1924 to 1951 : (FDif=4.238731E-004 : LumaPixelsDifferentBy_4 = 4)
 1900] UNDO: Matched 1816 -> 1900 : Skip 1817 to 1900 : (FDif=2.460895E-003 : LumaPixelsDifferentBy_4 = 12)
 1809] UNDO: Matched 1784 -> 1809 : Skip 1785 to 1809 : (FDif=2.835031E-004 : LumaPixelsDifferentBy_4 = 1)
 1768] UNDO: Matched 1727 -> 1768 : Skip 1728 to 1768 : (FDif=9.063257E-004 : LumaPixelsDifferentBy_4 = 9)
 1716] UNDO: Matched 1693 -> 1716 : Skip 1694 to 1716 : (FDif=8.842202E-004 : LumaPixelsDifferentBy_4 = 6)
 1643] UNDO: Matched 1608 -> 1643 : Skip 1609 to 1643 : (FDif=2.906874E-004 : LumaPixelsDifferentBy_4 = 0)
 1588] UNDO: Matched 1553 -> 1588 : Skip 1554 to 1588 : (FDif=2.951085E-004 : LumaPixelsDifferentBy_4 = 0)
 1431] UNDO: Matched 1426 -> 1431 : Skip 1427 to 1431 : (FDif=1.127381E-004 : LumaPixelsDifferentBy_4 = 1)
 1411] UNDO: Matched 1391 -> 1411 : Skip 1392 to 1411 : (FDif=4.973739E-004 : LumaPixelsDifferentBy_4 = 0)
 1309] UNDO: Matched 1259 -> 1309 : Skip 1260 to 1309 : (FDif=4.835579E-004 : LumaPixelsDifferentBy_4 = 1)
 1219] UNDO: Matched 1186 -> 1219 : Skip 1187 to 1219 : (FDif=2.550423E-003 : LumaPixelsDifferentBy_4 = 10)
 1149] UNDO: Matched 1112 -> 1149 : Skip 1113 to 1149 : (FDif=4.566997E-003 : LumaPixelsDifferentBy_4 = 14)
 1048] UNDO: Matched 1039 -> 1048 : Skip 1040 to 1048 : (FDif=9.394840E-006 : LumaPixelsDifferentBy_4 = 0)
  985] UNDO: Matched 938 -> 985 : Skip 939 to 985 : (FDif=6.128199E-003 : LumaPixelsDifferentBy_4 = 21)
  928] UNDO: Matched 914 -> 928 : Skip 915 to 928 : (FDif=2.302288E-003 : LumaPixelsDifferentBy_4 = 7)
  908] UNDO: Matched 870 -> 908 : Skip 871 to 908 : (FDif=2.147550E-003 : LumaPixelsDifferentBy_4 = 6)
  850] UNDO: Matched 828 -> 850 : Skip 829 to 850 : (FDif=3.540197E-003 : LumaPixelsDifferentBy_4 = 13)
  807] UNDO: Matched 713 -> 807 : Skip 714 to 807 : (FDif=3.668409E-003 : LumaPixelsDifferentBy_4 = 22)
  668] UNDO: Matched 612 -> 668 : Skip 613 to 668 : (FDif=8.234301E-005 : LumaPixelsDifferentBy_4 = 1)
  588] UNDO: Matched 482 -> 588 : Skip 483 to 588 : (FDif=2.149760E-004 : LumaPixelsDifferentBy_4 = 0)
  460] UNDO: Matched 420 -> 460 : Skip 421 to 460 : (FDif=3.757936E-005 : LumaPixelsDifferentBy_4 = 0)
  390] UNDO: Matched 370 -> 390 : Skip 371 to 390 : (FDif=2.818452E-005 : LumaPixelsDifferentBy_4 = 0)
  368] UNDO: Matched 276 -> 368 : Skip 277 to 368 : (FDif=9.300892E-004 : LumaPixelsDifferentBy_4 = 2)
  205] UNDO: Matched 117 -> 205 : Skip 118 to 205 : (FDif=5.106372E-004 : LumaPixelsDifferentBy_4 = 1)
   65] UNDO: Matched 0 -> 65 : Skip 1 to 65 : (FDif=9.925372E-004 : LumaPixelsDifferentBy_4 = 2)

Kept 410 of 2150 frames [1920x1080 143.33 secs (2.39 Mins) @ 15.00 FPS]
File Max Successful CrudMax = 2.110001E-003 CrudMaxFrame=1900
File Max Successful LumaPixelsDifferentBy_4 = 22 @ Frame = 807
QWIK SCAN 41.09 Secs (0.68 Mins) InFPS=52.33 OutFPS=9.98 FramesSearched=424875 FramesSearchedFPS=10341.13
1/1 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Last capture without cursor UtVideo RGB VCM.avi'  Tot File Time = 115.90 Seconds (1.93 Mins)

BATCH TOTAL Time = 115.90 Seconds (1.93 Mins)
Global CrudMax=0.002110
Global MaxLumaPixelsDifferentBy_4 = 22
Then I copied the avs files and run the third batch
and it get it done, just in the third batch black window, it says...
Dub: Input <decompression> format is: YUV420.
Dub: Output <decompression> format is: RGB888.
Ending Operation

It does mean that the selecting frame process is runing in YUV420 color mode? The source file was UtVideo RGB, what does it mean?
Is that is so, has YUV color mode got enought color information to detect subtle color differences between strokes in the selecting frame process?
by the way, I used to notice the difference between RGB and YUV in UtVideos in the version 13.3.1 but now in the version 14.2.0 I really cant tell the difference.
So, now what is the difference between RGB and YUV in Utvideo beside the filesize??? Do you have please any link about last UtVideo upgrades?

Guess that will be all, Great script StainlessS, thanks man.
I will perform further tests with larger clips, and post any feedback if it could be usefull to you. Thanks once again, thanks for all.

Last edited by eduardobedoya; 8th December 2014 at 01:22.
eduardobedoya is offline   Reply With Quote
Old 8th December 2014, 04:02   #73  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Copy ONLY the files beginning with "_AVS_" and not the "_CRUD_INSPECT_" files, they should be first in directory listing when sorted alphabetic ascending,
copy to the output batch directory.

Here, is output script for your test clip, it outputs whatever the source clip is, should be RGB. (The "_CRUD_INSPECT_" scripts output YV12, hence your problem, I think).

Code:
 Show=False # Set True to show original Frame Number
 fn="D:\ED\Last capture without cursor.avi.AVI"
 Avisource(fn)
 (Show) ? ScriptClip("Subtitle(String(current_frame))") : NOP
 PathAndNode="D:\ED\Last capture without cursor.avi"
 CmdFrames=PathAndNode+"_Frames.txt"
 Ranges=PathAndNode+"_Ranges.txt"
 Ex=Exist(CmdFrames)
 (Ex) ? FrameSel_CmdReWrite(Ranges,cmd=CmdFrames,reject=False) : NOP # Informational ONLY
 (Ex) ? FrameSel(cmd=CmdFrames,reject=False) : NOP
 Return Last.AssumeFPS(15.000000)
I use UT_Video 13.3.1, I think later versions demand more recent processor and as I use some old Pentium 4's I will not be updating to more recent versions and dont know what if any differences there are from previous.

Do search on-site for latest version, not hard to find
__________________
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; 8th December 2014 at 04:05.
StainlessS is online now   Reply With Quote
Old 8th December 2014, 16:02   #74  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks StainlessS - I keep testing

when I copy both the "_AVS_" and the "_CRUD_" files and render the third batch, it created two videos one with all the selected frames, an another with a grey screen with some kinda sparkles instead of the strokes and some text data. From now on I only copy the "_AVS_"

The source for the second batch file was UtVideo RGB, I have try to use UtVideo YUV420 instead, since I dont longer see any visual difference between RGB and YUV420 in UtVideo codec v14.
But I have found that using YUV420 video as source will produce unwanted results, almost does not drop any frame. So I keep using RGB.


I see that the Fsel_Eduardobedoya_Batch_Sept.avs is not editable, I guess is a full road script, Ive tested it with other shortlenght videos
I mean, in the previous video (the one with the subtle hair strokes) the script performed with great accuracy,
but perhaps by looking at different scanarios you could find the most accurate "tunning" for the script in order to work in all scenarios, hope I may not been abusing of your help,
I send you a 1:50min clip that had 85% accuracy
https://www.sendspace.com/file/50owfa

Thanks again man, it looks very promising for testing in 30min lenght videos.

PD: Here is the avs batch script Log of this last 1:50min clip

Quote:
Fsel_Eduardobedoya_Batch.Log
THRESH = 0.010000 LUMATOL_SCALE=1.000000 LUMATOL_ADD=0.000000
MIN_EDITLEN=4 OVR_PIXCNT_THR=4 OVR_PIXCNT_LIM=50
ScanAheadSecs=600 ChromaWeight=0.333333 OutFPS=15.000000
PC709=True CROPPING=128,128,328,128

1/1 ] Processing 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Test 00 UtVideo RGB VCM.avi'
QWIK Scan DBase creation = 47.41 Secs (0.79 Mins)
1649] UNDO: Matched 1636 -> 1649 : Skip 1637 to 1649 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
1583] UNDO: Matched 1542 -> 1583 : Skip 1543 to 1583 : (FDif=5.426902E-004 : LumaPixelsDifferentBy_4 = 3)
1498] UNDO: Matched 1391 -> 1498 : Skip 1392 to 1498 : (FDif=3.659014E-003 : LumaPixelsDifferentBy_4 = 10)
1327] UNDO: Matched 1278 -> 1327 : Skip 1279 to 1327 : (FDif=5.140082E-003 : LumaPixelsDifferentBy_4 = 19)
1249] UNDO: Matched 1234 -> 1249 : Skip 1235 to 1249 : (FDif=5.526376E-006 : LumaPixelsDifferentBy_4 = 0)
1217] UNDO: Matched 1204 -> 1217 : Skip 1205 to 1217 : (FDif=1.105275E-005 : LumaPixelsDifferentBy_4 = 0)
1190] UNDO: Matched 1121 -> 1190 : Skip 1122 to 1190 : (FDif=4.747157E-004 : LumaPixelsDifferentBy_4 = 5)
1039] UNDO: Matched 1029 -> 1039 : Skip 1030 to 1039 : (FDif=8.179037E-005 : LumaPixelsDifferentBy_4 = 1)
957] UNDO: Matched 951 -> 957 : Skip 952 to 957 : (FDif=1.160539E-005 : LumaPixelsDifferentBy_4 = 0)
814] UNDO: Matched 805 -> 814 : Skip 806 to 814 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
758] UNDO: Matched 738 -> 758 : Skip 739 to 758 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
736] UNDO: Matched 703 -> 736 : Skip 704 to 736 : (FDif=6.405070E-004 : LumaPixelsDifferentBy_4 = 2)
678] UNDO: Matched 673 -> 678 : Skip 674 to 678 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
609] UNDO: Matched 557 -> 609 : Skip 558 to 609 : (FDif=3.404801E-003 : LumaPixelsDifferentBy_4 = 10)
518] UNDO: Matched 469 -> 518 : Skip 470 to 518 : (FDif=4.070729E-003 : LumaPixelsDifferentBy_4 = 14)
432] UNDO: Matched 418 -> 432 : Skip 419 to 432 : (FDif=8.276301E-003 : LumaPixelsDifferentBy_4 = 38)
395] UNDO: Matched 388 -> 395 : Skip 389 to 395 : (FDif=2.100023E-005 : LumaPixelsDifferentBy_4 = 0)
359] UNDO: Matched 324 -> 359 : Skip 325 to 359 : (FDif=6.114936E-003 : LumaPixelsDifferentBy_4 = 17)
312] UNDO: Matched 303 -> 312 : Skip 304 to 312 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
212] UNDO: Matched 207 -> 212 : Skip 208 to 212 : (FDif=1.050011E-005 : LumaPixelsDifferentBy_4 = 0)
205] UNDO: Matched 198 -> 205 : Skip 199 to 205 : (FDif=4.973739E-006 : LumaPixelsDifferentBy_4 = 0)
164] UNDO: Matched 111 -> 164 : Skip 112 to 164 : (FDif=1.195687E-002 : LumaPixelsDifferentBy_4 = 37)
95] UNDO: Matched 88 -> 95 : Skip 89 to 95 : (FDif=2.763188E-006 : LumaPixelsDifferentBy_4 = 0)
23] UNDO: Matched 0 -> 23 : Skip 1 to 23 : (FDif=7.456187E-003 : LumaPixelsDifferentBy_4 = 21)

Kept 733 of 1650 frames [1920x1080 110.00 secs (1.83 Mins) @ 15.00 FPS]
File Max Successful CrudMax = 5.654124E-003 CrudMaxFrame=432
File Max Successful LumaPixelsDifferentBy_4 = 38 @ Frame = 432
QWIK SCAN 135.26 Secs (2.25 Mins) InFPS=12.20 OutFPS=5.42 FramesSearched=557865 FramesSearchedFPS=4124.47
1/1 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Test 00 UtVideo RGB VCM.avi' Tot File Time = 183.12 Seconds (3.05 Mins)

BATCH TOTAL Time = 183.12 Seconds (3.05 Mins)
Global CrudMax=0.005654
Global MaxLumaPixelsDifferentBy_4 = 38
and here are the Debug View Logs of the same clip

second batch
Quote:
00000001 0.00000000 [8224] Fsel_Eduardobedoya_Batch: THRESH = 0.010000 LUMATOL_SCALE=1.000000 LUMATOL_ADD=0.000000
00000002 0.00003637 [8224] Fsel_Eduardobedoya_Batch: MIN_EDITLEN=4 OVR_PIXCNT_THR=4 OVR_PIXCNT_LIM=50
00000003 0.00064265 [8224] Fsel_Eduardobedoya_Batch: ScanAheadSecs=600 ChromaWeight=0.333333 OutFPS=15.000000
00000004 0.00122880 [8224] Fsel_Eduardobedoya_Batch: PC709=True CROPPING=128,128,328,128
00000005 0.00385271 [8224] Fsel_Eduardobedoya_Batch:
00000006 0.00388379 [8224] Fsel_Eduardobedoya_Batch: 1/1 ] Processing 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Test 00 UtVideo RGB VCM.avi'
00000007 0.00391097 [8224] Fsel_Eduardobedoya_Batch:
00000008 0.08910672 [8224]
00000009 0.08910672 [8224] RT_QwikScanCreate: RT_QwikScanCreateDB() by StainlessS
00000010 0.08913533 [8224] RT_QwikScanCreate: DBaseAlloc DB
00000011 0.08966392 [8224] RT_QwikScanCreate: DBaseAlloc NextDB
00000012 0.09306854 [8224] RT_QwikScanCreate: Filling DB with FingerPrint data (Will take some time)
00000013 7.54825926 [8224] RT_QwikScanCreate: record(256) 15.5%
00000014 15.15915012 [8224] RT_QwikScanCreate: record(512) 31.0%
00000015 22.56482887 [8224] RT_QwikScanCreate: record(768) 46.5%
00000016 29.82000160 [8224] RT_QwikScanCreate: record(1024) 62.1%
00000017 37.05014801 [8224] RT_QwikScanCreate: record(1280) 77.6%
00000018 44.28882217 [8224] RT_QwikScanCreate: record(1536) 93.1%
00000019 47.48595428 [8224] RT_QwikScanCreate: record(1650) 100.0%
00000020 47.48601532 [8224] RT_QwikScanCreate: Filling NextDB with data
00000021 47.48653793 [8224] RT_QwikScanCreate: record(1536) 6.9%
00000022 47.48751450 [8224] RT_QwikScanCreate: record(1280) 22.4%
00000023 47.48849869 [8224] RT_QwikScanCreate: record(1024) 37.9%
00000024 47.48946381 [8224] RT_QwikScanCreate: record(768) 53.5%
00000025 47.49042892 [8224] RT_QwikScanCreate: record(512) 69.0%
00000026 47.49139023 [8224] RT_QwikScanCreate: record(256) 84.5%
00000027 47.49236298 [8224] RT_QwikScanCreate: record(0) 100.0%
00000028 47.49265671 [8224] RT_QwikScanCreate: Total time = 47.41 seconds (0.79 mins)
00000029 47.49498367 [8224] DropUndo: QWIK Scanning file ... Please Wait
00000030 47.54751968 [8224] DropUndo: 1649] UNDO: Matched 1636 -> 1649 : Skip 1637 to 1649 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
00000031 52.80663681 [8224] DropUndo: 1583] UNDO: Matched 1542 -> 1583 : Skip 1543 to 1583 : (FDif=5.426902E-004 : LumaPixelsDifferentBy_4 = 3)
00000032 54.31874847 [8224] DropUndo: 1498] UNDO: Matched 1391 -> 1498 : Skip 1392 to 1498 : (FDif=3.659014E-003 : LumaPixelsDifferentBy_4 = 10)
00000033 55.81215286 [8224] DropUndo: 1327] UNDO: Matched 1278 -> 1327 : Skip 1279 to 1327 : (FDif=5.140082E-003 : LumaPixelsDifferentBy_4 = 19)
00000034 56.89404297 [8224] DropUndo: 1249] UNDO: Matched 1234 -> 1249 : Skip 1235 to 1249 : (FDif=5.526376E-006 : LumaPixelsDifferentBy_4 = 0)
00000035 57.94061279 [8224] DropUndo: 1217] UNDO: Matched 1204 -> 1217 : Skip 1205 to 1217 : (FDif=1.105275E-005 : LumaPixelsDifferentBy_4 = 0)
00000036 59.25577927 [8224] DropUndo: 1190] UNDO: Matched 1121 -> 1190 : Skip 1122 to 1190 : (FDif=4.747157E-004 : LumaPixelsDifferentBy_4 = 5)
00000037 126.53381348 [8224] DropUndo: 1039] UNDO: Matched 1029 -> 1039 : Skip 1030 to 1039 : (FDif=8.179037E-005 : LumaPixelsDifferentBy_4 = 1)
00000038 150.00593567 [8224] DropUndo: 957] UNDO: Matched 951 -> 957 : Skip 952 to 957 : (FDif=1.160539E-005 : LumaPixelsDifferentBy_4 = 0)
00000039 167.14712524 [8224] DropUndo: 814] UNDO: Matched 805 -> 814 : Skip 806 to 814 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
00000040 171.00790405 [8224] DropUndo: 758] UNDO: Matched 738 -> 758 : Skip 739 to 758 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
00000041 171.04545593 [8224] DropUndo: 736] UNDO: Matched 703 -> 736 : Skip 704 to 736 : (FDif=6.405070E-004 : LumaPixelsDifferentBy_4 = 2)
00000042 172.28634644 [8224] DropUndo: 678] UNDO: Matched 673 -> 678 : Skip 674 to 678 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
00000043 174.27455139 [8224] DropUndo: 609] UNDO: Matched 557 -> 609 : Skip 558 to 609 : (FDif=3.404801E-003 : LumaPixelsDifferentBy_4 = 10)
00000044 175.56694031 [8224] DropUndo: 518] UNDO: Matched 469 -> 518 : Skip 470 to 518 : (FDif=4.070729E-003 : LumaPixelsDifferentBy_4 = 14)
00000045 176.35115051 [8224] DropUndo: 432] UNDO: Matched 418 -> 432 : Skip 419 to 432 : (FDif=8.276301E-003 : LumaPixelsDifferentBy_4 = 38)
00000046 177.06050110 [8224] DropUndo: 395] UNDO: Matched 388 -> 395 : Skip 389 to 395 : (FDif=2.100023E-005 : LumaPixelsDifferentBy_4 = 0)
00000047 177.57496643 [8224] DropUndo: 359] UNDO: Matched 324 -> 359 : Skip 325 to 359 : (FDif=6.114936E-003 : LumaPixelsDifferentBy_4 = 17)
00000048 177.83166504 [8224] DropUndo: 312] UNDO: Matched 303 -> 312 : Skip 304 to 312 : (FDif=0.000000E+000 : LumaPixelsDifferentBy_4 = 0)
00000049 179.93904114 [8224] DropUndo: 212] UNDO: Matched 207 -> 212 : Skip 208 to 212 : (FDif=1.050011E-005 : LumaPixelsDifferentBy_4 = 0)
00000050 179.97833252 [8224] DropUndo: 205] UNDO: Matched 198 -> 205 : Skip 199 to 205 : (FDif=4.973739E-006 : LumaPixelsDifferentBy_4 = 0)
00000051 180.84188843 [8224] DropUndo: 164] UNDO: Matched 111 -> 164 : Skip 112 to 164 : (FDif=1.195687E-002 : LumaPixelsDifferentBy_4 = 37)
00000052 181.51409912 [8224] DropUndo: 95] UNDO: Matched 88 -> 95 : Skip 89 to 95 : (FDif=2.763188E-006 : LumaPixelsDifferentBy_4 = 0)
00000053 182.70394897 [8224] DropUndo: 23] UNDO: Matched 0 -> 23 : Skip 1 to 23 : (FDif=7.456187E-003 : LumaPixelsDifferentBy_4 = 21)
00000054 182.75611877 [8224] DropUndo:
00000055 182.75619507 [8224] DropUndo: Kept 733 of 1650 frames [1920x1080 110.00 secs (1.83 Mins) @ 15.00 FPS]
00000056 182.75773621 [8224] DropUndo: File Max Successful CrudMax = 5.654124E-003 CrudMaxFrame=432
00000057 182.75927734 [8224] DropUndo: File Max Successful LumaPixelsDifferentBy_4 = 38 @ Frame = 432
00000058 182.76168823 [8224] DropUndo: QWIK SCAN 135.26 Secs (2.25 Mins) InFPS=12.20 OutFPS=5.42 FramesSearched=557865 FramesSearchedFPS=4124.47
00000059 183.11918640 [8224] Fsel_Eduardobedoya_Batch: 1/1 'F:\00 AVISYNTH SECOND BATCH\INPUT-OUTPUT\Test 00 UtVideo RGB VCM.avi' Tot File Time = 183.12 Seconds (3.05 Mins)
00000060 183.12054443 [8224] Fsel_Eduardobedoya_Batch:
00000061 183.12057495 [8224] Fsel_Eduardobedoya_Batch: BATCH TOTAL Time = 183.12 Seconds (3.05 Mins)
00000062 183.12060547 [8224] Fsel_Eduardobedoya_Batch: Global CrudMax=0.005654
00000063 183.12062073 [8224] Fsel_Eduardobedoya_Batch: Global MaxLumaPixelsDifferentBy_4 = 38
third batch
Quote:
00000001 0.00000000 [7356] SHIMVIEW: ShimInfo(Complete)
00000002 13.06780338 [2400] SHIMVIEW: ShimInfo(Complete)
00000003 13.39500046 [6196] SHIMVIEW: ShimInfo(Complete)
00000004 13.60489368 [3548] SHIMVIEW: ShimInfo(Complete)
00000005 13.63414574 [6000] SHIMVIEW: ShimInfo(Complete)
00000006 13.63701153 [7712] SHIMVIEW: ShimInfo(Complete)
00000007 13.64167690 [4704] SHIMVIEW: ShimInfo(Complete)
00000008 13.64673519 [8492] SHIMVIEW: ShimInfo(Complete)
00000009 13.65096092 [8820] SHIMVIEW: ShimInfo(Complete)
00000010 13.65474319 [3208] SHIMVIEW: ShimInfo(Complete)
00000011 13.69241619 [3332] SHIMVIEW: ShimInfo(Complete)
00000012 13.82886028 [6356] SHIMVIEW: ShimInfo(Complete)
00000013 13.94016266 [8420] SHIMVIEW: ShimInfo(Complete)
00000014 13.94712830 [6584] SHIMVIEW: ShimInfo(Complete)
00000015 13.96794605 [7504] SHIMVIEW: ShimInfo(Complete)
00000016 14.05450535 [2100] SHIMVIEW: ShimInfo(Complete)
00000017 14.07977772 [9176] SHIMVIEW: ShimInfo(Complete)
00000018 14.25737667 [6212] SHIMVIEW: ShimInfo(Complete)
00000019 14.32255650 [2152] SHIMVIEW: ShimInfo(Complete)
00000020 14.34952068 [6296] SHIMVIEW: ShimInfo(Complete)
00000021 14.36253738 [5488] SHIMVIEW: ShimInfo(Complete)
00000022 14.37000656 [6876] SHIMVIEW: ShimInfo(Complete)
00000023 14.70396996 [5244] SHIMVIEW: ShimInfo(Complete)
00000024 14.83184052 [8504] SHIMVIEW: ShimInfo(Complete)
00000025 15.10169888 [7756] SHIMVIEW: ShimInfo(Complete)
00000026 15.12605572 [8996] SHIMVIEW: ShimInfo(Complete)
00000027 15.13991737 [8212] SHIMVIEW: ShimInfo(Complete)
00000028 16.45670891 [5332] SHIMVIEW: ShimInfo(Complete)
00000029 16.54409027 [8560] SHIMVIEW: ShimInfo(Complete)
00000030 16.57573700 [6716] SHIMVIEW: ShimInfo(Complete)

Last edited by eduardobedoya; 8th December 2014 at 16:51.
eduardobedoya is offline   Reply With Quote
Old 8th December 2014, 18:46   #75  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
You did not say if was erroneously removing frames OR, not removing undone frames that it should have done.

Quote:
I see that the Fsel_Eduardobedoya_Batch_Sept.avs is not editable
Why not ???, perhaps only read-only was set on it for some reason, it is intended that you are able to
edit the config settings at beginning of file.

The generated _CRUD_INSPECT script shows the rubbish left behind by your paint program after an undo, it is intended that
you inspect this to see if the script got it correct, if significant 'lump' of crud (rubbish) is found in
CRUD output, then that undo is probably wrong and would have to amend config settings to suite. (view with and without
amplification (AMP=True/False).

Code:
########################################################################
THRESH          = 0.01      # (0.01) Max LumaTol due to crud between undone/undo frames. (set about double CrudMax)
                            # (CrudMax only valid as Check when results are satisfactory)
                            # Upper Limit for self tuning LumaTol.
#
LUMATOL_SCALE   = 1.0       # (1.0) Range 1.0 -> 2.0. Should never need change from 1.0.
                            # LumaTol is self tuning but could possibly be in error where without this setting would fail miserably.
                            # If self tune LumaTol is set too low then will not find matching UNDONE frames. This setting allows
                            # to increase LumaTol as LumaTol is multiplied by it, and then restricted at upper limit by THRESH above.
                            # If ever need to be changed, suggest something like 1.00001. (temporary change only)
#
LUMATOL_ADD     = 0.0       # (0.0) Range 0.0 -> 1.0. Additional adjustment added to LumaTol, probably never necessary, but if so then
                            # something like 0.000001. Applied before limiting to THRESH as above.
#
MIN_EDITLEN     = 4         # (4) An edit has to be at least this many frames long (frames between UNDONE and UNDO, exclusive)
OVR_PIXCNT_THR  = 4         # (4) Thresh for RT_LumaPixelsDifferentCount, only pixel differences greater than this are counted.
OVR_PIXCNT_LIM  = 50        # (50)If RT_LumaPixelsDifferentCount(Thresh=OVR_PIXCNT_THR) greater than this then is OVERRIDDEN as false detection.
                            # Above OVR_ settings for detecting override where difference between undone/undo is too visible (ie not crud).
#
ScanAheadSecs   = 10 * 60   # Search ahead range in seconds
ChromaWeight    = 1.0/3.0   # (1.0/3.0) YUV Chroma Weighting, 0.0 -> 1.0
FPS             = 15.0      # Play speed for output script.
VERBOSITY       = 0         # (0) 0 to 3. Debug & logging verbosity.
########################################################################
important ones in BLUE

THRESH should be higher than Crudmax shown on ALL good detections (about double at least).
OVR_PIXCNT_THR and OVR_PIXCNT_LIM detect whether 'sparkles' are crud or real edit.

Perhaps OVR_PIXCNT_LIM need be set lower as this line seems to have high "LumaPixelsDifferentBy_4 = 38"

Code:
432] UNDO: Matched 418 -> 432 : Skip 419 to 432 : (FDif=8.276301E-003 : LumaPixelsDifferentBy_4 = 38)
Perhaps try at 30. (EDIT: I only had one good sample to play with [not counting moving cursor examples] and set to 50 by default,
if 30 works better over a number of samples then use that PERMANENTLY)

EDIT: You can temporarily set THRESH high (eg 0.1) whilst trying to find better setting for OVR_PIXCNT_THR and OVR_PIXCNT_LIM
and when working OK, set THRESH to about double maximum found CrudMax.

You need to see which undo's it got wrong and adjust OVR_PIXCNT_THR and OVR_PIXCNT_LIM to suite.
A Lower setting for THRESH just speeds up detections, so temporarily set it higher when finding best settings for the OVR
config settings. The OVR settings are an attempt to detect crud, very difficult because the number of crud pixels can vary between
a few tens of pixels up to tens of thousands of rubbish pixels (different to the UNDONE frame), you might even want to set OVR_PIXCNT_THR to 5 and reduce
OVR_PIXCNT_LIM based on log lines like "LumaPixelsDifferentBy_4 = 38", the "_4" is OVR_PIXCNT_THR and 38 is compared with
OVR_PIXCNT_LIM, the idea is to determine if the crud is visible or not.
__________________
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; 8th December 2014 at 19:55.
StainlessS is online now   Reply With Quote
Old 9th December 2014, 04:03   #76  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Hi Stainless.

Sorry I said so cuz I tried to open the avs batch script with notepad and all the code appeared messed up, like all the script was place in 6 lines only.

Now I have open it with microsoft word and it worked fine. What is the right software to open scripts, is there some software that could count the lines? should I be able to open it with notepad?

I read all you explained, I will perform further test with a bunch of "different scenario" clips next months.
Im trying to understand the different values in the script, I undestood that
I must read the generated crud avs file in order to know how to handle OVR settings, but is it not enought to just see the Log file?

I understand that the crud is the rubbish produced by the undos, but I dont understand why is the AMP(=true/false) for.
I mean, I edit the avs batch script changing AMP (=true or false) then I run the avs so _CRUD avs file is generated, right? So I need to run the avs batch script twice one with the AMP=true and another with the AMP=false, right? what is exactly the difference between AMP=true data and AMP=false data?

Thanks Advanced man, guess I could not config this script as if I made it, but hope I could understand it little more with your help, thanks for all.

Last edited by eduardobedoya; 9th December 2014 at 04:05.
eduardobedoya is offline   Reply With Quote
Old 9th December 2014, 15:26   #77  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Sorry, I guess I had PSPad (text editor) set to not write Carriage Returns or something.
You can use eg NotePad+ or PSPad to replace notepad and also to edit AVS files.
http://forum.doom9.org/showthread.ph...65#post1581965

The numbers in log files tell you what was found, the crud inspect script shows whether settings worked well or not.
AMP = AMPlification, it makes crud much more visible, when off it should look like plain grey frame, if NOT grey then is a mistake.
Do not edit AMP in batcher script, only in the generated _CRUD_INSPECTxxxx.avs files.

EDIT: If not grey when AMP=False, then you need see the log values (for that frame) and adjust config settings.
I prefer to see results of rubbish when AMP=true, if you prefer to see grey then set permanently in batcher to false.

EDIT: As said in some previous post, the CRUD_INSPECT script shows if a detection was wrong, and the results from
the output script should be viewed to see if it missed some undos.
__________________
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; 9th December 2014 at 18:12.
StainlessS is online now   Reply With Quote
Old 9th December 2014, 17:57   #78  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Just spotted your SendSpace sample, must have missed it first time around, downloaded, will take a look.

NOTE, here
Code:
432] UNDO: Matched 418 -> 432 : Skip 419 to 432 : (FDif=8.276301E-003 : LumaPixelsDifferentBy_4 = 38)
In this line that I suspect might be bad detection, there are only 13 frames between UNDONE and UNDO frames (EXCLUSIVE) so if was correct undo
then you executed an undo within less than 1 second of making a mistake (@15.0 FPS), if you can guarantee eg at least 1 second ie 15 frames
before an error is undone, then set MIN_EDITLEN = 15 (or more if you can guarantee), this would help avoid some erroneous detections.

EDIT: It seems that the greater the amount of time elapsed between edit/undo (including multiple undo's) increases the amount of crud produced.
With long clips and using your required 10 minutes search ahead, it may not be possible to tell the difference between crud and edit, no matter
what settings are used. It's all really a balancing act and I cannot guarantee that any perfect solution could ever be found, unless you could find
a paint program that does not leave crud pixels after an undo, if you can find such a program (or fix the one you use) then batch script should
work pretty much perfectly as it is.

EDIT: Some more on PSPad here:http://forum.doom9.org/showthread.ph...10#post1682010

and here Avisynth.ini for PSPad in the DATA folder: (put in Syntax folder after extract, cant remember where I got it)
https://www.mediafire.com/folder/hb2...7z6/StainlessS
__________________
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; 9th December 2014 at 22:26.
StainlessS is online now   Reply With Quote
Old 10th December 2014, 06:16   #79  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks man

Thanks StainlessS, I installed Pspad (it tried to set some search engine as default in my browser) it looks huge, I almost feel like a programmer when looking at that interface xD, It opens avs fine, but still I don't understand why is the "Avisynth.ini" for? I guess I will only make a few adjustments to the batch avs.

Quote:
Do not edit AMP in batcher script, only in the generated _CRUD_INSPECTxxxx.avs files.
Yes of course I only edit AMP in the generated _CRUD_INSPECT.avs file
The batch avs generates the _AVS and the _CRUD_INSPECT, and you said I only had to copy the _AVS to an INPUT folder in order to the run the third batch, if I copy also the _CRUD_INSPECT to that INPUT folder and run the third batch it will create two videos one with the selected frames and one with the grey screen and the cruds.
What I guessed is that I would need to run that third batch process two times if I wanted to try the two options of the _CRUD_INSPECT (one with AMP=true and another with AMP=false) am I right? I guess I should leave it in true.

Quote:
In this line that I suspect might be bad detection, there are only 13 frames between UNDONE and UNDO frames (EXCLUSIVE) so if was correct undo
then you executed an undo within less than 1 second of making a mistake (@15.0 FPS), if you can guarantee eg at least 1 second ie 15 frames
before an error is undone, then set MIN_EDITLEN = 15 (or more if you can guarantee), this would help avoid some erroneous detections.
Usually undos are done repeatedly in less than one second, It happens that UNDOS come in groups consecutivily, then a couple of seconds or half minute without UNDOS, and then again another group of UNDOS, and so on. So I guess MIN_EDITLEN should be around 3 or 5.

Quote:
EDIT: It seems that the greater the amount of time elapsed between edit/undo (including multiple undo's) increases the amount of crud produced.
With long clips and using your required 10 minutes search ahead, it may not be possible to tell the difference between crud and edit, no matter
what settings are used. It's all really a balancing act and I cannot guarantee that any perfect solution could ever be found, unless you could find
a paint program that does not leave crud pixels after an undo, if you can find such a program (or fix the one you use) then batch script should
work pretty much perfectly as it is.
What if we reduce the search ahead to 5 minutes, could it help to better tell the difference between crud and edit?
Actually, the last video I sent you was recorded using a new version of the software, perhaps it could have less crud.
If not, Do you think I should try to record the painting process with UtVideo instead of tsc2 and perform a test with the batchscript to see if it still finds crud, could tsc2 be the reason of the crud?
Yes man, exacly, balancing act, so what should get priority in that balancing act?
In think the script should allow any possible mistake (Undos that didn't get cutted), provided that it could detect and differentiate all subtle strokes as different frames,
I mean, the script could skip some UNDOS, but could not CUT subtle strokes frames cuz it thinks they are all the same frame.

Finally man, the script has 85% accuracy, it looks already well balanced, and it will be a really very usefull if it can keep its accuracy ratio and detect 99% of subtle strokes in 30min videos.
I guess I only need to learn how to tweak its different settings, or perhaps you could even add some new variable to it. Thanks for all man.

Last edited by eduardobedoya; 10th December 2014 at 07:13.
eduardobedoya is offline   Reply With Quote
Old 10th December 2014, 20:19   #80  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,107
Quote:
it tried to set some search engine as default in my browser
Yes some free software does that, it gives them a little cash income, just de-select it.

Quote:
why is the Avisynth.ini for?
Allows to highlight Avisynth syntax + can eg press a key and run a program (eg MPlayer/VDub)on avs script.
See Here:- http://forum.doom9.org/showthread.php?t=170684

Dont bother with the batch thing on _CRUD_INSPECT scripts, just use them if you think it got something wrong and
only directly open in eg VDubMod, not batch processed.

With AMP = True, bad detection crud frame would have a 'solid' lump of crud, not like the 'sparkles' that are
normally seen in crud frames, cant explain any better, best to see for yourself (could try script on one of the
moving cursor clips and you are bound to see what crud lumps look like).

Actually, the line I thought might be crud looks like it is OK, I'm not sure but I think there may be a logic
problem in script (a kind of sequencing problem). I've also discovered a bug in the RT_FSelOpen() function, which
I am gonna have to look at first.
EDIT: False alarm for the RT_FSelOpen bug, seems to be something a bit strange in MediaPlayerClassic-Home Cinema.
If user clicks on Cancel in fileselector, and script throws error via Assert then MPC-HC has a 2nd go at opening the script
and the file selector jumps up for a second time.


When I mentioned MIN_EDITLEN = 15, I mean the number of frames between last click on group of undo's (frame nearest
end of clip) and the 1st frame before consecutive edits that will be undone (frame nearest start of clip),
undo sequences are removed as a single block, multiple consecutive undo groups all at once, so for an instance
where only a single UNDO will be processed, you could guarantee 15 frames for MIN_EDITLEN just by waiting for 1 second
before you click on UNDO, so long as number of frames between first UNDONE frame and last UNDO frame is over
MIN_EDITLEN then everything would be fine, the MIN_EDITLEN setting is for when you make a single mistake and
immediately UNDO it, the MIN_EDITLEN setting was set deliberately low as in your test clip you obviously had a
finger on the UNDO key so you could make an edit and immediately undo it again, in reality I dont think it would
need to be as low as default 4.(hope that makes some sense).

"What if we reduce the search ahead to 5 minutes, could it help to better tell the difference between crud and edit?"

I think I said from the beginning that a 10 minute search ahead was a little ambitious (but not so much if the
paint program did not introduce crud into the mix). As it is, the clips tested so far have been short clips and so
the 10 min search ahead has not been tested at all. Only time will tell when you try on 30 min clips whether will
work OK or not, but the real problem is I think multiple consecutive undo's with cascadingly accumulated crud
with each undo. In one of your clips (a moving cursor clip I think) I did see crud that WAS VISIBLE
in the _AVS_ result clip, on my monitor was I think a tear drop shape about 3mm across and clearly visible dark blob
which remained on-frame until end of clip (not an edit by you, results of crud by paint program).
In reality, it is probable that the dark blob is a lot less likely to appear, was probably down to your providing
an UNDO TORTURE TEST clip, with many repeated edits and undos in rapid succession.

Tsc2 could indeed be the reason for the crud rather than paint program, but paint program chief suspect I think.
If was Tsc2 and used different record s/w then would remove the crud problem altogether, that has already been
suggested earlier.

Viewing the _CRUD_INSPECT_ script I did not see any bad detections (even the "LumaPixelsDifferentBy_4 = 38" line
frame looked OK), it just looks like it missed removing a couple of undo's and that looks like it may be the
sequencing problem mentioned previously.

I'll get back.

EDIT: 'Crud lumps' are (EDIT: usually) not crud, they are undo mistakes (undone by mistake).
EDIT: The main problem is:, is it an UNDO with crud, OR, an edit. Without crud the problem is much simpler.
__________________
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; 12th December 2014 at 09:01.
StainlessS is online now   Reply With Quote
Reply

Tags
avisynth, detection, duplicated, frames, trim

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 23:47.


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