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 2nd March 2017, 18:16   #381  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RT_Stats v2.0 Beta 07, new version, see MediaFire (or SendSpace) in sig below this post.

Code:
	v2.0 Beta 5. Added RT_DBaseReadCSV().
	v2.0 Beta 6. 28 Feb 2017.
		RT_DBaseReadCSV(), relaxed Separator requirement if SPACE/TAB separated. Added StrDelimiter string Arg.
	v2.0 Beta 7. 02 Mar 2017.
		RT_DBaseReadCSV(), Added StartField and EndField args. Max CSV line length increased to 64*1024 bytes.

Code:
RT_DBaseReadCSV(String DB, String CSV, String "Separator"=",",String "StrDelimiter"="\"",Int "StartField"=0,Int "EndField"=last_field)

    This function will extract CSV values in text file, and append them as records to an appropriately formatted DBase file.

    DB,           FileName of an RT_Stats DBase file.
    CSV,          FileName of a text CSV (Comma Separated Value) file.
    Separator     Default "," ie comma separator (first character only, Chr()'s 0, 13, 10, and 34 [Double Quote] illegal).
                  Default Separator "," (Comma) is optional and so long as CSV values are SPACE/TAB separated will not produce an error if separator is missing.
    StrDelimiter  Default = "\"" ie single character string Double Quote.
                  StrDelimiter (String Delimiter) can be multiple characters (empty string "" illegal, also cannot contain the Separator character nor
                  SPACE or TAB), Default is a Double Quote single character string.
                  CSV string values CANNOT contain StrDelimiter string, ie for default StrDelimiter, strings cannot contain a double quote character string.
                  So long as the StrDelimiter does not appear within any string, nearly any StrDelimiter can be used, eg "@@@" is a 3 character StrDelimiter
                  that you could use in place of double quote string delimiters, where the string values could then contain a double quote character, in
                  such a case you should enclosed CSV strings as in @@@Some text that contains a " double quote.@@@.
                  NOTE, StrDelimiter IS case sensitive, so if using alphabetic characters they have to match exactly.
                  
    StartField    Default = 0.
    EndField      Default = last field in DBase record (By default, all fields should be present in CSV file, else error).
                  Above StartField and EndField args allow setting of limited number of CONSECUTIVE fields within a record, the remaining
                  fields if any are set to NULL values, ie String all zero chars, bool = false, Float=0.0, int and bin=0.

    Function returns Int, the number of records added to the DBase.
    (Maximum line length in CSV text file is 64*1024 characters).

    Example:-
        CSV.txt file containing text something like this
        ###
            1  ,42.0 ,true , "Hello"        # I am a comment
            2  ,43.5 ,false, "Goodbye"
            $FF,3.142,TRUE , "Coconuts"     # So Am I
        ###
        Script:-
        DB  = "My.DB"
        CSV = "CSV.txt"
        RT_DBaseAlloc(DB,0,"ifbs32")        # Allocate DBase with 0 pre-allocated records, 4 fields, 0)=Int, 1)=Float, 2)=bool, 3=String(maxlen=32).
        Added=RT_DBaseReadCSV(DB,CSV)
        Return MessageClip("Added "+String(Added)+" Records")   # Shows "Added 3 Records".
__________________
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 4th March 2017, 03:35   #382  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RT_Stats v2.0 Beta 08, new version, see MediaFire (or SendSpace) in sig below this post.

Code:
    v2.0 Beta 6. 28 Feb 2017.
        RT_DBaseReadCSV(), relaxed Separator requirement if SPACE/TAB separated. Added StrDelimiter string Arg.
    v2.0 Beta 7. 02 Mar 2017.
        RT_DBaseReadCSV(), Added StartField and EndField args. Max CSV line length increased to 64*1024 bytes.
    v2.0 Beta 8. 04 Mar 2017.
        Added Functions:
            RT_DBaseWriteCSV(), RT_DBaseFindSeq() and RT_DBaseRgbColorCount().
RT_DBaseWriteCSV
Code:
RT_DBaseWriteCSV(String DB, String CSV, String "Separator"=",",String "StrDelimiter"="\"",Int "StartField"=0,Int "EndField"=last_field
        Int "Low"=0,Int "High"=Last_Record,Bool "Append"=False,String "Fmt"="")

    This function will write a consecutinve number of fields from a DBase to CSV values in text file, for each DBase record between
    records low and high inclusive. 

    DB,           FileName of an RT_Stats DBase file.
    CSV,          FileName of an output text CSV (Comma Separated Value) file.
    Separator     Default "," ie comma separator (first character only, Chr()'s 0, 13, 10, and 34 [Double Quote] illegal).
                  Default Separator "," (Comma).
                   
    StrDelimiter  Default = "\"" ie single character string Double Quote. String delimiters written around string fields when written to CSV.
                  StrDelimiter (String Delimiter) can be multiple characters (empty string "" illegal, also cannot contain the Separator 
                  character nor SPACE or TAB), Default is a Double Quote single character string.
                  DBase string values CANNOT contain StrDelimiter string, ie for default StrDelimiter, strings cannot contain a double quote
                  character string. So long as the StrDelimiter does not appear within any DB string, nearly any StrDelimiter can be 
                  used, eg "@@@" is a 3 character StrDelimiter that you could use in place of double quote string delimiters, where the 
                  string values could then contain a double quote character, in such a case you could enclose CSV strings as in 
                  @@@Some text that contains a " double quote.@@@.
                  NOTE, StrDelimiter IS case sensitive, so if using alphabetic characters they have to match exactly.
                  
    StartField    Default = 0.
    EndField      Default = last field in DBase record (By default, all fields are written to CSV file).
                  Above StartField and EndField args allow writing of limited number of CONSECUTIVE fields within a record.

    Append        Default False. When True, append if CSV file already exists. 

    Fmt           Default, "". The Fmt string provides a little bit of optional formatting for field types Int, Bin and Bool.
                  The length of Fmt string can be up to EndField-StartField+1, ie 1 character for each of the selected fields.
                  A single character can be set for each of the fields, first one affects StartField, and the last one affects
                  EndField (assuming all characters are set). A shorter Fmt string only affects those fields for the characters that 
                  exist in the Fmt string.
                  A SPACE (' ') or '.' Fmt character uses default formatting behaviour (Proper Case for Bool, ie 1st charcter is upper 
                  case, remainder are lower case).
                  Type Int, If ' ' or '.' then default eg "-1". 
                    If 'x' then print fields as lower case Hex eg ffffffff.
                    If 'X' then print fields as upper case Hex eg FFFFFFFF.
                    If '$' then print fields as upper case Hex preceded by a '$' Dollar character eg  eg $FFFFFFFF.
                  Type Bool. If ' ' or '.' then default eg "True".
                    if 'l' or 'L' then lower case eg 'true'.                    
                    if 'u' or 'U' then upper case eg 'TRUE'.                    
                  Type Bin, If ' ' or '.' then default eg "255". 
                    If 'x' then print fields as lower case Hex eg ff.
                    If 'X' then print fields as upper case Hex eg FF.
                    If '$' then print fields as upper case Hex preceded by a '$' Dollar character eg  eg $FF.
                  Types String, Float (or internal use type Double) will error if using anything other than '.' or ' '.
                                        

    Function returns Int, the number of records added to the CSV file.

    Example:-
        CSVTXT="""
          1,42.5,$FF,true, "D:\OUT\Test_000001.d2v"   # Comment
          2,43.5,$FE,false,"D:\OUT\Test_000002.d2v"
          3,44.5,$FD,true, "D:\OUT\Test_000003.d2v"
          4,45.5,$FC,false,"D:\OUT\Test_000004.d2v"
         -1,45.5,$FC,false,"D:\OUT\Test_000004.d2v" 
        """
        
        DB     = "My.DB"
        CSVIN  = "CSVIN.txt"
        CSVOUT = "CSVOUT.txt"  # Output CSV file.
        RT_WriteFile(CSVIN,"%s",CSVTXT)       # Create test Input CSV
        RT_DBaseAlloc(DB,0,"ifnbs512")        # Allocate DBase with 0 pre-allocated records, 5 fields, Int, Float, Bin, Bool and String[512].
        Read=RT_DBaseReadCSV(DB,CSVIN)
        Written=RT_DBaseWriteCSV(DB,CSVOUT,Append=false,Fmt="$.x..")        
        S=RT_String("Read = %d written=%d",read,Written)   # Shows "Read=5 Written=5".
        MessageClip(S)
RT_DBaseFindSeq (same functionality as DB_FindSeq script function here:- https://forum.doom9.org/showthread.p...16#post1799116 )
Code:
RT_DBaseFindSeq(String DB,Int S_Field,Int E_Field,Int Frame,Int "Low"=0,Int "High"=RT_DBaseRecords(DB)-1)
 
 RT_DBaseFindSeq Returns clip (or record) number containing movie frame Frame, using Binary Search.
   
   DB,      DBase FileName,
   S_Field, DB field that contains the first frame of the record clip/sequence (within entire movie).
   E_Field, DB field that contains the Last frame of the record clip/sequence (within entire movie).
   Low,     Default 0. Lowest record number to scan (likely almost always 0).
   High,    Default RT_DBaseRecords(DB)-1. Hightest record number to scan (likely almost always as default).
   
   Return of -1 = RECORD NOT FOUND.
   
   eg If you have 4 clips in DBase, each of 10 frames then fields should contain data EXACTLY as below (must be ordered).
      Record     S_Field   E_Field
         0           0        9
         1          10       19
         2          20       29
         3          30       39
RT_DBaseRgbColorCount
Code:
RT_DBaseRgbColorCount(String DB, clip c,Int "n"=current_frame)
    RT_DBaseRgbColorCount, creates an RT_Stats DBase containing data on colors contained a video clip frame.
    RGB24 and RGB32 only.
    DB, Name of DBase.
    c,  Clip.
    n,  Default current_frame, frame to count RGB (will use current_frame in runtime environment).
    Returns number of records in DBase, ie number of unique colors on frame n.
    DBase Fields:-
        ColorField = 0
        CountField = 1
        
    Example:-
        DB="COLS.DB"
        FRAME=0
        ColorField = 0
        CountField = 1
        ###
        Avisource("OutAvi.Avi").ConvertToRGB24.Trim(FRAME,-1)
        Cnt=RT_DBaseRgbColorCount(DB,Last,0)                  # Count colors of frame 0  (originally FRAME). 
        RT_DBaseQuickSort(DB,Field=CountField,Field2=ColorField)  # Sort primarily by count, and then by color (ascending)
        MostCommonColor=RT_DBaseGetField(DB,Cnt-1,ColorField)     # Last one in DBase (last record)
        MostCommonColorCount=RT_DBaseGetField(DB,Cnt-1,CountField)
        RT_Subtitle("Unique Colors=%d\nMost Common Color=$%X (Count=%d)",Cnt,MostCommonColor,MostCommonColorCount)
        Overlay(BlankClip(Width=64,Height=64,Color=MostCommonColor,Length=1).LetterBox(2,2,2,2,$FF00FF),x=(width/2)-34,y=(height/2)-34)
        return last
__________________
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; 4th March 2017 at 06:20.
StainlessS is offline   Reply With Quote
Old 5th March 2017, 03:04   #383  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RT_Stats v2.0 Beta 09, new version, see MediaFire (or SendSpace) in sig below this post.

Code:
	v2.0 Beta 9. 04 Mar 2017.
			Added args to RT_DBaseRgbColorCount(), x,y,w,h, Mask, MaskMin, MaskMax, msb.
Code:
RT_DBaseRgbColorCount(String DB, clip c,Int "n"=current_frame,Int "x"=0,Int "y"=0,Int "w"=0,int "h"=0
            \ clip "Mask"=unused,Int "MaskMin"=128,int "MaskMax"=255,Int "msb"=8)
    RT_DBaseRgbColorCount, creates an RT_Stats DBase containing data on colors contained a video clip frame.
    RGB24 and RGB32 only.
    
    DB,       Name of DBase.
    c,        Clip.
    n,        Default current_frame, frame to count RGB (will use current_frame in runtime environment).
    x,y,w,h,  All default 0 (full frame). Area to test, as in crop.
    Mask,     Default unused. PLANAR only, If Mask set, and MaskMin <= MaskLumaPixel <= MaskMax then c pixel is counted, otherwise not.
    MaskMin   Default 128. See above.
    MaskMax   Default 255. See above.
    msb       Default 8. Range 1 -> 8 only. 
              Most Significan Bits of color primaries. If default, then possible return is up to about 16 million colors
              (2 ^ (8 * 3)). If less than default 8, the number of possible colors is reduced so if eg msb=4 then
              $FF and $F0 will be counted as the same, as they are both converted to $0F via shifting.
              On writing to DBase after  scan, would then be converted back up to $F0, again via shift with no rounding.   
    
    
    Returns number of records in DBase, ie number of unique colors on frame n in area x,y,w,h taking Mask args into account.
    If using Mask, then good idea to check return value against 0, to see if it found any pixels that were both in the x,y,w,h area
    and also complied with Maskmin, MaskMax requirement. 
    
    DBase Fields:-
        ColorField = 0
        CountField = 1
        
    Example:-
        DB="COLS.DB"
        FRAME=0
        ColorField = 0
        CountField = 1
        ###
        Avisource("OutAvi.Avi").ConvertToRGB24.Trim(FRAME,-1)
        Cnt=RT_DBaseRgbColorCount(DB,Last,0)                      # Count colors of frame 0 (originally FRAME). 
        RT_DBaseQuickSort(DB,Field=CountField,Field2=ColorField)  # Sort primarily by count, and then by color (ascending)
        MostCommonColor=RT_DBaseGetField(DB,Cnt-1,ColorField)     # Last one in DBase (last record)
        MostCommonColorCount=RT_DBaseGetField(DB,Cnt-1,CountField)
        RT_Subtitle("Unique Colors=%d\nMost Common Color=$%X (Count=%d)",Cnt,MostCommonColor,MostCommonColorCount)
        Overlay(BlankClip(Width=64,Height=64,Color=MostCommonColor,Length=1).LetterBox(2,2,2,2,$FF00FF),x=(width/2)-34,y=(height/2)-34)
        return last
__________________
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 7th June 2017, 16:18   #384  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hi guys,

Due to PM, am releasing non (release) prepped version of SirPlant() [first posted here]:-
Find it here:- LINK REMOVED


Not sure but it may need latest RT_Stats.

Remember that I fixed at least one bug in version supplied in RT_Stats AVS folder (v2.0 beta 4).

Dont have time to do anything other than supply avs as it currently stands. (I've used it several times with VGood results).
__________________
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; 10th September 2017 at 18:55.
StainlessS is offline   Reply With Quote
Old 7th June 2017, 16:46   #385  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hi again,
just remembered that I did some kind of test addition to RT_Stats that SirPlant relies upon (one of the two test additions will likely be removed
when I decide which works best), so SirPlant as supplied in previous post may not work, so here new version RT (not prepped for release)
that I am putting up in StainlessS @ Mediafire below in sig, and also on SendSpace.

Hope it works ok EDIT: I use it constantly.

PS, the SecurityCamMotionDetect.avs (or whatever its called) has been updated a bit too.

Am removing link in prev post.
__________________
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; 7th June 2017 at 17:02.
StainlessS is offline   Reply With Quote
Old 9th June 2017, 09:15   #386  |  Link
doomwake
Registered User
 
Join Date: Jun 2017
Posts: 5
Quote:
Originally Posted by StainlessS View Post
Hi again,
just remembered that I did some kind of test addition to RT_Stats that SirPlant relies upon (one of the two test additions will likely be removed
when I decide which works best), so SirPlant as supplied in previous post may not work, so here new version RT (not prepped for release)
that I am putting up in StainlessS @ Mediafire below in sig, and also on SendSpace.

Hope it works ok EDIT: I use it constantly.

PS, the SecurityCamMotionDetect.avs (or whatever its called) has been updated a bit too.

Am removing link in prev post.
Sorry about the PM StainlessS I didn't mean to get on your bad side already. I didn't think you would mind the private messages because i'm only working with a part of RT-Stat and didn't want to take up post here in this thread but if you don't want the PM I will make a separate post about this and post the link when I have it.

Let me know if you would rather post the updates here but I think it would be better in its own thread if you would keep up with it.
doomwake is offline   Reply With Quote
Old 13th June 2017, 04:45   #387  |  Link
doomwake
Registered User
 
Join Date: Jun 2017
Posts: 5
SirPlant addon script

StainlessS, Mr wizard Please help advance your script a little more if you have a little free time. Its working out great! almost got all the frames besides a few and I'm wondering if you could add part of your FrameRep to get the rest that sirplant misses? If you could maybe add something that looks for frames that still have the logo and replace it with the best match for those frames? since you already have a logo script and SecurityCamExtractMotion script that locks onto a part of the frame and the framerep script. you could have it lock onto the logo and framerep with a frame from the replace clip that best matchs it? I would greatly appraite it and it should finish it and work great for tv rips. I cut out the logo for sirplant but Im wondering if you could at it to the last step SirPlant_Splice?

THank you,
Corey
doomwake is offline   Reply With Quote
Old 17th June 2017, 02:57   #388  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@ Doomwake, I'm a little bit under the weather at the mo, will answser in good time.

Happy to see that your post has now been approved. (some kind of additional "security", I'm guessin.)
__________________
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 17th June 2017, 15:23   #389  |  Link
danfgtn
Registered User
 
Join Date: Dec 2016
Posts: 9
Since no one seems to want to approve my topic, can I ask a question here about avisynth? This is one of the topics with the most recent answers.
danfgtn is offline   Reply With Quote
Old 18th June 2017, 01:44   #390  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
Originally Posted by danfgtn View Post
Since no one seems to want to approve my topic, can I ask a question here about avisynth? This is one of the topics with the most recent answers.
I think that is a bad idea. It is usually called "hijacking" a thread, which is considered bad form. Also, you won't get the answers you would get from starting your own thread, because people who might be interested in your particular problem may not be reading this thread (I only read about 5% of the posts in this forum).

I'm not sure why what you posted didn't "stick," but I suggest you try again.
johnmeyer is offline   Reply With Quote
Old 18th June 2017, 16:50   #391  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
danfgtn,
Yep best wait for your own thread to be approved, there have recently been other site issues where posts have not been approved:- https://forum.doom9.org/showthread.php?t=174663

Give a moderator a PM about 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 offline   Reply With Quote
Old 18th June 2017, 22:33   #392  |  Link
danfgtn
Registered User
 
Join Date: Dec 2016
Posts: 9
I understand, but I accidentally sent the topic twice already, if I send it again, I think it might be a problem. Thank you anyway.
danfgtn is offline   Reply With Quote
Old 19th June 2017, 20:53   #393  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Doomwake,

Have been struggling with how best to answer your post.
All of the plugins/scripts you mentioned, do not do what you presume that they do.
The de-logo script (S_ExLogo), only blurs out the area that you tell it to blur, it does no logo detection at all.
FrameRep, replaces frames back into same position that they were originally gotten from, using the same frames command file.
SecurityCamExtractMotion script is nothing whatever to do with what you want.

If the SirPlant script is not working, then (most likely) either args were not best set, or the clips were not in sync.
I would suggest that your only option is to edit manually (replacing the frames that were probably deemed 'Out Of Sync' by SirPlant.
(I have no idea how many, nor whether runs of frames or single frames were skipped).
SirPlant with Strict=False, already allows for every 2nd frame in a sequence to be up to 1 frame out of sync, if editing by hand you would
need to decide how to deal with out of sync frames yourself, and keep in mind that audio will likely end up out of sync if not careful.

Save result clip from SirPlant_Slice.avs (SRC_AUDIO=False, if Strict==False).
Save result clip from SirPlant_ShowNonReplaced.avs, (Frames from replace clip that were not inserted into src clip).

You need to save audio somehow (maybe just to a variable and then audioDub back again later), and simply use trim and splice in hand edit.

Some suggestions for worst case scenario settings

Code:
# SirPlant_Client.avs

Import("SirPlant.avs")

srcFN    = "S2.avi"                # Source clip
repFN    = "S1.AVI"                # Replace clip, Holds sequences that will replace those in source clip.
                                   # Sequences in Replace clip should be in SAME order as in source clip.
                                   # Clips must be same size, colorspace.
                                   # When splicing sequences with Prune (later) everything must be similar, audio etc,
                                   # also audio should both be normalized for similar voume levels, this detection stage ignores audio.
                                   # In later script, Prune will replace with both video and audio from replace clip.
srcARR      = SRCFN+".ARR"         # Name of RT_QwikScan FingerPrint Array
srcNxtARR   = SRCFN+".Next.ARR"    # Name of RT_QwikScan Locator Next Array (Next == scan forward Array)
repARR      = REPFN+".ARR"         # Name of RT_QwikScan FingerPrint Array
repNxtARR   = REPFN+".Next.ARR"    # Name of RT_QwikScan Locator Next Array (Next == scan forward Array)
#
src         = AVISource(srcFN)
rep         = AVISource(repFN)
#
Th          = 0.8                  # Default 0.9(not close matching frames maybe about 0.8)
Th2         = 0.65                 # Default 0.75(not close matching frames maybe about 0.65)
LUMATOL     = 12.0                 # Default 8.0(not close matching frames maybe up to about 16.0)
MatchLen    = 32                   # Default 60(Minimum sequence length that must match (frames). Default 60(not close matching frames maybe about 32)
SEARCHSTEP  = 4                    # Default MatchLen/4(not close matching frames maybe about 4) Frames to step after match failure.
STRICT      = False                # Default True=strict 1:1 matching of frames, False=allow slight mismatch ie missing/extra frames in replacement clip.
VERBOSITY   = 5                    # Debug output verbocity level, to DebugView.
INSMODE     = 0                    # Default 0=Replace Only, 1=Insert Extras Only, 2=Replace and Insert Extras
BLKW        = 64                   # default 64
BLKH        = 64                   # default BLKW
OLAPX       = 0                    # default BLKW/2
OLAPY       = 0                    # default BLKH/2

X           =  4                   # Avoid edge noise or logos. (All default 0)
Y           =  4
W           = -4
H           = -4                   

### !!! MUST SET TRUE FIRST, THEN FALSE to RUN !!! ###
CREATE      = False               # Set True to Create QWikScan arrays for SirPlant. (View progress in DebugView)

(CREATE) ? RT_QwikScanCreate(Src,srcARR,"",srcNxtARR,debug=true,x=X,y=Y,w=W,h=H) : NOP  # Only need create these once, Re-Create if change coords or clips.
(CREATE) ? RT_QwikScanCreate(rep,RepARR,"",repNxtARR,debug=true,x=X,y=Y,w=W,h=H) : NOP

### !!! USE DEBUGVIEW !!! ###
(!CREATE) ? SirPlant(src,rep,srcARR,srcNxtARR,repARR,repNxtARR,
                \ Th=Th,Th2=Th2,MatchLen=MatchLen,SearchStep=SEARCHSTEP,LumaTol=LUMATOL,Strict=STRICT,InsMode=INSMODE,VerBosity=VERBOSITY,
                \ Blkw=BLKW,BlkH=BLKH,OLapX=-OLAPX,OLapY=OLAPY
                \ ) : NOP

return Messageclip("All Done")
You would need set X,Y,W,H coords for logo avoidance, or crop off during detect stage.


Code:
# SirPlant_Splice.avs

vSrc="S2.avi"
vRep="S1.avi"

#
Project="Default"
Cmd=Project+"_Command.txt"
SHOW        = True
SRC_AUDIO   = False         # Use only Source audio. ONLY if STRICT and not inserting EXTRA replacement ranges, else out of sync audio likely
                            # Use SRC_AUDIO = True, Only if STRICT==TRUE at detector stage.
                            
STACK       = False         # Same for STACK, only True if Strict and no EXTRA replacement ranges.

NORM=(!SHOW && !STACK && !SRC_AUDIO)


A=AVISource(vSrc)
D=AVISource(vRep)

A = (NORM) ? A.Normalize : A
D = (NORM) ? D.Normalize : D

B=A     C=A
E=D     F=D

A = (SHOW) ? A.AddBorders(0,0,0,16,$000000) : A
B = (SHOW) ? B.AddBorders(0,0,0,16,$404040) : B
C = (SHOW) ? C.AddBorders(0,0,0,16,$808080) : C
D = (SHOW) ? D.AddBorders(0,0,0,16,$00FF00) : D
E = (SHOW) ? E.AddBorders(0,0,0,16,$FF0000) : E
F = (SHOW) ? F.AddBorders(0,0,0,16,$0000FF) : F

SrcAudio=A.KillVideo

Nicks="""
    InterveningSource=0
    MatchingSource=1
    EndRangeSource=2
    MatchingReplacement=3
    ExtraReplacement=4
    EndRangeReplacement=5
"""


Prune(A,B,C,D,E,F,cmd=Cmd,NickName=Nicks,Show=SHOW)

(SRC_AUDIO) ? AudioDub(SrcAudio) : NOP

return (STACK) ? StackVertical(A,Last) : Last

Code:
# SirPlant_ShowNonReplaced.avs

repFN="s1.AVI"

Project="Default"

Cmd=Project+"_UnUsed.txt"

A=AVISource(repFN)

Nicks="""
    ShortRangeLessThanMinReplace=0
    SkippedExtras=1
"""
SHOW=True

Prune(A,A,cmd=Cmd,NickName=Nicks,Show=SHOW)
Good luck

EDIT: You could lower Th, Th2 and MatchLen even lower than suggested, but there is a small chance that the Moon could crash into the Earth tomorrow afternoon, if you do.

EDIT: Examining logs could tell you why frames were not replaced. (DebugView with Verbosity=5, is most comprehensive)
__________________
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 June 2017 at 21:29.
StainlessS is offline   Reply With Quote
Old 10th September 2017, 18:59   #394  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
v2.0. beta 11, 10 Sept 2017. avs v2.58, v2.6, avs+v2.6 x64 versions, + source. See MediaFire and SendSpace below this post.

Code:
    v2.0. beta 11, 10 Sept 2017.
		Bugfix, RT_DBaseReadCSV write fail on zero length CSV string.
Or here:- http://www.mediafire.com/file/dhrrng...1_20170910.zip
__________________
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 7th November 2017, 09:53   #395  |  Link
doomwake
Registered User
 
Join Date: Jun 2017
Posts: 5
Hey StainlessS,
I was wondering how;s it going and if you have work on the scripts anymore since the last time we talked?
Also If you have some free time now to work on this with me to perfect it? I have time now if you do just let me know
Thanks,
Corey

Quote:
Originally Posted by StainlessS View Post
Doomwake,

Have been struggling with how best to answer your post.
All of the plugins/scripts you mentioned, do not do what you presume that they do.
The de-logo script (S_ExLogo), only blurs out the area that you tell it to blur, it does no logo detection at all.
FrameRep, replaces frames back into same position that they were originally gotten from, using the same frames command file.
SecurityCamExtractMotion script is nothing whatever to do with what you want.

If the SirPlant script is not working, then (most likely) either args were not best set, or the clips were not in sync.
I would suggest that your only option is to edit manually (replacing the frames that were probably deemed 'Out Of Sync' by SirPlant.
(I have no idea how many, nor whether runs of frames or single frames were skipped).
SirPlant with Strict=False, already allows for every 2nd frame in a sequence to be up to 1 frame out of sync, if editing by hand you would
need to decide how to deal with out of sync frames yourself, and keep in mind that audio will likely end up out of sync if not careful.

Save result clip from SirPlant_Slice.avs (SRC_AUDIO=False, if Strict==False).
Save result clip from SirPlant_ShowNonReplaced.avs, (Frames from replace clip that were not inserted into src clip).

You need to save audio somehow (maybe just to a variable and then audioDub back again later), and simply use trim and splice in hand edit.

Some suggestions for worst case scenario settings

Good luck

EDIT: You could lower Th, Th2 and MatchLen even lower than suggested, but there is a small chance that the Moon could crash into the Earth tomorrow afternoon, if you do.

EDIT: Examining logs could tell you why frames were not replaced. (DebugView with Verbosity=5, is most comprehensive)
doomwake is offline   Reply With Quote
Old 7th November 2017, 20:50   #396  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
I have time now
Lucky you !

Got me a gigantic backlog of stuff. No, no further work on SirPlant, nothing more I can think of to improve matters, its all down to settings really,
if frames dont match, out of sync, then they dont match or are out of sync, not a lot I can do about that.
I'm trying to get back to RT_Stats so I can release final v2.0 and maybe bow out from Avisynth, at least spend less time on it, got me other
stuff I've been wanning to do for ages.

ssS
__________________
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; 7th November 2017 at 22:34.
StainlessS is offline   Reply With Quote
Old 6th August 2018, 11:29   #397  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
PlanetCrop() v1.03, update, runs under either AVS+ or GSCript.
Will be included in RT_Stats v2.0 Beta12
Code:
Function PlanetCrop(String "FileName",int "Baffle",Int "BlackRange",int "Grow_W",int "Grow_H",Float "FAR", \
        Float "AutoLevelStrength",bool "ShowAutoLevel",bool "KeepMargin",bool "ShowMargin",bool "ShowBorder",bool "Debug",\
        int "Matrix",bool "ShowDetectOnly") {
# ------------
    VERS="PlanetCrop v1.03 - 02 Aug 2018"       # Requires GScript, RT_Stats v1.10.
# ------------
# Given a series of time lapse planetoid images moving across frame (due to earth rotation), locates those images in frame, crops out
# and splices them all together into a video clip of required Frame Aspect Ratio, 1 FPS, with optional Auto Luma Levelling.
#     First scans each image establishing maximum dimensions for whole sequence (after cropping out the planets). Optionally 'grows' those
# dimensions to maintain some of the area around the cropped planets. A 'canvas' size is then established to contain the now maximum
# dimensions and respecting the desired Frame Aspect Ratio, synthetic black borders are added where necessary.
# Borders are the synthetic areas added to maintain aspect ratio and can be hi-lited in red. Margins are areas that use the
# original image content instead of synthetic black borders (where possible), they replace synthetic borders, and can be hi-lited
# in green. Margins are the areas between the established crop coords and synthetic borders.
# --------------------------------------
# Args:-
#  Filename: Default "*.BMP|JPG|JPE|JPEG|PNG|TGA|TIF|GIF|TIFF". Image Path and wildcard with mulitple pipe separated extensions.
#  Baffle: Default 8. Number of scanlines that must break a threshold to be accepted as 'planet'. Avoids noise.
#   Suggest about 4 -> 32. Must NOT be greater than diameter of planets (or anywhere near not a good idea).
#  BlackRange: Default 32. Where background (sky) can vary in luminance by a significant amount. When creating detection clip, will
#    use eqivalent to Levels(YPlaneMin+BlackRange-1,1.0,YPlaneMin+BlackRange,0,255,Coring=False) for detecting planet.
#  Grow_W,Grow_H: Default 128. Size in pixels by which to 'grow' the accumulated maximum dimensions once all planets have been identified.
#  FAR: Default 4.0/3.0. Frame Aspect Ratio.
#  AutoLevelStrength: Default 0.0. Auto luma leveling, range 0.0 -> 1.0. 0.0 is OFF.
#  ShowAutoLevel: Default False. If true then shows Auto leveling on right hande side of image ONLY.
#  KeepMargin: Default True. When padding to maintain Frame Aspect Ratio, tries to keep image instead of adding synthetic borders.
#  ShowMargin: Default False. If True, shows kept margins in Green.
#  ShowBorder: Default False. When padding to maintain Frame Aspect Ratio, borders are shown in red.
#  Debug: Default False. Show debug info via DebugView. Need DebugView: http://technet.microsoft.com/en-gb/sysinternals/bb545027
#  Matrix: Default=2(PC601), 3=PC709. Used in conversion of RGB to YUV-Y. (Dont use 0 or 1, TV levels)
#  ShowDetectOnly: Default False. If True, then ONLY returns equivalent Detection clip that would be used, created using BlackRange.
#    May assist in selecting BlackRange. NOTE, All images MUST be same size else error as no cropping done. Any non-black in the detect
#    clip will be detected as possible planet (if Baffle consecutive scanlines present, then IS planet).
#

    myName      = "PlanetCrop: "
    IsAvsPlus=(FindStr(UCase(versionString),"AVISYNTH+")!=0)    HasGScript=RT_FunctionExist("GScript")
    Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))

    DEBUG_YInRangeLocate=False
    FileName = Default(FileName,"*.BMP|JPG|JPE|JPEG|PNG|TGA|TIF|GIF|TIFF")
    Baffle=Default(Baffle,8)
    BlackRange=Default(BlackRange,32)                   # YPlaneMin + BlackRange and above, is possible planet
    Grow_W=Default(Grow_W,128)
    Grow_H=Default(Grow_H,128)
    FAR=Float(Default(FAR,4.0/3.0))
    AutoLevelStrength=Float(Default(AutoLevelStrength,0.0))
    ShowAutoLevel=Default(ShowAutoLevel,false)
    KeepMargin=Default(KeepMargin,True)
    ShowMargin=Default(ShowMargin,False)
    ShowBorder=Default(ShowBorder,False)
    DEBUG=Default(DEBUG,False)
    Matrix=Default(Matrix,2)                            # PC601
    ShowDetectOnly=Default(ShowDetectOnly,False)        #
    # Lesser changed stuff Hardcoded
    BORDER      = $FF0000                               # Color for replaced borders.
    MARGINBORDER= $00FF00                               # Color for KEEP_MARGIN borders.
    FPS         = 1.0                                   # Whatever.
    WMOD        = 2                                     # For Canvas Width
    HMOD        = 2                                     # For Canvas Height
    OUT_FILE    = "PLANETCROP.List"
    Assert(Baffle>0,"PlanetCrop: Baffle must be 1 or more")
    Assert(BlackRange>=0,"PlanetCrop: BlackRange must be 1 or more")
    Assert(Grow_W>=0,"PlanetCrop: Grow_W Cannot be -ve")
    Assert(Grow_H>=0,"PlanetCrop: Grow_H Cannot be -ve")
    Assert(FAR>0.0,"PlanetCrop: FAR must be greater than 0.0")
    Assert(AutoLevelStrength>=0.0 && AutoLevelStrength <= 1.0,"PlanetCrop: AutoLevelStrength must be 0.0 -> 1.0")
    Assert(Matrix>=2 && Matrix<=3,"PlanetCrop: Bad Matrix, suggest 2=PC601,3=PC709")
    ShowAutoLevel=(AutoLevelStrength==0.0) ? false : ShowAutoLevel
    PCStart=RT_Timer()
    #
    GS="""
        #
        if(DEBUG){ RT_Debug("PlanetCrop:",false) RT_Debug("PlanetCrop:",VERS,"- By StainlessS",false) RT_Debug("PlanetCrop:",false) }
        picclip = 0                                                                 # Dummy for now
        result=RT_WriteFileList(FileName,OUT_FILE)                                  # Create a listing file of Pic files
        Assert((result!=0), "No files found for "+FileName)
        FILELIST=RT_ReadTxtFromFile(OUT_FILE)                                       # Get list of files
        NFILES=RT_TxtQueryLines(FILELIST)                                           # Query Number of lines in String ie number of files.
        if(DEBUG){RT_Debug("PlanetCrop:","Found files = " + String(NFILES),false) RT_Debug("PlanetCrop:",false)}
        # Prescan to ascertain max wid/hit of all files, also Autocrop & Auto Levels
        MAXH=0 MAXW=0                                                               # init max wid and hit
        MINLUM=256 MAXLUM= -1
        CROPCOORDS=""                                                               # Clear results array (string)
        AUTOLEVEL=(AutoLevelStrength>0.0)                                           # Adjust using Levels.
        if(ShowDetectOnly) {
            For(i=0,NFILES-1) {
                FN=RT_TxtGetLine(FILELIST,i)                                        # Filename of pic file i
                k=ImageReader(FN,end=0).ConvertToRGB32()
                k.RT_YStats(0,x=4,y=4,w=-4,h=-4,threshold=0.2,matrix=Matrix,flgs=3,Prefix="PC_")    # Get GlobVars PC_yMin & PC_yMax, avoid edges
                k=k.Levels(PC_yMin+BlackRange-1,1.0,PC_yMin+BlackRange,0,255,Coring=false)
                picclip = (IsClip(picclip)) ? picclip ++ k : k
            }
        } else {
            For(i=0,NFILES-1) {
                FN=RT_TxtGetLine(FILELIST,i)                                            # Filename of pic/vid file i
                (DEBUG)?RT_Debug("PlanetCrop:",String(i+1)+"/"+String(NFILES)+") Getting File dimensions",FN,false):NOP
                k=ImageReader(FN,end=0).ConvertToRGB32()
                OrgW=k.width    OrgH=k.height
                # For QPC
                k.RT_YStats(0,x=4,y=4,w=-4,h=-4,threshold=0.2,matrix=Matrix,flgs=3,Prefix="PC_")    # Get GlobVars PC_yMin & PC_yMax, avoid edges
                if(MINLUM>PC_yMin) {MINLUM=PC_yMin}
                if(MAXLUM<PC_yMax) {MAXLUM=PC_yMax}
                IRL=k.RT_YInRangeLocate(n=0,Baffle=Baffle,Matrix=Matrix,Prefix="PC_",debug=DEBUG&&DEBUG_YInRangeLocate,lo=PC_yMin+BlackRange-1,hi=255)
                Assert(IRL==True,"PlanetCrop: Cannot Locate Planet")
                PCS="PC_X="+String(PC_X)+" PC_Y="+String(PC_Y)+" PC_W="+String(PC_W)+" PC_H="+String(PC_H)
                CROPCOORDS=RT_TxtAddStr(CROPCOORDS,PCS)
                If(MAXW<PC_W) {MAXW=PC_W}
                If(MAXH<PC_H) {MAXH=PC_H}
                if (DEBUG) {                                                # KEEP main debug messages together
                    RT_Debug ("PlanetCrop:","Orig Width =",String(orgW),"Orig Height =",String(OrgH),false)
                    if((PC_W != OrgW) || (PC_H != OrgH)) {                  # Was Caused by AUTOCROP
                        RT_Debug("PlanetCrop:","Crop Width =",String(PC_W),"Crop Height =",String(PC_H),false)
                    }
                    RT_Debug("PlanetCrop:","MAX Width So Far =",String(MAXW)  ,"MAX Height So Far =",String(MAXH),false)
                    RT_Debug("PlanetCrop:","MIN LUMA  So Far =",String(MINLUM)," MAX LUMA   So Far =",String(MAXLUM),false)
                    RT_Debug("PlanetCrop:"," ----------------------------- ",false)            # line separator
                }
            }
            if(Grow_W>0 || Grow_H > 0) {
                (DEBUG)?RT_Debug("PlanetCrop:","Enlarging Max Width,Height to enlarge canvas",false):NOP
                MAXW=MAXW+Grow_W
                MAXH=MAXH+Grow_H
            }
            maxFAR = Float(MAXW) / MAXH
            if(FAR >= maxFAR) {
                # Required Frame Aspect Ratio greater or same as maximum accumulated dimensions. Need to pad horizontal
                    canvasheight    = Int((MAXH  + (HMOD-1)) / HMOD) * HMOD                 # round UP to next multiple of HMOD
                    canvaswidth     = Int((canvasheight * FAR + (WMOD-1)) / WMOD) * WMOD    # round UP to next multiple of WMOD
            } else {    # Need to pad vertical
                    canvaswidth     = Int((MAXW  + (WMOD-1)) / WMOD) * WMOD
                    canvasheight    = Int((canvaswidth / FAR + (HMOD-1)) / HMOD) * HMOD
            }
            if(DEBUG){
                RT_Debug("PlanetCrop:","SETTING CanvasWidth =",String(canvaswidth)," CanvasHeight =",String(canvasheight),false)
                RT_Debug("PlanetCrop:","Clip Global MINLUM =",String(MINLUM),"  MAXLUM =",String(MAXLUM),false)
                RT_Debug("PlanetCrop:"," ----------------------------- ",false)       # line separator
            }
            CSMin = 0   CSMax = 255     Almin = CSMin   AlMax=CSMax
            LBORDER=BORDER RBORDER=BORDER           # Init Default Show border colors
            if (AUTOLEVEL || !ShowMargin || !Showborder) {                                      # We need Minlum
                if (AUTOLEVEL) {    # AutoLevel based on clip global MINLUM & MAXLUM
                    ALMin = Int(CSMin - ((CSMin - MINLUM) * AutoLevelStrength) + 0.5) # Round Up
                    ALMax = Int(CSMax - ((CSMax - MAXLUM) * AutoLevelStrength))       # Round down
                }
                BACKGROUND=(MINLUM*256+MINLUM)*256+MINLUM                           # Min Luma as RGB color for non autolevel border
                if(!Showborder) { # Show CSMin (0) where autoleveled else BACKGROUND (MINLUM)
                    RBORDER = (AUTOLEVEL)       ? CSMin         : BACKGROUND                    # Right half Border
                    LBORDER = (ShowAutoLevel)   ? BACKGROUND    : RBORDER                       # Left half Border
                }
            }
            For(i=0,NFILES-1) {                         # Cropping and adding borders, Splicing to clip
                FN=RT_TxtGetLine(FILELIST,i)            # Filename of pic file i
                if(DEBUG){RT_Debug("PlanetCrop:",string(i+1)+"/"+String(NFILES)+")","Processing File",FN,false)}
                k=ImageReader(FN,end=0).ConvertToRGB32()
                OrgW=k.width    OrgH=k.height
                Eval(RT_TxtGetLine(CROPCOORDS,i))
                Left =(canvaswidth-PC_W) / 2        Right = canvaswidth-PC_W - Left     # Borders needed to respect FAR
                Top  =(canvasheight-PC_H) /         2Bot  = canvasheight-PC_H-Top
                Left2=0 Right2=0    Top2=0  Bot2=0                  # Init margin borders
                if(KeepMargin) {                # Get margins (available image usable instead of artificial border [maintain FAR])
                    Left2   =   ((PC_X<Left) ? PC_X : Left)         # margin limited by how much image is available
                    Left=Left-Left2                                 # Reduce artificial border by margin
                    Right2  =   (((OrgW-PC_X-PC_W)<Right) ? (OrgW-PC_X-PC_W) : Right)   Right=Right-Right2
                    Top2    =   ((PC_Y<Top) ? PC_Y : Top)                               Top=Top-Top2
                    Bot2    =   (((OrgH-PC_Y-PC_H)<Bot) ? (OrgH-PC_Y-PC_H) : Bot)       Bot=Bot-Bot2
                    if(!ShowMargin) { # Reduce cropping to keep original image in margin area, ELSE AddBorders show green margins.
                            PC_X=PC_X-Left2 PC_W=PC_W+Left2+Right2  PC_Y=PC_Y-Top2  PC_H=PC_H+Top2+Bot2
                            Left2=0 Right2=0    Top2=0  Bot2=0          # Not using Margin Addborders
                    }
                }
                (DEBUG)? RT_Debug("PlanetCrop:","Crop("+String(PC_X)+","+String(PC_Y)+","+String(PC_W)+","+String(PC_H)+")",false) : NOP
                k=k.Crop(PC_X,PC_Y,PC_W,PC_H)
                tmpw=(CanvasWidth/2) - Left - Left2                 # Canvas centered rather than cropped planet centered
                LeftClip = k.Crop(0,0,tmpw,-0)
                RightClip= k.Crop(tmpw,0,-0,-0)
                if (AUTOLEVEL) {
                    (DEBUG)?RT_Debug("PlanetCrop:","Levels("+String(ALMin)+",1.0,"+String(AlMax)+","+String(CSMin)+","+String(CSMax)+",Coring=False)",false):NOP
                    RightClip = RightClip.Levels(ALMin,1.0,ALMax,CSMin,CSMax,Coring=False)              # DONT EVER USE Coring
                    if(!ShowAutoLevel) {
                        LeftClip = LeftClip.Levels(ALMin,1.0,ALMax,CSMin,CSMax,Coring=False)            # DONT EVER USE Coring
                    }
                }
                if(KeepMargin && ShowMargin) {
                    (DEBUG)?RT_Debug("PlanetCrop:","Margin AddBorders("+String(Left2)+","+String(Top2)+","+String(Right2)+","+String(Bot2)+")",false):NOP
                    LeftClip    =   LeftClip.Addborders (Left2,Top2,0,Bot2,MARGINBORDER)
                    RightClip   =   RightClip.Addborders(0,Top2,Right2,Bot2,MARGINBORDER)
                }
                (DEBUG) ? RT_Debug("PlanetCrop:","AddBorders("+String(Left)+","+String(Top)+","+String(Right)+","+String(Bot)+")",false) : NOP
                LeftClip  = LeftClip.Addborders (Left,Top,0,Bot,LBORDER)
                RightClip = RightClip.Addborders(0,Top,Right,Bot,RBORDER)
                k=StackHorizontal(LeftClip,RightClip)
                picclip = (IsClip(picclip)) ? picclip ++ k : k              # Append to  clip so far
                if(DEBUG){
                    RT_Debug("PlanetCrop:",false)
                    RT_Debug("PlanetCrop:"," ----------------------------- ",false)
                }
            }
        }
        PCEnd=RT_Timer()
        if(DEBUG) {
            RT_Debug("PlanetCrop:","Deleting",OUT_FILE,false)
            RT_Debug("PlanetCrop:","Time Taken="+String(PCEnd-PCStart,"%6.2f")+"Secs",false)
        }
        RT_FileDelete(OUT_FILE)
    """

    HasGScript ? GScript(GS) : Eval(GS) # Use GSCript if installed (loaded plugs override builtin)

    return picclip.ConvertToRGB24().assumefps(fps) # Addborders done (bug in AddBorders rgb24)
}
__________________
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; 6th August 2018 at 11:35.
StainlessS is offline   Reply With Quote
Old 6th August 2018, 14:42   #398  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Thanks, I have used this script a lot. I started modifying it for 16 bit support. Maybe this can be done now with avs+ since it added high bit depth. Will it just work? Does your rt stats support avs+ convention for high bit depth?
jmac698 is offline   Reply With Quote
Old 6th August 2018, 17:28   #399  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Does your rt stats support avs+ convention for high bit depth?
Sorry, no, I dont have the first idea how that stuff works, never touched it.

Only change was to enable use with either GScript OR AVS+ with/without GScript.

Post your mods now that you have permanently taken over development (and thanx so very much too)
__________________
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 8th April 2019, 07:19   #400  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Small script function to enclose a string in double quotes (if you dont know what you might want it for, then you probably dont need it).
If the string itself contains double quotes then encapsulates in set of tripple double quotes, otherwise a single pair of double quotes.

EnQuot() for RT_Stats, EnQuot2() for avs v2.60 only (req FillStr v2,.60)

Code:
BlankClip(Width=320,height=64,color=-$FF000000)

S=""""We "have' a' " QU"ote or ' two"""

#S=""

Function EnQuot(string S) { Q=RT_StrPad("", S.RT_FindStr(Chr(34))==0 ? 1 : 3 ,Chr(34)) Return Q+S+Q }      # Req RT_Stats v1.43+
Function EnQuot2(string S) { Q=FillStr(S.FindStr(Chr(34))==0 ? 1 : 3 ,Chr(34))  Return Q+S+Q }              # Requires Avs v2.60 for FillStr

S=S.Enquot # RT
#S=S.Enquot2 # Avs v2.6

Subtitle(S)
Result without EnQuot.


Result with EnQuot.
__________________
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
averageluma, correlation, lumadifference, runtime

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 20:45.


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