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 15th April 2014, 22:40   #41  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Hi StainlessS

I do have FrameSel v2.6 dll in my avisynth plugin folder

I have avisynth 26 installed as you suggested.
eduardobedoya is offline   Reply With Quote
Old 16th April 2014, 04:04   #42  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Then you have some kind of Avisynth problem, re-install.
Copy only required plugins to plugins dir, and establish that avisynth is working, no
point in trying to get the rest working without working avisynth.
You only put 1 of each of the plugs in plugins dir, ie only v.26 version not v2.5.

Before install try this

Code:
Version()
It should show Avisynth version. v2.5 cannot load v2.6 plugins.
EDIT: Only thing I can think of is that you actually have Avisynth v2.58 installed.
__________________
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; 16th April 2014 at 04:30.
StainlessS is offline   Reply With Quote
Old 16th April 2014, 04:52   #43  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Hi StainlessS

I tried the version () code (creating a avs with that code and open it in virtualdub), here is the result


AviSynth 2.60, build:Sep 18 2013 [17:36:36]
C 2000-2013 Ben Rudiak-Gould, et al.
http://www.avisynth.org


What I have noticed is that even when I installing Avisynth 2.6 it gets installed inside a folder name Avisynth 2.5, I guess it does not matter

The files inside my current avisynth installation directory (C:\Program Files (x86)\AviSynth 2.5\plugins) are:

by default:
colors_rgb.avsi
DirectShowSource.dll
TCPDeliver.dll

Installed by me
FrameSelect26.dll
Gscript.dll
RT_Stats26.dll


I desinstall and reinstall Avisynth 2.6
I get the defult plugins:
colors_rgb.avsi
DirectShowSource.dll
TCPDeliver.dll

and I added only the FrameSelect26.dll (84kb)


Then I lunched the avs file but get the same error message
Avisynth open failure:
Script error: there is no function named "FrameSel"
(C:\Users\Eduardo\Desktop\FOR AVISYNTH\painting test for avisynth Lagarith_SelectFrames.AVS, line4)

I dont know what is wrong with my system, should I try to install AviSynthPlus-r1576.exe?? or AviSynth 2.5.8????
http://avisynth.nl/index.php/Main_Page

Thanks Advaced StainlessS

Last edited by eduardobedoya; 16th April 2014 at 05:15.
eduardobedoya is offline   Reply With Quote
Old 16th April 2014, 11:17   #44  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Oops, sorry.
Seems I may have supplied you with FrameSelect plugin rather than FrameSel plugin.
FrameSelect is older version, needed to change args in non compatible way, and so I renamed the plugin
to avoid compatibility problems. Delete the older FrameSelect, you need FrameSel plugin, v2.6.
See MediaFire below in sig.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 16th April 2014, 20:15   #45  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Man I dont know if I should laugh or cry

Thanks StainlessS
I was already thinking about installing a virtual machine


Thanks man, it worked, I did a TEST>>>


First Here is the UNDO Batch Log:

Code:
Fsel_Eduardobedoya_Batch.Log
CONVYV12=False
ldM=1 hdM=1 ldL=0.005000 hdL=0.005000  ldS=0.005000 hdS=0.005000  ldR=0.005000 hdR=0.005000 MAX_LDIFF=0.004000


1/1 ] Processing C:\Users\Eduardo\Desktop\FOR AVISYNTH\painting test for avisynth UTVideoULRG.avi
QWIK Scan DBase creation = 49.06 Secs (0.82 Mins)
184,195     Skipping earlier duplicate sequence and UNDOS
368,536     Skipping earlier duplicate sequence and UNDOS
612,706     Skipping earlier duplicate sequence and UNDOS
847,886     Skipping earlier duplicate sequence and UNDOS
910,961     Skipping earlier duplicate sequence and UNDOS
1284,1345     Skipping earlier duplicate sequence and UNDOS
1378,1438     Skipping earlier duplicate sequence and UNDOS
1506,1535     Skipping earlier duplicate sequence and UNDOS
1544,1546     Skipping earlier duplicate sequence and UNDOS
1702,1713     Skipping earlier duplicate sequence and UNDOS
1716,1797     Skipping earlier duplicate sequence and UNDOS
1983,2049     Skipping earlier duplicate sequence and UNDOS
2085,2126     Skipping earlier duplicate sequence and UNDOS
2183,2285     Skipping earlier duplicate sequence and UNDOS
MDeltaMax=0 LDeltaMax=0.002777 SDeltaMax=0.001762 RDeltaMax=0.001480
(Above, maximum values of ldM, hdM, ldL, hdL, ldS, hdS, ldR, hdR, that would have worked, but may have been faster)
Kept 1474 of 2304 frames [1920x1080 153.60 secs (2.56 Mins) @ 15.00 FPS]
QWIK SCAN 127.67 Secs (2.13 Mins) InFPS=18.05 OutFPS=11.55
C:\Users\Eduardo\Desktop\FOR AVISYNTH\painting test for avisynth UTVideoULRG.avi  Tot File Time = 177.32 Seconds (2.96 Mins)

DONE


TOTAL Time = 177.33 Seconds (2.96 Mins)

Here is the resulted AVS file:


Code:
Avisource("C:\Users\Eduardo\Desktop\FOR AVISYNTH\painting test for avisynth UTVideoULRG.avi")
 CmdFrames="C:\Users\Eduardo\Desktop\FOR AVISYNTH\painting test for avisynth UTVideoULRG_Frames.txt"
 (Exist(CmdFrames)) ? FrameSel(cmd=CmdFrames,reject=False) : NOP
 
 Return Last


Then here is the message that appeared in the command promp when launching VdBatch.bat

Code:
F:\2 AVISYNTH>REM Where to get input file, No terminating Backslash, "." = current directory

F:\2 AVISYNTH>set INDIR=".\INPUT"

F:\2 AVISYNTH>REM Where to get input files, No terminating Backslash.

F:\2 AVISYNTH>set INDIR=".\OUTPUT"

F:\2 AVISYNTH>REM Execute Vdub using script, clear command queue, batch mode, source dir, dest dir, process queue, exit

F:\2 AVISYNTH>"C:\Program FIles <x86>\VirtualDub-1.10.4""/VDub.exe" \s "C:Program Files <x86>\VirtualDub-1.10.4""\VD.vcf" /c /b ".\INPUT" ".\OUTPUT" /r /x VirtualDub CLI Video Processor Version 1.10.4 <build 35491/release> for 80x86 Copyright <C> Avery Lee 1998-2009. Licensed under GNU General Public License

AVI: Opening file "F:\2 AVISYNTH\INPUT\painting test for avisynth UTVideoULRG_SelectFrames.AVS"
AVI: Avisynth detected. Extended error handling enabled
Beginning dub operation
Dub: Input <decompression> format is : XRGB8888.
Dub: Output <compression> format is: RGB888.

Last edited by eduardobedoya; 16th April 2014 at 21:20.
eduardobedoya is offline   Reply With Quote
Old 16th April 2014, 21:29   #46  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
About the color output

Thanks a lot StainlessS, it worked!

I used UTVideoULRG because it keep the color very similar to the original in RGB
Also I changed this line, of the Undo BATCH.AVS that you provided:
Code:
####
CONVYV12	= False		# True ConvertTo YV12 in created script, Else False leaves as is
####
in orther to keep the video in RGB

But when I run the VdBatch.bat the color of the OUTPUT video drastically changed
I guessed it depends on the video>compression properties that you choose on Virtualdub (VD.vcf)
So I changed Virtualdub compression properties to tscc codec, and then it rendered the video in a good RGB color,

Thanks a lot StainlessS, I just have some doubts:

Is there a big difference between converting the original tsc2 video to UTVideoULRG or UTVideoULY0 codecs for running the UNDOBatch.avs??
I mean, cuz, the sample tsc2 26mb video converted into UTVideoULRG is 5.2gb and into UTVideoULY0 is 2.7gb,
So is there any problem if I convert the original tsc2 into UTVideoULY0 video file in order to run the UNDObatch in YUV and then re-convert it with the VDBatch.bat into RGB again? Do I loss some color information in the final OUTPUT RGB video by doing this way??? Will the batch process be run in YUV colors so it could loss some accuracy in color detection (similar color painting strokes)??

I run the test and it really cut all the UNDOS, but, is there any way to merge all equal frames to a single frame?
I mean, cuz, the result video got in fact all the painting strokes without UNDOS, but there is so much space(time)(equal frames) between each different stroke, is there a way to merge all that spaces,
so the time between each different painting stroke could be just one frame?
For example:
the original video was
AbcdAbcAbcdeABCDefDefgDefDefgDEFGHijHijkHIJKLMnopMnopMNOPQ
the applying your avs it turns into
AABCDDDDEFGHHIKJLMMMNOPQ
is there a way to turn it into (perhpas using the same batch.avs)
ABCDEFGHIJKLMNOPQ

Thanks a lot StainlessS!!!

Last edited by eduardobedoya; 16th April 2014 at 23:25.
eduardobedoya is offline   Reply With Quote
Old 17th April 2014, 13:56   #47  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
But when I run the VdBatch.bat the color of the OUTPUT video drastically changed
I guessed it depends on the video>compression properties that you choose on Virtualdub (VD.vcf)
So I changed Virtualdub compression properties to tscc codec, and then it rendered the video in a good RGB color,
I guess that has something to do with color matrix used/assumed, see Vdub menu "Video/ColorDepth", perhaps playing around with
'decompression format' and 'output format to compressor/display' is required, I would be reluctant to go back to TSCC codec, we already
established it to be unreliable for eg seeking, suggest find alternative. I dont usually touch HD, I dont have BD player or other source
of it, perhaps others could advise on best settings for VD 'decompression format' and 'output format to compressor/display', to
pass through RGB untouched to UT_Video ULRG. I dont really see why pulling in RGB and compressing to UT_Video RGB should give
a problem. What are you using to judge the 'drastically changed output', did you look at the input to UNDO script too ?

UTVideo ULY0 is rec601 YV12, ie half resolution chroma, that is why is is smaller compressed file, half chroma detail gone.

Quote:
but, is there any way to merge all equal frames to a single frame?
I initially did that but assumed that you really would not want it, ie results will be a clip of maybe 3 or 4 seconds out of your 3 min clip.
OK, I'll put it back like that.

EDIT: From your last post
Code:
Dub: Input <decompression> format is : XRGB8888.
Dub: Output <compression> format is: RGB888.
Looks like straight through RGB in -> out (RGB32 to RGB24), why drastically changed, no idea.
__________________
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 April 2014 at 14:08.
StainlessS is offline   Reply With Quote
Old 17th April 2014, 19:39   #48  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Hi StainlessS

Quote:
UTVideo ULY0 is rec601 YV12, ie half resolution chroma, that is why is is smaller compressed file, half chroma detail gone.
So it means that runing the UNDOBatch.avs with a UTVideoULRG video and not converting to YV12 could be more accurate in detected diferent color strokes?? (subtle diferent color strokes)
compared to ULY0????
eduardobedoya is offline   Reply With Quote
Old 17th April 2014, 20:12   #49  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yep..
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 19th April 2014, 01:05   #50  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, I've added framecount limiting for static sequences, with KEEPMAX==1 (default) will produce output clip with
148 frames (on your sample, I think) with no pauses between edits. setting to eg 15 will give max 1 second pause between edits
when 15FPS clip.

Added a ranges.txt file, created during resultant avs load, informational only.
Removed ConvertToYV12 functionality.
Reduced number of tolerance settings (+ve and -ve tolerances set same).

here: LINK REMOVED

script here:
Code:
# ############################
# Fsel_Eduardobedoya_Batch.avs, by StainlessS
# Remove Undos from painting captures
# ############################



# Alter below to Config
########################################################################
########################################################################
########################################################################

ScanAheadSecs       = 10 * 60   # Search ahead range in seconds

#### BELOW SETTINGS WORK FINE WITH SUPPLIED SAMPLE WITH A LITTLE LEEWAY.
# Below settings, as close to zero as possible (faster but might miss matches), used by QWIK scan routines to identify possible match frames.
dM   = 1       # INT, Max diff (+ve and -ve tolerance) of YMedian between i frame and possible duplicate (may vary with clip, 0.0 for EXACT match)
#
dL  = 0.005    # Float, Max diff (+ve and -ve  tolerance) of AverageLuma between i frame and possible duplicate (may vary with clip, 0.0 for EXACT match)
#
dS  = 0.005    # Float, Max diff (+ve and -ve  tolerance) of YPlaneStdev between i frame and possible duplicate (may vary with clip, 0.0 for EXACT match)
#
dR  = 0.005    # Float, Max diff (+ve and -ve  tolerance) of YInRange between i frame and possible duplicate (may vary with clip, 0.0 for EXACT match)
####

####
# Below used to identify if candidate frames found by QWIK SCAN routines are good match.
MAX_LDIFF  = 0.004   # Float, LumaDifference between candidate frame and duplicate (average pixel diff rather than frame diff, 0.0 Exact match)
####
# Maximum number of frames to keep per static sequence (0 = no limit)
KEEPMAX=1
####

########################################################################
########################################################################
########################################################################

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_WriteFileF(LOG,"%s\n",LOG,Append=False)
S=RT_String("dM=%d dL=%f dS=%f dR=%f MAX_LDIFF=%f",dM,dL,dS,dR,MAX_LDiff)
RT_WriteFileF(LOG,"%s",S,Append=True)
S=RT_String("KeepMax=%d",KeepMax)
RT_DebugF("%s",S,name=myName)
RT_WriteFileF(LOG,"%s\n",S,Append=True)
GSCript("""
    TOTSTART = RT_Timer
    For(i=0,NFILES-1) {
        START = RT_Timer
        FN=RT_TxtGetLine(AVIFILE_LIST,i)                                        # Filename of avi file i
        S=RT_String("\n%d/%d ] Processing %s",i+1,NFILES, FN)
        RT_DebugF(S,name=myName)
        RT_WriteFileF(LOG,"%s",S,Append=True)

        DropUndoSequences(FN,ScanAheadSecs,dm=dM, dL=dL, ds=dS, dr=dR,LDThresh=MAX_LDIFF, log=LOG, keepmax=KEEPMAX)

        T = RT_Timer - START
        S=RT_String("%s  Tot File Time = %.2f Seconds (%.2f Mins)",FN, T,T/60.0)
        RT_DebugF(S,name=myName)
        RT_WriteFileF(LOG,"%s",S,Append=True)
    }
    T = RT_Timer - TOTSTART
    S=RT_String("\n\nTOTAL Time = %.2f Seconds (%.2f Mins)\n",T,T/60.0)
    RT_DebugF(S,name=myName)
    S=RT_String("\n\nDONE\n\n%s\n",S)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    S=RT_StrReplace(S,Chr(10),"\n")
""")
Return blankclip(length=24*60*60*24).Subtitle(S,Align=5,Y=100,lsp=0,Size=30)


Function DropUndoSequences(String "AviName",Float "ScanAheadSecs",int "dM",Float "dL",Float "dS",Float "dR",Float "LDThresh",String "Log",int "KeepMax") {
    myName="DropUndoSequences: "
    ScanAheadSecs=Float(Default(ScanAheadSecs,10.0*60.0))
    dM = Default(dM,1)
    dL = Float(Default(dL,0.005))
    dS = Float(Default(dS,0.005))
    dR = Float(Default(dR,0.005))
    LDThresh = Float(Default(LDThresh,0.004))
    LOG = Default(LOG,"DropUndoSequences.LOG")
    KeepMax=Default(KeepMax,0)                                                  # 0 = no limit
    Assert(Exist(AviName),myName+AviName+" Does Not Exist")

    Avisource(AviName).ConvertToYV12()                                          # So we use the same settings whether orig RGB or YV12

    Assert(ScanAheadSecs>0.0,myName+"ScanAheadSecs Must be greater than zero")
    Assert(dM>=0,  myName+"ldM Must be greater than or equal to zero")
    Assert(dL>=0.0,myName+"ldL Must be greater or equal to zero")
    Assert(dS>=0.0,myName+"ldS Must be greater or equal to zero")
    Assert(dR>=0.0,myName+"ldR Must be greater or equal to zero")
    Assert(KeepMax>=0,myName+"KeepMax Must be greater or equal to zero")

    PathAndNode = RT_FilenameSplit(AviName,7)       # Drive + Dir + Name
    CMDFrames=PathAndNode+"_Frames.txt"
    Ranges=PathAndNode+"_Ranges.txt"
    ScriptFile=PathAndNode+"_SelectFrames.AVS"
    ScanAheadFrames = Int(ScanAheadSecs*FrameRate)
    DB=PathAndNode+".DB"
    PNDB=PathAndNode +  "_Prev.DB"
    RT_FileDelete(CMDFrames)                                                       # Delete any existing frames file
    RT_FileDelete(Ranges)                                                          # Delete any existing Ranges file
    ### TEMPLATE script

    FrameSel_Select="""
        fn="%s"
        Avisource(fn)
        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
    """

    ###
    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)                                  # Insert filenames and ConvertToYV12

    START = RT_Timer
    RT_QwikLumaScanCreateDB(DB,prevdb=PNDB,nextdb="",debug=true)
    T= RT_Timer - START
    S = RT_String("QWIK Scan DBase creation = %.2f Secs (%.2f Mins)",T,T/60.0)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    OCNT=0
    GSCript("""
        START = RT_Timer
        LastFrame=FrameCount-1
        FivePercFrames = Round(0.05 * FrameCount)
        RT_DebugF("QWIK Scanning file ... Please Wait",name=myName)
        MDeltaMax = 0   LDeltaMax = 0.0     SDeltaMax = 0.0     RDeltaMax = 0.0
        Kept = 0

        For(i=0,LastFrame) {
            WrStart = i WrEnd = i                                   # Init to keep 1 frame (if not found)
            EndLimit = Min(i + ScanAheadFrames,LastFrame)           # Searching Endlimit to i+1 inclusive (downwards)
            # Scan for static sequence
            FindStart = i + 1
            for(k=FindStart,EndLimit) {
                dif=RT_LumaDifference(Last,Last,n=i,n2=k)
                if(dif <= LDThresh) {
                    WrEnd = k
                } Else {
                    FindStart = k
                    k = EndLimit                                    # break
                }
            }
            # Here:- WStart to WrEnd are similar, search from EndLimit downward to FindStart for later dupe sequence
            For(j=EndLimit,FindStart,-1) {
                # Search for i frame dupe nearest to EndLimit but higher than FindStart
                j = RT_QwikLumaScanGetNear(DB,PNDB,j,               \
                        ldm = dM, ldl = dL, lds = dS, ldr = dR,     \
                        maxdistance=j-FindStart,    Inclusive=True,     \
                        findframe=i)
                if(j > FindStart) {                                     # We found a candidate frame
                    dif=RT_LumaDifference(Last,Last,n=i,n2=j)           # Ave pixel diff between i frame and candidate
                    if(dif <= LDThresh) {
                        # We found a single duplicate frame and will drop earlier sequence, look for start of similar frames in this sequence
                        DupeEnd = j
                        DupeStart = j
                        for(k=j-1,FindStart+1,-1) {
                            tdif=RT_LumaDifference(Last,Last,n=i,n2=k)
                            if(tdif <= LDThresh) {
                                DupeStart = k
                            } Else {
                                k = FindStart                       # break
                            }
                        }
                        RT_DebugF("%d,%d --> %d,%d Matched LumaDif=%f",WrStart,WrEnd,DupeStart,DupeEnd,dif,name=myName)
                        S=RT_String("%d,%d     Skipping earlier duplicate sequence and UNDOS",WrStart,DupeStart-1)
                        RT_debugF("%s",S,name=myName)
                        RT_WriteFileF(LOG,"%s",S,Append=True)
                        RT_Ystats(Last,i,flgs=$78,lo=64,hi=192,Prefix="I_")                 # Default DBase create, YInRange lo and hi
                        RT_Ystats(Last,j,flgs=$78,lo=64,hi=192,Prefix="J_")
                        I_yInRng = I_yInRng * 255.0         J_yInRng = J_yInRng * 255.0     # Make range same as other YStats (YInrange is 0.0->1.0)
                        MDelta=Abs(I_yMed-J_yMed)           LDelta=Abs(I_yAve-J_yAve)
                        SDelta=Abs(I_yStdev-J_yStdev)       RDelta=Abs(I_yInRng-J_yInRng)
                        MDeltaMax=Max(MDeltaMax,MDelta)     LDeltaMax=Max(LDeltaMax,LDelta)
                        SDeltaMax=Max(SDeltaMax,SDelta)     RDeltaMax=Max(RDeltaMax,RDelta)
                        RT_DebugF("MDelta=%d LDelta=%f SDelta=%f RDelta=%f",MDelta,LDelta,SDelta,RDelta,name=myName)
                        WrStart = DupeStart
                        WrEnd = DupeEnd
                        j = 0                                       # Early break
                    }
                }
            }
            Keep = (WrEnd-WrStart+1)
            if(KeepMax>0 && Keep>KeepMax) {
                # Limit frames to keep
                RT_DebugF("KeepMax Limiting: %d frames limited to %d (%d,%d -> %d,%d)",Keep,KeepMax,WrStart,WrEnd,WrEnd-KeepMax+1,WrEnd,name=myName)
                Keep = KeepMax
                WrStart=WrEnd-Keep+1
            }
            Kept = Kept + Keep
            if(Keep == 1) {
                RT_WriteFileF(CMDFrames,"%d",WrStart,Append=True)
            } else {
                RT_WriteFileF(CMDFrames,"%d,%d",WrStart,WrEnd,Append=True)
            }
            i = WrEnd
            If(i > (OCNT+FivePercFrames)) {
                T= RT_Timer - START
                RT_DebugF("%d ] Progress = %.2f%% InFrames=%d OutFrames=%d InFPS=%.2fFPS OutFPS=%.2f",
                    \ i,(i+1)*100.0/(LastFrame+1),i+1,Kept,(i+1)/T,Kept/T,name=myName)
                OCNT=i
            }
        }
    RT_WriteFileF(ScriptFile,"%s",Select_S,Append=False)
    RT_FileDelete(DB)
    RT_FileDelete(PNDB)
    S=RT_String("MDeltaMax=%d LDeltaMax=%f SDeltaMax=%f RDeltaMax=%f",MDeltaMax,LDeltaMax,SDeltaMax,RDeltaMax)
    RT_debugF("%s",S,name=myName)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    S="(Above, maximum values of dM, dL, dS, dR, that would have worked, but may have been faster)"
    RT_debugF("%s",S,name=myName)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    T = RT_Timer - START
    FT=FrameCount / FrameRate
    S=RT_String("Kept %d of %d frames [%dx%d %.2f secs (%.2f Mins) @ %.2f FPS]", Kept, FrameCount,Width,Height,FT,FT/60.0,FrameRate)
    RT_DebugF(S,name=myName)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    S=RT_String("QWIK SCAN %.2f Secs (%.2f Mins) InFPS=%.2f OutFPS=%.2f", T,T/60.0,FrameCount/T,Kept/T)
    RT_DebugF(S,name=myName)
    RT_WriteFileF(LOG,"%s",S,Append=True)
    """)
    Return 0
}
__________________
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:43.
StainlessS is offline   Reply With Quote
Old 20th April 2014, 04:08   #51  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks StainlessS

Thanks StainlessS I will try this last script with my 30min videos.
Did you see my last PM? I did a summary of all most subtle strokes in a 46mb video, I was wondering which strokes are posible to process, and which are not.

Thanks advanced.
eduardobedoya is offline   Reply With Quote
Old 20th April 2014, 15:09   #52  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yes I DL your clip from last PM, thank you.
Am in process of converting to 3 channel fingerprint rather than Luma only.
Not working as good as Luma only as yet.

EDIT:
Quote:
I was wondering which strokes are posible to process, and which are not.
You want to catch subtle differences, the main problem is that damn cursor that keeps jumping around the frame,
and its usually quite different to whatever its overlaying.
__________________
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; 20th April 2014 at 18:55.
StainlessS is offline   Reply With Quote
Old 20th April 2014, 20:00   #53  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks a lot StainlessS

yes man, the cursor its a pain, there is no way to remove it, I did my best to kinda hide it, so I set the app to display only four little white dots (kinda pixel size) in crossshape that always appear on the screen.
Some times it changes to a circular or eliptical white shapes, but those can be removed by me, I mean I can set the app to avoid display those circular and eliptical cursors, so you can deal only with the crossshape one.

I will see if I can figure out a way to get rid of the crossshape cursor, because if I delete it, then I could not see where I am actually positioning the brush in the screen.

Thanks advanced.

Last edited by eduardobedoya; 20th April 2014 at 20:15.
eduardobedoya is offline   Reply With Quote
Old 20th April 2014, 20:26   #54  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I've implemented a new function RT_LumaPixelsDifferent() for this problem, gives a pixel count of number of pixels
that are different in any way (RGB converted to Luma_Y before compare).

Here output of test of a few frames from your original clip, 1st two numbers are frame numbers compared

Code:
00000076    432.54067993    [3936] RT_DebugF: 172:173 ] CDif=0.000000 LDif=0.000000 CNT=0
00000077    432.61959839    [3936] RT_DebugF: 172:174 ] CDif=0.000000 LDif=0.000000 CNT=0
00000078    432.69915771    [3936] RT_DebugF: 172:175 ] CDif=0.000340 LDif=0.000838 CNT=108
00000079    432.77612305    [3936] RT_DebugF: 172:176 ] CDif=0.000447 LDif=0.000912 CNT=189
00000080    432.85601807    [3936] RT_DebugF: 172:177 ] CDif=0.000433 LDif=0.000894 CNT=179
00000081    432.93295288    [3936] RT_DebugF: 172:178 ] CDif=0.000440 LDif=0.000899 CNT=188
00000082    433.00939941    [3936] RT_DebugF: 172:179 ] CDif=0.000348 LDif=0.000727 CNT=163
00000083    433.08856201    [3936] RT_DebugF: 172:180 ] CDif=0.001467 LDif=0.002735 CNT=659
So is comparing with frame 172, through to 180, seems that maybe anything above about 200 pixels changed
is an edit, 189 pixels changed just looks to me like a cursor move. Frame 180 is a smallish edit.
__________________
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; 20th April 2014 at 20:30.
StainlessS is offline   Reply With Quote
Old 20th April 2014, 22:56   #55  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
It seems to be very accurate

a particular solution for a particular problem?
Looks very accurate, Thanks StainlessS

The main cursor is a cross shape of four pixelsize white dots, I could get rid of it, but then I could not see where I am actually positioning the brush in the screen
Some times the cursor is shown as a circular or eliptical white shapes, I can easily set the program so they dont appear anymore, so that you can focus on dealing with the main cross shape cursor.

PD: I have a bunch of recorded painting sesions already trimmed by hand, I would like to test them out with your new script.

Last edited by eduardobedoya; 20th April 2014 at 23:09.
eduardobedoya is offline   Reply With Quote
Old 20th April 2014, 23:41   #56  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This shows changes from previous frame (including eg cursor movement)

Code:
SHOW=True

aviName="D:\avs\avi\in\painting test for avisynth.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
}
EDIT: What looks like 4 white pixels of cursor, is more like a cloud of pixel changes.

EDIT:
Oh dear!, seems when you do an undo, it leaves some rubbish in the undo region.
This compares all frames with frame 372, play from 372 and see the rubbish left after undos.

Code:
FRAME=372

aviName="D:\avs\avi\in\painting test for avisynth.avi.AVI"
Avisource(AviName)

A=trim(FRAME,-1)
A=A.FreezeFrame(1,Last.FrameCount-1,0)
Clipdelta(a,Last,true)
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
}
__________________
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; 21st April 2014 at 00:22.
StainlessS is offline   Reply With Quote
Old 21st April 2014, 02:41   #57  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
so, now the script is looking better than I?

I never realize of that rubbish left areas
The circular and eliptical cursor will not appear anymore.

I am still looking for a way get rid of the crossshape cursor,
if the avs script will be more accurate by removing the crossshape cursor, then I will try find a way to get rid of it.

Last edited by eduardobedoya; 21st April 2014 at 18:06.
eduardobedoya is offline   Reply With Quote
Old 26th April 2014, 14:05   #58  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by eduardobedoya View Post
I am still looking for a way get rid of the crossshape cursor,
if the avs script will be more accurate by removing the crossshape cursor, then I will try find a way to get rid of it.
Yes very definitely more accurate, perhaps you could cajole the authors of your paint program to also fix the rubbish left after UNDO operation, there can be a lot of it, although might be invisible to the eye, is not so invisible to plugin, and messes up detection. Send the authors the script that shows the rubbish, perhaps they are unaware that their software has this problem.

I have not forgotten you, I am still working on a solution, hopefully within a few days I can have something that mostly works OK, even with the cursor and undo rubbish present.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 26th April 2014, 17:35   #59  |  Link
eduardobedoya
Registered User
 
eduardobedoya's Avatar
 
Join Date: Mar 2014
Posts: 39
Thanks StainlessS

of course, Ill wait until your next release
I am still looking for a way to get rid of the crossshape cursor, I have made a post in superuser and stackoverflow, asking for a third party appplication that could show a cursor (ico file) in the screen always, so I can disable the paint program crossshape cursor. Once I have only a ico file cursor I can tell camtasia to not record it. (I just dont know why this option just does not work with the crossshape cursor).
I will submit any news.
Thanks StainlessS

EDIT> I kinda get rid of the cloud crossshape cursor, message sent.

Last edited by eduardobedoya; 27th April 2014 at 18:25.
eduardobedoya is offline   Reply With Quote
Old 24th May 2014, 04:09   #60  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Saw that you were on-line yesterday.
I'm still working on this and have not forgotten you, (although I have had a few excursions doing other things just because
my head hurts when I keep banging it against the wall).
I have not as yet moved on to try your later clip with the single 3x2 pixel cursor, I'm still banging away at the more difficult
1st clip you provided.
Anyway, just thought I'de let you know that I have not (as yet) given up totally
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

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 04:43.


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