Log in

View Full Version : Finding maximum crop value?


bcn_246
3rd March 2016, 13:58
Hey,

I have quite a lot of old concert DVDs which I intend to rip in order to stream over my media server.

As many of them are transfers from the 80s and 90s the amount of black border around the edge which requires cropping out varies throughout the video (unlike newer video sources, where the amount of border tends to be pretty fixed) I am looking for a way to find the value required in order to ensure all the black borders are removed.

For example, if most of the video requires 8 pixels scanning through (or AutoCrop) will suggest cropping by 8, however if some sections require cropping by 12 I would rather crop by 12 (and over-crop some video) rather than leave some under-cropped (sections of 4 pixel black borders).

Is there a way to set any of the AutoCrop/RoboCrop plugins to anylise the whole video (rather than a small percentage) and let me know what is required to remove all black borders? Ideally, is it possible to have it say which frames requires the most cropping (that way, if only a certain section requires a lot more cropping it can be done separately).

Thanks in advance,

Ben

StainlessS
3rd March 2016, 14:25
I guess that the only way you can really do this properly is to split into scenes, several frames with dark edge image could just be mistaken
for border and you could lose a lot more than you would have hoped for. Using AutoCrop with default values on Cabaret (from about 10 minutes
from start and about 10 mins duration) managed to crop away about half of the video image for me. [EDIT: Same clip, RoboCrop nailed it dead]

Take a look at DBSC, and modify/create a DBSC_DynaSplice User function to output maximum croppings (EDIT: so far) on each edge at every scene (need Globals). Write to a file, or to DebugView with RT_Stats funcs.

DBSC here in User forum (just as this thread should be really):- http://forum.doom9.org/showthread.php?t=171624&highlight=DBSC

StainlessS
3rd March 2016, 15:21
Here is a quick knock-up (untested but should not be too far off)

EDIT: Script REMOVED

bcn_246
3rd March 2016, 17:53
Thanks for the effort put into the above... right now I am not overly concerned with stitching together differently bordered clips or over-cropping sections, just finding the single maximum value.

Tried the above, getting the following error: http://i.imgur.com/d0a4Gvx.png

Not quite sure what values to place after DBSC_MaxCrop() for SpliceDB or SceneNo... I am looking to analyse the whole video... had just been putting:
DBSC_MaxCrop("SpliceDB",0)

Thanks again,

Ben

Thanks again,

Ben

StainlessS
3rd March 2016, 18:57
Given function is a DBSC_DynaSplice User function, ie it requires all of DBSC (see DBSC_DynaCrop_Client.avs).
I know that you do not want to stitch anything together, but you do want to split into scenes and process each of those scenes to produce
the final numbers that you are after.

If you can think of a better way, then good luck. :)

StainlessS
3rd March 2016, 19:38
This is a rough Dynacrop client which should work OK, cant spend much more time on this, I'm a bit busy (again untested).

EDIT: SCript REMOVED

StainlessS
3rd March 2016, 23:34
Sorry, try this one. First scripts had bug, would not work if not in root dir of drive.

Requires all of requirements in DBSC 1st post. http://forum.doom9.org/showthread.php?t=171624&highlight=dbsc
Is tested with the DBSC.avs from zip in the DBSC thread, not posted DBSC thread scripts.


# MaxCrop_Client.avs : With DBSC_MaxCrop()

Import("DBSC.avs")

VideoFileName = "Whatever.avi"


VideoFileName = RT_GetFullPathName(VideoFileName) # *** 3 Mar 2016 : FIX BUG in Scriptclip (not Roor dir of drive) ***

InfoDB = VideoFileName+"_Info.DB" # INFO DBase
ScanDB = VideoFileName+"_Scan.DB" # SCAN DBase
LogFn = VideoFileName+"_User.Log"
SpliceDB = VideoFileName+"_Splice.DB"

RECYCLE_INFO_DB= True
RECYCLE_SCAN_DB= True
OVERRIDE = "Override.txt" # Override as Filename
FUNC = "DBSC_MaxCrop(SpliceDB=SpliceDB,SceneNo=SceneNo)"

# Scene change detection
dFact = 2.5 # lower more sensitive
dMinim = 7.0 # lower more sensitive
dMinLen= 25 # Least number of frames in scene


Avisource(VideoFileName)

DBSC_CreateInfo(InfoDB,RecycleDB=RECYCLE_INFO_DB) # Create INFO DB (REQUIRED), for fast scanning
DBSC_Scan(InfoDB,ScanDB,RecycleDB=RECYCLE_SCAN_DB,dfact=dFact,dMinim=dMinim,dminlen=dMinLen) # Detect Scene Changes and store in ScanDB

#DBSC_Override(ScanDB,OVERRIDE) # Only if required (Probably NOT necessary)

Return DBSC_StackSceneChanges(Last,InfoDB,ScanDB).ConvertToRGB32 # Check detections START/END of scene STACKED.



# VIEW SCene Changes Before DBSC_DynaCrop
Return DBSC_SubsClip(InfoDB,ScanDB,Subs=True,Metrics=True,Metrics2=True) # View detection metrics

###
### DynaCrop args
###

# Edges to crop: RLBT, Default 15($F). bit flags of edges to crop. 1=Top, 2=Bot, 4=Left, 8=Right. (1+2+4+8=15 = all sides)
RLBT=$F # Left and Right, TOP and BOT
# RoboCrop Thresh, -40 = current Robocrop AutoThresh : -32 = Older version RoboCrop AutoThresh
CropThresh= -40 # Current ver AutoThresh
# Maximum amount to crop that is OVER AND ABOVE least amount of cropping for entire clip. (ie is trial RoboCropped prior to Dynamic cropping)
CropLimit_Left = 8
CropLimit_Top = 8
CropLimit_Right= 8
CropLimit_Bot = 8



# Return one of two below funcs, DBSC_DynaCrop MUST have been called (at some time) before DBSC_DynaSplice (THEN COMMENT OUT)
Return DBSC_DynaCrop(ScanDB,SpliceDB=SpliceDB,rlbt=RLBT,LogFn=LogFn,CropLimit_Left=CropLimit_Left,CropLimit_Top=CropLimit_Top,Show=True,CropThresh=CropThresh,CropLimit_Right=CropLimit_Right,CropLimit_Bot=CropLimit_Bot,Debug=True)
# *** COMMENT OUT ABOVE DBSC_DynaCrop line after DBSC_DynaCrop creates SpliceDB ***

DBSC_DynaSplice(SpliceDB,Func) # See clip or DebugView for results
Return Last # *** This is YOUR REAL RESULT ***

DBSC_SubsClip(InfoDB,ScanDB,Subs=True,Metrics=true,Metrics2=False)
Return Last # Or Result with Scene Change detection Metrics

Function DBSC_MaxCrop(clip c,String "SpliceDB",Int "SceneNo" ) {
/*
Call DBSC_DynaSplice with eg
FUNC = "DBSC_MaxCrop(SpliceDB=SpliceDB,SceneNo=SceneNo)"
DBSC_DynaSplice(c,SpliceDB,func=FUNC)

DB Fields.
FieldNumber Type Contents
0 Int Start of Scene frame
1 Int End of Scene frame
2 Int Input clip Width (same for all DB).
3 Int Input clip Height (same for all DB).
4 Int Output clip resize Width (same for all DB).
5 Int Output clip resize Height (same for all DB).
6 Int Scene Crop left (X) offset
7 Int Scene Crop top (Y) offset
8 Int Scene Abs Crop Width
9 Int Scene Abs Crop Heigth
10 Int Scene signed crop width (width relative)
11 Int Scene signed crop height (height relative)
12 String Resizer String (256 chars], Same for all DB
*/
c
myName="DBSC_MaxCrop: "
Valid = (SpliceDB!="" && SceneNo>= 0) # Basic Validity test
Assert(Valid,RT_String("%sMUST Supply SpliceDB and SceneNo",myName))
Global Glb_DBSC_MaxCrop_X = RT_VarExist("Glb_DBSC_MaxCrop_X") ? Glb_DBSC_MaxCrop_X : 0 # Initialize Globals on first use
Global Glb_DBSC_MaxCrop_Y = RT_VarExist("Glb_DBSC_MaxCrop_Y") ? Glb_DBSC_MaxCrop_Y : 0
Global Glb_DBSC_MaxCrop_W = RT_VarExist("Glb_DBSC_MaxCrop_W") ? Glb_DBSC_MaxCrop_W : 0
Global Glb_DBSC_MaxCrop_H = RT_VarExist("Glb_DBSC_MaxCrop_H") ? Glb_DBSC_MaxCrop_H : 0
GScript("""
Assert(RT_DBaseGetID(SpliceDB,0)==DBSC_Str2ID("DYNS"),RT_String("%sNot a SpliceDB\n%s",myName,SpliceDB))
S = RT_DBaseGetField(SpliceDB,SceneNo,0) # SpliceDB Start Of Scene frame (0 relative)
E = RT_DBaseGetField(SpliceDB,SceneNo,1) # SpliceDB End Of Scene frame (0 relative)
Length = E-S+1 # Length of scene
X = RT_DBaseGetField(SpliceDB,SceneNo,6) # Curr Left Crop
Y = RT_DBaseGetField(SpliceDB,SceneNo,7) # Curr Top Crop
W = RT_DBaseGetField(SpliceDB,SceneNo,10) # Curr W Crop (Signed ie Right edge relative)
H = RT_DBaseGetField(SpliceDB,SceneNo,11) # Curr H Crop (Signed ie bot edge relative)
Global Glb_DBSC_MaxCrop_X = Max(Glb_DBSC_MaxCrop_X,X)
Global Glb_DBSC_MaxCrop_Y = Max(Glb_DBSC_MaxCrop_Y,Y)
Global Glb_DBSC_MaxCrop_W = Min(Glb_DBSC_MaxCrop_W,W)
Global Glb_DBSC_MaxCrop_H = Min(Glb_DBSC_MaxCrop_H,H)
RT_DebugF("#%d S=%d E=%d Len=%d : X=%d Y=%d W=%d H=%d : MxX=%d MxY=%d MxW=%d MxH=%d",
\ SceneNo,S,E,Length, X,Y,W,H, Glb_DBSC_MaxCrop_X,Glb_DBSC_MaxCrop_Y,Glb_DBSC_MaxCrop_W,Glb_DBSC_MaxCrop_H,name=myName)
RT_Subtitle("#%d S=%d E=%d Len=%d\nX=%d Y=%d W=%d H=%d\nMxX=%d MxY=%d MxW=%d MxH=%d",
\ SceneNo,S,E,Length, X,Y,W,H, Glb_DBSC_MaxCrop_X,Glb_DBSC_MaxCrop_Y,Glb_DBSC_MaxCrop_W,Glb_DBSC_MaxCrop_H,align=2)
""")
Return Last
}



Good Luck :)

EDIT: At least give it a try, it may not be perfect but I know of nothing that can approach. Four more beers and it'll be time for bed. :)

bcn_246
4th March 2016, 13:01
Thanks again for taking the time to help a noob :)

Tried literally encoding the MPEG2 video to avi and using your script verbatim along with the DBSC file you specified.

The video is opening, just getting a "Script error: Invalid arguments to function "RT_DBaseGetField" ([ScriptClip], line 10)" message (and no info on crop values).

Regards,

Ben

StainlessS
4th March 2016, 15:39
getting a "Script error: Invalid arguments to function "RT_DBaseGetField"

Yup, sorry bout dat, is fixed in my prev post post, as here:


VideoFileName = RT_GetFullPathName(VideoFileName) # *** 3 Mar 2016 : FIX BUG in Scriptclip (not Roor dir of drive) ***


Took me ages to figure out what the problem was.

Also added a few things to my prev post script, just add your filename and your good to go.

bcn_246
5th March 2016, 12:44
Thanks, really appreciate all the effort. Was still getting the same error... so I tried changing it to Import("DBSC.avs")


VideoFileName = "Input.avi" # *** 3 Mar 2016 : FIX BUG in Scriptclip (not Roor dir of drive) ***

InfoDB = VideoFileName+"_Info.DB" # INFO DBase
ScanDB = VideoFileName+"_Scan.DB" # SCAN DBase
LogFn = VideoFileName+"_User.Log"

... Now I am getting "Cannot open DBase file"... (also tried naming the .DB files manually, so InfoDB = "video_Info.DB"

Again, really appreciate all the help on this :)

StainlessS
5th March 2016, 15:55
Delete the DBases, USE THE UPDATED SCRIPT, not original (that is why I posted it) and only change to VideoFileName = "Input.avi".

EDIT: Leave this below line alone, it is the fix


VideoFileName = RT_GetFullPathName(VideoFileName) # *** 3 Mar 2016 : FIX BUG in Scriptclip (not Roor dir of drive) ***


EDIT: The original bug occurs because during frame serving, Avisynth has no idea what the current path is (its gone from memory),
so it needs a relative path converted to full path, which is what RT_GetFullPathName() does.
I think that during development I must have been using explicit fullpath.

bcn_246
6th March 2016, 10:03
Did exactly as you said, removed the old .DB files, still getting the RT_DBaseGetField error... I re-downloaded the DBSC 0.051.zip linked, placed in the same dir as the script, and have added the (newest versions of the plugins, found in your sig) to my AVISynth Plugin DIR, (RT_Stats, GSCript, Grunt, FrameSel, ClipClop, RoboCrop).

I am using AVISynth 2.60 MT, tried clearing out my plugin dir and using 2.6 (official) as well as 2.58 (along with the v2.5 versions of the above plugins), still no joy.. any more ideas/plugins I may be missing/using the wrong version of?

By the way, this is a long term hobby, not something I am desperate to solve, really do appreciate the help you have given me so far :)



Edit: also tried placing the required .avi and .avs files in my drives root (C:\input.avi)... still no difference...

StainlessS
6th March 2016, 13:01
So you are telling me that the start of script looks pretty much exactly like this (where only thing you changed is below in blue)


# MaxCrop_Client.avs : With DBSC_MaxCrop()

Import("DBSC.avs")

VideoFileName = "input.avi"


VideoFileName = RT_GetFullPathName(VideoFileName) # *** 3 Mar 2016 : FIX BUG in Scriptclip (not Roor dir of drive) ***

InfoDB = VideoFileName+"_Info.DB" # INFO DBase
ScanDB = VideoFileName+"_Scan.DB" # SCAN DBase
LogFn = VideoFileName+"_User.Log"
SpliceDB = VideoFileName+"_Splice.DB"

bcn_246
7th March 2016, 02:13
Yep... maybe I am missing something obvious? Initially I tried loading the VOB files with DGIndex, however in order to avoid any possible issues there I have tested encoding one of the MPEG-2 (29.970 720x480 NTSC) VOB files to YV12 AVI (and naming it "input").

Anyway, below are some screen-shots of how I have things set up, and the end result.

1. The main crop detection script (fixed version, as you posted)
http://i.imgur.com/ePrQaf3.png

2. Directory, after attempting to load "MAINSCRIPT.avs" into VirtualDub and previewing the video (tried VirtualDub Original, *Mod, and ModPlus). I notice that only _Info and _Scan get created, _User and _Splice are nowhere to be seen
http://i.imgur.com/rHBGfp9.png

3. Resulting VDub frame output (same error on any frame)
http://i.imgur.com/3Hfxpgk.jpg

Right now using AviSynth v2.60 MT... tried using the official (non MT) build, as well as reverting to 2.58 (and replacing your DLL plugins with the v2.5 versions).

Thanks again,

Ben

StainlessS
7th March 2016, 14:07
OK Ben, Last attempt with this (will up current DBSC and RT_Stats if further probs)

Here v0.52 DBSC.avs with DBSC_MaxCrop incorporated and fixes done withing DBSC instead of in client avs.

If further problems, capture DEBUG output in DebugView and post.

Here tis:- http://www.mediafire.com/download/zbuxu6s0crxs3rh/DBSC-v0.052.zip

By the way, I have not mentioned this as I thought that it was perhaps too obvious, but is simple matter to just load
clip (avs) into VDubMod, and zip the slider along until a black bar is sighted and adjust crop value (by 2 if YUV) and press F5
within script edit window (to refresh and show same frame). Then repeat. Is easy (ie about 2 mins max for a 2 hour clip)
to adjust by hand, thought you must have some further reason to have the machine do it for you (or at least produce
the crop value automatically).

Good Luck.

EDIT: DEBUG will look something like this (with InfoDB hilited in blue)

00000006 12:50:01 DBSC_CreateInfo: INFO DBase Recycled 'C:\TEM\DBSC-v0.052\DEEPER\Input.avi_Info.DB'
00000007 12:50:01 DBSC_CreateInfo: Total Time taken = 0.02 Seconds (0.00 Mins)
00000008 12:50:01 DBSC_Scan: SCScan DBase Recycled 'C:\TEM\DBSC-v0.052\DEEPER\Input.avi_Scan.DB'
00000009 12:50:01 DBSC_Scan: Total Time taken = 0.03 Seconds (0.00 Mins)
00000010 12:50:01 DBSC_StackSceneChanges: InfoDB=C:\TEM\DBSC-v0.052\DEEPER\Input.avi_Info.DB
00000011 12:50:01 DBSC_StackSceneChanges: ScanDB=C:\TEM\DBSC-v0.052\DEEPER\Input.avi_Scan.DB
00000012 12:50:01 DBSC_StackSceneChanges: ScriptClip Script=
00000013 12:50:01 DBSC_StackSceneChanges:
00000014 12:50:01 DBSC_StackSceneChanges: n = current_frame
00000015 12:50:01 DBSC_StackSceneChanges: SC = RT_DBaseGetField(ScanDB,n,2)
00000016 12:50:01 DBSC_StackSceneChanges:
00000017 12:50:01 DBSC_StackSceneChanges: FC = Framecount
00000018 12:50:01 DBSC_StackSceneChanges: SOS = RT_DBaseGetField(ScanDB,n,0)
00000019 12:50:01 DBSC_StackSceneChanges: EOS = RT_DBaseGetField(ScanDB,n,1)
00000020 12:50:01 DBSC_StackSceneChanges: SceneNo = RT_DBaseGetField(ScanDB,n,3)+1
00000021 12:50:01 DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000022 12:50:01 DBSC_StackSceneChanges: A = RT_DBaseGetField(InfoDB,Max(n-1,0),6)
00000023 12:50:01 DBSC_StackSceneChanges: B = RT_DBaseGetField(InfoDB,n,6)
00000024 12:50:01 DBSC_StackSceneChanges: C = RT_DBaseGetField(InfoDB,Min(n+1,FC-1),6)
00000025 12:50:01 DBSC_StackSceneChanges: Ax = (A<DupTh)?Max(RT_FrameDifference(Last,Last,n,n-2,ChromaWeight),A): A
00000026 12:50:01 DBSC_StackSceneChanges: Cx = (C<DupTh)?Max(RT_FrameDifference(Last,Last,n+1,n+3,ChromaWeight),C): C # If Diff(n+1,n+2) too low, use Diff(n+1,n+3)
00000027 12:50:01 DBSC_StackSceneChanges: PxDif = RT_LumaPixelsDifferent(Last,Last,delta2=1,Thresh=1) * 100.0 / 255.0
00000028 12:50:01 DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000029 12:50:01 DBSC_StackSceneChanges: CorrY = RT_Lumacorrelation(Last,Last,n=n,n2=n+1)
00000030 12:50:01 DBSC_StackSceneChanges:
00000031 12:50:01 DBSC_StackSceneChanges: FS=(RT_BitAnd(FLGS,$C0000000)!=0)?"USER OVERRIDE":(RT_BitTst(FLGS,16))?"PIXELCOUNT OVERRIDE":
00000032 12:50:01 DBSC_StackSceneChanges: \ RT_BitTst(FLGS,17)?"MULTIFLASH OVERRIDE" : (RT_BitTst(FLGS,15))?"FADE-TO-BLACK":""
00000033 12:50:01 DBSC_StackSceneChanges:
00000034 12:50:01 DBSC_StackSceneChanges:
00000035 12:50:01 DBSC_StackSceneChanges: Mn = RT_DBaseGetField(InfoDB,n,0)
00000036 12:50:01 DBSC_StackSceneChanges: Mx = RT_DBaseGetField(InfoDB,n,1)
00000037 12:50:01 DBSC_StackSceneChanges: MnMx = RT_DBaseGetField(InfoDB,n,2)
00000038 12:50:01 DBSC_StackSceneChanges: Med = RT_DBaseGetField(InfoDB,n,3)
00000039 12:50:01 DBSC_StackSceneChanges: AveY = RT_DBaseGetField(InfoDB,n,4)
00000040 12:50:01 DBSC_StackSceneChanges: StdY = RT_DBaseGetField(InfoDB,n,5)
00000041 12:50:01 DBSC_StackSceneChanges:
00000042 12:50:01 DBSC_StackSceneChanges: Last = (SC==1) ? STARTCLIP : (SC==2) ? ENDCLIP : (SC==3) ? SINGLECLIP : Last
00000043 12:50:01 DBSC_StackSceneChanges: RT_Subtitle(FMT, n,SC,SceneNo,SceneCnt,n-SOS,SOS,EOS,EOS-SOS+1,Ax,B,Cx,PxDif,CorrY,OVR,FLGS,FS)
00000044 12:50:01 DBSC_StackSceneChanges: RT_Subtitle(FMT2,mn,mx,MnMx,Med,AveY,StdY,align=1)
00000045 12:50:01 DBSC_StackSceneChanges: Return Last


Line that I think was causing prob hilited in red.

bcn_246
8th March 2016, 18:37
Thanks, tried the updated DBSC but got exactly the same results :(

I can't say I have ever used DebugView with AviSynth, will have do some reading up on exactly how to set it up in order to get the debug results.

StainlessS
8th March 2016, 19:58
Just run DebugView before script, perhaps set filter to catch any (EDIT: ONLY) strings containing ":" (I always output ":") or it will catch everything that
outputs to debug (probably dont matter much unless using old Avisynth which output a lot of extra stuff [v2.57 I think]).

bcn_246
9th March 2016, 15:54
Here are the results:
00000001 0.00000000 [1196] TffdshowBase::Constructor
00000002 0.00139818 [1196] TffdshowDecVideo::Constructor
00000003 0.00143305 [1196] TffdshowDecVideoOutputPin::Constructor
00000004 0.05440827 [1196] TffdshowDecVideo::Destructor
00000005 0.05561239 [1196] TffdshowDecVideoOutputPin::Destructor
00000008 4.00132322 [1196] DBSC_CreateInfo: Initializing INFO DBase C:\Users\Ben\Desktop\Nirvana - MTV Unplugged in New York\VTS_01_3 temp files\input.avi_Info.DB
00000009 13.95796680 [1196] DBSC_CreateInfo: 1837 ] 5% Complete
00000010 24.02131081 [1196] DBSC_CreateInfo: 3674 ] 10% Complete
00000011 34.28084564 [1196] DBSC_CreateInfo: 5511 ] 15% Complete
00000012 44.45224380 [1196] DBSC_CreateInfo: 7348 ] 20% Complete
00000013 54.69377136 [1196] DBSC_CreateInfo: 9185 ] 25% Complete
00000014 64.87521362 [1196] DBSC_CreateInfo: 11022 ] 30% Complete
00000015 75.05751038 [1196] DBSC_CreateInfo: 12859 ] 35% Complete
00000016 85.20436096 [1196] DBSC_CreateInfo: 14696 ] 40% Complete
00000017 95.31748962 [1196] DBSC_CreateInfo: 16533 ] 45% Complete
00000018 105.53433990 [1196] DBSC_CreateInfo: 18370 ] 50% Complete
00000019 115.73236847 [1196] DBSC_CreateInfo: 20207 ] 55% Complete
00000020 125.82824707 [1196] DBSC_CreateInfo: 22044 ] 60% Complete
00000021 135.93788147 [1196] DBSC_CreateInfo: 23881 ] 65% Complete
00000022 146.15284729 [1196] DBSC_CreateInfo: 25718 ] 70% Complete
00000023 156.47503662 [1196] DBSC_CreateInfo: 27555 ] 75% Complete
00000024 166.66018677 [1196] DBSC_CreateInfo: 29392 ] 80% Complete
00000025 176.73637390 [1196] DBSC_CreateInfo: 31229 ] 85% Complete
00000026 186.75549316 [1196] DBSC_CreateInfo: 33066 ] 90% Complete
00000027 196.83622742 [1196] DBSC_CreateInfo: 34903 ] 95% Complete
00000028 206.99044800 [1196] DBSC_CreateInfo: Total Time taken = 203.00 Seconds (3.38 Mins)
00000029 207.01766968 [1196] DBSC_Scan: Initializing Scenechange Scan DBase C:\Users\Ben\Desktop\Nirvana - MTV Unplugged in New York\VTS_01_3 temp files\input.avi_Scan.DB
00000030 207.01852417 [1196] DBSC_Scan: Creating Scan DBase
00000031 230.68237305 [1196] DBSC_Scan: ReScan for Fade-to-Black SceneChanges:
00000032 237.70782471 [1196] DBSC_Scan: Writing Full SceneChange DBase Data
00000033 237.70817566 [1196] DBSC_Scan: 0] START=0 End=98 SceneNo=0
00000034 237.81590271 [1196] DBSC_Scan: 99] START=99 End=198 SceneNo=1
00000035 237.92340088 [1196] DBSC_Scan: 199] START=199 End=352 SceneNo=2
00000036 238.13076782 [1196] DBSC_Scan: 353] START=353 End=505 SceneNo=3
00000037 238.33372498 [1196] DBSC_Scan: 506] START=506 End=602 SceneNo=4
00000038 238.46334839 [1196] DBSC_Scan: 603] START=603 End=715 SceneNo=5
00000039 238.61157227 [1196] DBSC_Scan: 716] START=716 End=897 SceneNo=6
00000040 238.85806274 [1196] DBSC_Scan: 898] START=898 End=990 SceneNo=7
00000041 238.98707581 [1196] DBSC_Scan: 991] START=991 End=1201 SceneNo=8
00000042 239.26615906 [1196] DBSC_Scan: 1202] START=1202 End=1287 SceneNo=9
00000043 239.38037109 [1196] DBSC_Scan: 1288] START=1288 End=1346 SceneNo=10
00000044 239.46080017 [1196] DBSC_Scan: 1347] START=1347 End=1440 SceneNo=11
00000045 239.58607483 [1196] DBSC_Scan: 1441] START=1441 End=1502 SceneNo=12
00000046 239.66992188 [1196] DBSC_Scan: 1503] START=1503 End=1617 SceneNo=13
00000047 239.82763672 [1196] DBSC_Scan: 1618] START=1618 End=1676 SceneNo=14
00000048 239.90577698 [1196] DBSC_Scan: 1677] START=1677 End=1780 SceneNo=15
00000049 240.04402161 [1196] DBSC_Scan: 1781] START=1781 End=1928 SceneNo=16
00000050 240.24386597 [1196] DBSC_Scan: 1929] START=1929 End=2023 SceneNo=17
00000051 240.37185669 [1196] DBSC_Scan: 2024] START=2024 End=2172 SceneNo=18
00000052 240.56993103 [1196] DBSC_Scan: 2173] START=2173 End=2298 SceneNo=19
00000053 240.74902344 [1196] DBSC_Scan: 2299] START=2299 End=2463 SceneNo=20
00000054 240.96943665 [1196] DBSC_Scan: 2464] START=2464 End=2672 SceneNo=21
00000055 241.25177002 [1196] DBSC_Scan: 2673] START=2673 End=2835 SceneNo=22
00000056 241.47152710 [1196] DBSC_Scan: 2836] START=2836 End=3124 SceneNo=23
00000057 241.85917664 [1196] DBSC_Scan: 3125] START=3125 End=3231 SceneNo=24
00000058 242.00090027 [1196] DBSC_Scan: 3232] START=3232 End=3361 SceneNo=25
00000059 242.17366028 [1196] DBSC_Scan: 3362] START=3362 End=3577 SceneNo=26
00000060 242.46435547 [1196] DBSC_Scan: 3578] START=3578 End=9075 SceneNo=27
00000061 249.82806396 [1196] DBSC_Scan: 9076] START=9076 End=9273 SceneNo=28
00000062 250.09454346 [1196] DBSC_Scan: 9274] START=9274 End=9534 SceneNo=29
00000063 250.44091797 [1196] DBSC_Scan: 9535] START=9535 End=9633 SceneNo=30
00000064 250.57125854 [1196] DBSC_Scan: 9634] START=9634 End=9792 SceneNo=31
00000065 250.78654480 [1196] DBSC_Scan: 9793] START=9793 End=9846 SceneNo=32
00000066 250.85905457 [1196] DBSC_Scan: 9847] START=9847 End=15485 SceneNo=33
00000067 258.36929321 [1196] DBSC_Scan: 15486] START=15486 End=15603 SceneNo=34
00000068 258.52453613 [1196] DBSC_Scan: 15604] START=15604 End=15761 SceneNo=35
00000069 258.73608398 [1196] DBSC_Scan: 15762] START=15762 End=15906 SceneNo=36
00000070 258.93664551 [1196] DBSC_Scan: 15907] START=15907 End=16123 SceneNo=37
00000071 259.22244263 [1196] DBSC_Scan: 16124] START=16124 End=20896 SceneNo=38
00000072 265.60003662 [1196] DBSC_Scan: 20897] START=20897 End=21043 SceneNo=39
00000073 265.79476929 [1196] DBSC_Scan: 21044] START=21044 End=21354 SceneNo=40
00000074 266.21166992 [1196] DBSC_Scan: 21355] START=21355 End=21599 SceneNo=41
00000075 266.53283691 [1196] DBSC_Scan: 21600] START=21600 End=21753 SceneNo=42
00000076 266.73919678 [1196] DBSC_Scan: 21754] START=21754 End=21983 SceneNo=43
00000077 267.04287720 [1196] DBSC_Scan: 21984] START=21984 End=22210 SceneNo=44
00000078 267.34274292 [1196] DBSC_Scan: 22211] START=22211 End=22616 SceneNo=45
00000079 267.88748169 [1196] DBSC_Scan: 22617] START=22617 End=22806 SceneNo=46
00000080 268.13665771 [1196] DBSC_Scan: 22807] START=22807 End=22967 SceneNo=47
00000081 268.35171509 [1196] DBSC_Scan: 22968] START=22968 End=23058 SceneNo=48
00000082 268.47085571 [1196] DBSC_Scan: 23059] START=23059 End=23215 SceneNo=49
00000083 268.67742920 [1196] DBSC_Scan: 23216] START=23216 End=25348 SceneNo=50
00000084 271.52371216 [1196] DBSC_Scan: 25349] START=25349 End=25481 SceneNo=51
00000085 271.70187378 [1196] DBSC_Scan: 25482] START=25482 End=25578 SceneNo=52
00000086 271.83169556 [1196] DBSC_Scan: 25579] START=25579 End=27081 SceneNo=53
00000087 273.90948486 [1196] DBSC_Scan: 27082] START=27082 End=27208 SceneNo=54
00000088 274.08114624 [1196] DBSC_Scan: 27209] START=27209 End=27342 SceneNo=55
00000089 274.26019287 [1196] DBSC_Scan: 27343] START=27343 End=27466 SceneNo=56
00000090 274.42376709 [1196] DBSC_Scan: 27467] START=27467 End=29900 SceneNo=57
00000091 277.58618164 [1196] DBSC_Scan: 29901] START=29901 End=30345 SceneNo=58
00000092 278.18417358 [1196] DBSC_Scan: 30346] START=30346 End=30420 SceneNo=59
00000093 278.28750610 [1196] DBSC_Scan: 30421] START=30421 End=30586 SceneNo=60
00000094 278.51110840 [1196] DBSC_Scan: 30587] START=30587 End=30759 SceneNo=61
00000095 278.74139404 [1196] DBSC_Scan: 30760] START=30760 End=30986 SceneNo=62
00000096 279.04412842 [1196] DBSC_Scan: 30987] START=30987 End=31259 SceneNo=63
00000097 279.41519165 [1196] DBSC_Scan: 31260] START=31260 End=31486 SceneNo=64
00000098 279.71572876 [1196] DBSC_Scan: 31487] START=31487 End=31928 SceneNo=65
00000099 280.30862427 [1196] DBSC_Scan: 31929] START=31929 End=32113 SceneNo=66
00000100 280.56344604 [1196] DBSC_Scan: 32114] START=32114 End=32547 SceneNo=67
00000101 281.14401245 [1196] DBSC_Scan: 32548] START=32548 End=32763 SceneNo=68
00000102 281.44216919 [1196] DBSC_Scan: 32764] START=32764 End=33093 SceneNo=69
00000103 281.87963867 [1196] DBSC_Scan: 33094] START=33094 End=33205 SceneNo=70
00000104 282.03518677 [1196] DBSC_Scan: 33206] START=33206 End=33405 SceneNo=71
00000105 282.30163574 [1196] DBSC_Scan: 33406] START=33406 End=33535 SceneNo=72
00000106 282.47708130 [1196] DBSC_Scan: 33536] START=33536 End=33846 SceneNo=73
00000107 282.89349365 [1196] DBSC_Scan: 33847] START=33847 End=34025 SceneNo=74
00000108 283.13018799 [1196] DBSC_Scan: 34026] START=34026 End=34433 SceneNo=75
00000109 283.67074585 [1196] DBSC_Scan: 34434] START=34434 End=34621 SceneNo=76
00000110 283.92623901 [1196] DBSC_Scan: 34622] START=34622 End=34816 SceneNo=77
00000111 284.18289185 [1196] DBSC_Scan: 34817] START=34817 End=34963 SceneNo=78
00000112 284.38366699 [1196] DBSC_Scan: 34964] START=34964 End=35164 SceneNo=79
00000113 284.65374756 [1196] DBSC_Scan: 35165] START=35165 End=35274 SceneNo=80
00000114 284.80426025 [1196] DBSC_Scan: 35275] START=35275 End=36739 SceneNo=81
00000115 286.78829956 [1196] DBSC_Scan: Total Time taken = 79.80 Seconds (1.33 Mins)
00000116 286.82693481 [1196] DBSC_StackSceneChanges: InfoDB=C:\Users\Ben\Desktop\Nirvana - MTV Unplugged in New York\VTS_01_3 temp files\input.avi_Info.DB
00000117 286.82696533 [1196] DBSC_StackSceneChanges: ScanDB=C:\Users\Ben\Desktop\Nirvana - MTV Unplugged in New York\VTS_01_3 temp files\input.avi_Scan.DB
00000118 286.82696533 [1196] DBSC_StackSceneChanges: ScriptClip Script=
00000119 286.82699585 [1196] DBSC_StackSceneChanges:
00000120 286.82699585 [1196] DBSC_StackSceneChanges:
00000121 286.82702637 [1196] DBSC_StackSceneChanges: n = current_frame
00000122 286.82702637 [1196] DBSC_StackSceneChanges:
00000123 286.82705688 [1196] DBSC_StackSceneChanges: SC = RT_DBaseGetField(ScanDB,n,2)
00000124 286.82705688 [1196] DBSC_StackSceneChanges:
00000125 286.82708740 [1196] DBSC_StackSceneChanges:
00000126 286.82708740 [1196] DBSC_StackSceneChanges:
00000127 286.82711792 [1196] DBSC_StackSceneChanges: FC = Framecount
00000128 286.82711792 [1196] DBSC_StackSceneChanges:
00000129 286.82711792 [1196] DBSC_StackSceneChanges: SOS = RT_DBaseGetField(ScanDB,n,0)
00000130 286.82714844 [1196] DBSC_StackSceneChanges:
00000131 286.82714844 [1196] DBSC_StackSceneChanges: EOS = RT_DBaseGetField(ScanDB,n,1)
00000132 286.82717896 [1196] DBSC_StackSceneChanges:
00000133 286.82717896 [1196] DBSC_StackSceneChanges: SceneNo = RT_DBaseGetField(ScanDB,n,3)+1
00000134 286.82720947 [1196] DBSC_StackSceneChanges:
00000135 286.82720947 [1196] DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000136 286.82723999 [1196] DBSC_StackSceneChanges:
00000137 286.82723999 [1196] DBSC_StackSceneChanges: A = RT_DBaseGetField(InfoDB,Max(n-1,0),6)
00000138 286.82727051 [1196] DBSC_StackSceneChanges:
00000139 286.82727051 [1196] DBSC_StackSceneChanges: B = RT_DBaseGetField(InfoDB,n,6)
00000140 286.82727051 [1196] DBSC_StackSceneChanges:
00000141 286.82730103 [1196] DBSC_StackSceneChanges: C = RT_DBaseGetField(InfoDB,Min(n+1,FC-1),6)
00000142 286.82730103 [1196] DBSC_StackSceneChanges:
00000143 286.82733154 [1196] DBSC_StackSceneChanges: Ax = (A<DupTh)?Max(RT_FrameDifference(Last,Last,n,n-2,ChromaWeight),A): A
00000144 286.82733154 [1196] DBSC_StackSceneChanges:
00000145 286.82736206 [1196] DBSC_StackSceneChanges: Cx = (C<DupTh)?Max(RT_FrameDifference(Last,Last,n+1,n+3,ChromaWeight),C): C # If Diff(n+1,n+2) too low, use Diff(n+1,n+3)
00000146 286.82736206 [1196] DBSC_StackSceneChanges:
00000147 286.82739258 [1196] DBSC_StackSceneChanges: PxDif = RT_LumaPixelsDifferent(Last,Last,delta2=1,Thresh=1) * 100.0 / 255.0
00000148 286.82739258 [1196] DBSC_StackSceneChanges:
00000149 286.82742310 [1196] DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000150 286.82742310 [1196] DBSC_StackSceneChanges:
00000151 286.82742310 [1196] DBSC_StackSceneChanges: CorrY = RT_Lumacorrelation(Last,Last,n=n,n2=n+1)
00000152 286.82745361 [1196] DBSC_StackSceneChanges:
00000153 286.82745361 [1196] DBSC_StackSceneChanges:
00000154 286.82748413 [1196] DBSC_StackSceneChanges:
00000155 286.82748413 [1196] DBSC_StackSceneChanges: FS=(RT_BitAnd(FLGS,$C0000000)!=0)?"USER OVERRIDE":(RT_BitTst(FLGS,16))?"PIXELCOUNT OVERRIDE":
00000156 286.82751465 [1196] DBSC_StackSceneChanges:
00000157 286.82751465 [1196] DBSC_StackSceneChanges: \ RT_BitTst(FLGS,17)?"MULTIFLASH OVERRIDE" : (RT_BitTst(FLGS,15))?"FADE-TO-BLACK":""
00000158 286.82754517 [1196] DBSC_StackSceneChanges:
00000159 286.82754517 [1196] DBSC_StackSceneChanges:
00000160 286.82754517 [1196] DBSC_StackSceneChanges:
00000161 286.82757568 [1196] DBSC_StackSceneChanges:
00000162 286.82757568 [1196] DBSC_StackSceneChanges:
00000163 286.82760620 [1196] DBSC_StackSceneChanges: Mn = RT_DBaseGetField(InfoDB,n,0)
00000164 286.82760620 [1196] DBSC_StackSceneChanges:
00000165 286.82763672 [1196] DBSC_StackSceneChanges: Mx = RT_DBaseGetField(InfoDB,n,1)
00000166 286.82763672 [1196] DBSC_StackSceneChanges:
00000167 286.82766724 [1196] DBSC_StackSceneChanges: MnMx = RT_DBaseGetField(InfoDB,n,2)
00000168 286.82766724 [1196] DBSC_StackSceneChanges:
00000169 286.82769775 [1196] DBSC_StackSceneChanges: Med = RT_DBaseGetField(InfoDB,n,3)
00000170 286.82769775 [1196] DBSC_StackSceneChanges:
00000171 286.82769775 [1196] DBSC_StackSceneChanges: AveY = RT_DBaseGetField(InfoDB,n,4)
00000172 286.82772827 [1196] DBSC_StackSceneChanges:
00000173 286.82772827 [1196] DBSC_StackSceneChanges: StdY = RT_DBaseGetField(InfoDB,n,5)
00000174 286.82775879 [1196] DBSC_StackSceneChanges:
00000175 286.82775879 [1196] DBSC_StackSceneChanges:
00000176 286.82778931 [1196] DBSC_StackSceneChanges:
00000177 286.82778931 [1196] DBSC_StackSceneChanges: Last = (SC==1) ? STARTCLIP : (SC==2) ? ENDCLIP : (SC==3) ? SINGLECLIP : Last
00000178 286.82781982 [1196] DBSC_StackSceneChanges:
00000179 286.82781982 [1196] DBSC_StackSceneChanges: RT_Subtitle(FMT, n,SC,SceneNo,SceneCnt,n-SOS,SOS,EOS,EOS-SOS+1,Ax,B,Cx,PxDif,CorrY,OVR,FLGS,FS)
00000180 286.82781982 [1196] DBSC_StackSceneChanges:
00000181 286.82785034 [1196] DBSC_StackSceneChanges: RT_Subtitle(FMT2,mn,mx,MnMx,Med,AveY,StdY,align=1)
00000182 286.82785034 [1196] DBSC_StackSceneChanges:
00000183 286.82788086 [1196] DBSC_StackSceneChanges: Return Last
00000184 286.82788086 [1196] DBSC_StackSceneChanges:
00000185 286.82791138 [1196] DBSC_StackSceneChanges:
00000186 286.86685181 [1196] DBSC_WriteFiles: Writing Start_Fn File '20160309_144647_968_Start.txt'
00000187 286.86694336 [1196] DBSC_WriteFiles: Writing End_Fn File '20160309_144647_968_End.txt'
00000188 287.41900635 [1196] DBSC_WriteFiles: Total Time taken = 0.57 Seconds (0.01 Mins)


I had it set to Include *:* like so:
http://i.imgur.com/jMwoPFF.png

Edit: Oh, not that it matters at all but the v0.052 version you posted is listed as v0.051 in the DBSC.avs script (compared and it is the updated version)

Thanks again,

Ben

StainlessS
10th March 2016, 00:29
Presumably your same filename for InfoDB when commenting out DBSC_StackSceneChanges and allowing to end in a DBSC_SubsClip.
[EDIT: where the problem actually shows itself]

Anyway, I'm guessing that whatever the problem is, it is related to all of them there SPACES in your filepathname, people really ask for trouble doing that.
I guess I know what I'm looking for now then, I'll retry with a ridiculous amount of spaces in path. :)
I'll get back.

bcn_246
10th March 2016, 02:08
Same result when moved the file to a small, space free root.
00000001 0.00000000 [6900] DBSC_CreateInfo: 11022 ] 30% Complete
00000002 11.69537830 [6900] RemoveDirt 1.0
00000003 11.93174934 [6900] SSETools 0.1
00000004 12.87831879 [6900] DBSC_CreateInfo: Initializing INFO DBase C:\edit\input.avi_Info.DB
00000005 22.80421448 [6900] DBSC_CreateInfo: 1837 ] 5% Complete
00000006 32.83864975 [6900] DBSC_CreateInfo: 3674 ] 10% Complete
00000007 43.01140594 [6900] DBSC_CreateInfo: 5511 ] 15% Complete
00000008 53.15039825 [6900] DBSC_CreateInfo: 7348 ] 20% Complete
00000009 63.44358826 [6900] DBSC_CreateInfo: 9185 ] 25% Complete
00000010 73.59278107 [6900] DBSC_CreateInfo: 11022 ] 30% Complete
00000011 83.74369812 [6900] DBSC_CreateInfo: 12859 ] 35% Complete
00000012 93.84423065 [6900] DBSC_CreateInfo: 14696 ] 40% Complete
00000013 103.92112732 [6900] DBSC_CreateInfo: 16533 ] 45% Complete
00000014 114.10771179 [6900] DBSC_CreateInfo: 18370 ] 50% Complete
00000015 124.27769470 [6900] DBSC_CreateInfo: 20207 ] 55% Complete
00000016 134.34216309 [6900] DBSC_CreateInfo: 22044 ] 60% Complete
00000017 144.42546082 [6900] DBSC_CreateInfo: 23881 ] 65% Complete
00000018 154.60548401 [6900] DBSC_CreateInfo: 25718 ] 70% Complete
00000019 164.84793091 [6900] DBSC_CreateInfo: 27555 ] 75% Complete
00000020 175.00248718 [6900] DBSC_CreateInfo: 29392 ] 80% Complete
00000021 185.01623535 [6900] DBSC_CreateInfo: 31229 ] 85% Complete
00000022 194.99768066 [6900] DBSC_CreateInfo: 33066 ] 90% Complete
00000023 205.05039978 [6900] DBSC_CreateInfo: 34903 ] 95% Complete
00000024 215.17732239 [6900] DBSC_CreateInfo: Total Time taken = 202.31 Seconds (3.37 Mins)
00000025 215.20358276 [6900] DBSC_Scan: Initializing Scenechange Scan DBase C:\edit\input.avi_Scan.DB
00000026 215.20439148 [6900] DBSC_Scan: Creating Scan DBase
00000027 238.47360229 [6900] DBSC_Scan: ReScan for Fade-to-Black SceneChanges:
00000028 245.17950439 [6900] DBSC_Scan: Writing Full SceneChange DBase Data
00000029 245.17982483 [6900] DBSC_Scan: 0] START=0 End=98 SceneNo=0
00000030 245.33352661 [6900] DBSC_Scan: 99] START=99 End=198 SceneNo=1
00000031 245.48834229 [6900] DBSC_Scan: 199] START=199 End=352 SceneNo=2
00000032 245.72984314 [6900] DBSC_Scan: 353] START=353 End=505 SceneNo=3
00000033 245.96563721 [6900] DBSC_Scan: 506] START=506 End=602 SceneNo=4
00000034 246.11651611 [6900] DBSC_Scan: 603] START=603 End=715 SceneNo=5
00000035 246.29182434 [6900] DBSC_Scan: 716] START=716 End=897 SceneNo=6
00000036 246.56953430 [6900] DBSC_Scan: 898] START=898 End=990 SceneNo=7
00000037 246.71372986 [6900] DBSC_Scan: 991] START=991 End=1201 SceneNo=8
00000038 247.05326843 [6900] DBSC_Scan: 1202] START=1202 End=1287 SceneNo=9
00000039 247.18556213 [6900] DBSC_Scan: 1288] START=1288 End=1346 SceneNo=10
00000040 247.27922058 [6900] DBSC_Scan: 1347] START=1347 End=1440 SceneNo=11
00000041 247.42347717 [6900] DBSC_Scan: 1441] START=1441 End=1502 SceneNo=12
00000042 247.51962280 [6900] DBSC_Scan: 1503] START=1503 End=1617 SceneNo=13
00000043 247.69757080 [6900] DBSC_Scan: 1618] START=1618 End=1676 SceneNo=14
00000044 247.78915405 [6900] DBSC_Scan: 1677] START=1677 End=1780 SceneNo=15
00000045 247.95164490 [6900] DBSC_Scan: 1781] START=1781 End=1928 SceneNo=16
00000046 248.17857361 [6900] DBSC_Scan: 1929] START=1929 End=2023 SceneNo=17
00000047 248.33815002 [6900] DBSC_Scan: 2024] START=2024 End=2172 SceneNo=18
00000048 248.56593323 [6900] DBSC_Scan: 2173] START=2173 End=2298 SceneNo=19
00000049 248.75926208 [6900] DBSC_Scan: 2299] START=2299 End=2463 SceneNo=20
00000050 249.01654053 [6900] DBSC_Scan: 2464] START=2464 End=2672 SceneNo=21
00000051 249.33557129 [6900] DBSC_Scan: 2673] START=2673 End=2835 SceneNo=22
00000052 249.58441162 [6900] DBSC_Scan: 2836] START=2836 End=3124 SceneNo=23
00000053 250.03392029 [6900] DBSC_Scan: 3125] START=3125 End=3231 SceneNo=24
00000054 250.19573975 [6900] DBSC_Scan: 3232] START=3232 End=3361 SceneNo=25
00000055 250.39573669 [6900] DBSC_Scan: 3362] START=3362 End=3577 SceneNo=26
00000056 250.72743225 [6900] DBSC_Scan: 3578] START=3578 End=9075 SceneNo=27
00000057 259.13796997 [6900] DBSC_Scan: 9076] START=9076 End=9273 SceneNo=28
00000058 259.44375610 [6900] DBSC_Scan: 9274] START=9274 End=9534 SceneNo=29
00000059 259.84069824 [6900] DBSC_Scan: 9535] START=9535 End=9633 SceneNo=30
00000060 259.99377441 [6900] DBSC_Scan: 9634] START=9634 End=9792 SceneNo=31
00000061 260.24023438 [6900] DBSC_Scan: 9793] START=9793 End=9846 SceneNo=32
00000062 260.32434082 [6900] DBSC_Scan: 9847] START=9847 End=15485 SceneNo=33
00000063 268.85412598 [6900] DBSC_Scan: 15486] START=15486 End=15603 SceneNo=34
00000064 268.97708130 [6900] DBSC_Scan: 15604] START=15604 End=15761 SceneNo=35
00000065 269.14654541 [6900] DBSC_Scan: 15762] START=15762 End=15906 SceneNo=36
00000066 269.30242920 [6900] DBSC_Scan: 15907] START=15907 End=16123 SceneNo=37
00000067 269.53259277 [6900] DBSC_Scan: 16124] START=16124 End=20896 SceneNo=38
00000068 274.80871582 [6900] DBSC_Scan: 20897] START=20897 End=21043 SceneNo=39
00000069 275.32376099 [6900] DBSC_Scan: 21044] START=21044 End=21354 SceneNo=40
00000070 275.32604980 [6900] DBSC_Scan: 21355] START=21355 End=21599 SceneNo=41
00000071 275.82476807 [6900] DBSC_Scan: 21600] START=21600 End=21753 SceneNo=42
00000072 275.82516479 [6900] DBSC_Scan: 21754] START=21754 End=21983 SceneNo=43
00000073 276.33779907 [6900] DBSC_Scan: 21984] START=21984 End=22210 SceneNo=44
00000074 276.84182739 [6900] DBSC_Scan: 22211] START=22211 End=22616 SceneNo=45
00000075 276.84265137 [6900] DBSC_Scan: 22617] START=22617 End=22806 SceneNo=46
00000076 277.08392334 [6900] DBSC_Scan: 22807] START=22807 End=22967 SceneNo=47
00000077 277.20654297 [6900] DBSC_Scan: 22968] START=22968 End=23058 SceneNo=48
00000078 277.30282593 [6900] DBSC_Scan: 23059] START=23059 End=23215 SceneNo=49
00000079 277.46881104 [6900] DBSC_Scan: 23216] START=23216 End=25348 SceneNo=50
00000080 279.81338501 [6900] DBSC_Scan: 25349] START=25349 End=25481 SceneNo=51
00000081 279.95175171 [6900] DBSC_Scan: 25482] START=25482 End=25578 SceneNo=52
00000082 280.05242920 [6900] DBSC_Scan: 25579] START=25579 End=27081 SceneNo=53
00000083 281.66921997 [6900] DBSC_Scan: 27082] START=27082 End=27208 SceneNo=54
00000084 281.80355835 [6900] DBSC_Scan: 27209] START=27209 End=27342 SceneNo=55
00000085 281.94320679 [6900] DBSC_Scan: 27343] START=27343 End=27466 SceneNo=56
00000086 282.07116699 [6900] DBSC_Scan: 27467] START=27467 End=29900 SceneNo=57
00000087 284.95516968 [6900] DBSC_Scan: 29901] START=29901 End=30345 SceneNo=58
00000088 285.21829224 [6900] DBSC_Scan: 30346] START=30346 End=30420 SceneNo=59
00000089 285.29797363 [6900] DBSC_Scan: 30421] START=30421 End=30586 SceneNo=60
00000090 285.47195435 [6900] DBSC_Scan: 30587] START=30587 End=30759 SceneNo=61
00000091 285.65246582 [6900] DBSC_Scan: 30760] START=30760 End=30986 SceneNo=62
00000092 285.88870239 [6900] DBSC_Scan: 30987] START=30987 End=31259 SceneNo=63
00000093 286.23333740 [6900] DBSC_Scan: 31260] START=31260 End=31486 SceneNo=64
00000094 286.47067261 [6900] DBSC_Scan: 31487] START=31487 End=31928 SceneNo=65
00000095 286.92684937 [6900] DBSC_Scan: 31929] START=31929 End=32113 SceneNo=66
00000096 287.11773682 [6900] DBSC_Scan: 32114] START=32114 End=32547 SceneNo=67
00000097 287.56915283 [6900] DBSC_Scan: 32548] START=32548 End=32763 SceneNo=68
00000098 287.84078979 [6900] DBSC_Scan: 32764] START=32764 End=33093 SceneNo=69
00000099 288.18237305 [6900] DBSC_Scan: 33094] START=33094 End=33205 SceneNo=70
00000100 288.29843140 [6900] DBSC_Scan: 33206] START=33206 End=33405 SceneNo=71
00000101 288.50588989 [6900] DBSC_Scan: 33406] START=33406 End=33535 SceneNo=72
00000102 288.69967651 [6900] DBSC_Scan: 33536] START=33536 End=33846 SceneNo=73
00000103 289.04550171 [6900] DBSC_Scan: 33847] START=33847 End=34025 SceneNo=74
00000104 289.23126221 [6900] DBSC_Scan: 34026] START=34026 End=34433 SceneNo=75
00000105 289.68161011 [6900] DBSC_Scan: 34434] START=34434 End=34621 SceneNo=76
00000106 289.87997437 [6900] DBSC_Scan: 34622] START=34622 End=34816 SceneNo=77
00000107 290.08297729 [6900] DBSC_Scan: 34817] START=34817 End=34963 SceneNo=78
00000108 290.27886963 [6900] DBSC_Scan: 34964] START=34964 End=35164 SceneNo=79
00000109 290.55661011 [6900] DBSC_Scan: 35165] START=35165 End=35274 SceneNo=80
00000110 290.67071533 [6900] DBSC_Scan: 35275] START=35275 End=36739 SceneNo=81
00000111 292.24163818 [6900] DBSC_Scan: Total Time taken = 77.06 Seconds (1.28 Mins)
00000112 292.28027344 [6900] DBSC_StackSceneChanges: InfoDB=C:\edit\input.avi_Info.DB
00000113 292.28030396 [6900] DBSC_StackSceneChanges: ScanDB=C:\edit\input.avi_Scan.DB
00000114 292.28030396 [6900] DBSC_StackSceneChanges: ScriptClip Script=
00000115 292.28033447 [6900] DBSC_StackSceneChanges:
00000116 292.28036499 [6900] DBSC_StackSceneChanges:
00000117 292.28036499 [6900] DBSC_StackSceneChanges: n = current_frame
00000118 292.28039551 [6900] DBSC_StackSceneChanges:
00000119 292.28039551 [6900] DBSC_StackSceneChanges: SC = RT_DBaseGetField(ScanDB,n,2)
00000120 292.28039551 [6900] DBSC_StackSceneChanges:
00000121 292.28042603 [6900] DBSC_StackSceneChanges:
00000122 292.28042603 [6900] DBSC_StackSceneChanges:
00000123 292.28045654 [6900] DBSC_StackSceneChanges: FC = Framecount
00000124 292.28045654 [6900] DBSC_StackSceneChanges:
00000125 292.28048706 [6900] DBSC_StackSceneChanges: SOS = RT_DBaseGetField(ScanDB,n,0)
00000126 292.28048706 [6900] DBSC_StackSceneChanges:
00000127 292.28051758 [6900] DBSC_StackSceneChanges: EOS = RT_DBaseGetField(ScanDB,n,1)
00000128 292.28051758 [6900] DBSC_StackSceneChanges:
00000129 292.28054810 [6900] DBSC_StackSceneChanges: SceneNo = RT_DBaseGetField(ScanDB,n,3)+1
00000130 292.28054810 [6900] DBSC_StackSceneChanges:
00000131 292.28057861 [6900] DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000132 292.28057861 [6900] DBSC_StackSceneChanges:
00000133 292.28060913 [6900] DBSC_StackSceneChanges: A = RT_DBaseGetField(InfoDB,Max(n-1,0),6)
00000134 292.28060913 [6900] DBSC_StackSceneChanges:
00000135 292.28063965 [6900] DBSC_StackSceneChanges: B = RT_DBaseGetField(InfoDB,n,6)
00000136 292.28063965 [6900] DBSC_StackSceneChanges:
00000137 292.28063965 [6900] DBSC_StackSceneChanges: C = RT_DBaseGetField(InfoDB,Min(n+1,FC-1),6)
00000138 292.28067017 [6900] DBSC_StackSceneChanges:
00000139 292.28067017 [6900] DBSC_StackSceneChanges: Ax = (A<DupTh)?Max(RT_FrameDifference(Last,Last,n,n-2,ChromaWeight),A): A
00000140 292.28070068 [6900] DBSC_StackSceneChanges:
00000141 292.28070068 [6900] DBSC_StackSceneChanges: Cx = (C<DupTh)?Max(RT_FrameDifference(Last,Last,n+1,n+3,ChromaWeight),C): C # If Diff(n+1,n+2) too low, use Diff(n+1,n+3)
00000142 292.28073120 [6900] DBSC_StackSceneChanges:
00000143 292.28073120 [6900] DBSC_StackSceneChanges: PxDif = RT_LumaPixelsDifferent(Last,Last,delta2=1,Thresh=1) * 100.0 / 255.0
00000144 292.28076172 [6900] DBSC_StackSceneChanges:
00000145 292.28076172 [6900] DBSC_StackSceneChanges: FLGS = RT_DBaseGetField(ScanDB,n,4)
00000146 292.28079224 [6900] DBSC_StackSceneChanges:
00000147 292.28079224 [6900] DBSC_StackSceneChanges: CorrY = RT_Lumacorrelation(Last,Last,n=n,n2=n+1)
00000148 292.28079224 [6900] DBSC_StackSceneChanges:
00000149 292.28082275 [6900] DBSC_StackSceneChanges:
00000150 292.28082275 [6900] DBSC_StackSceneChanges:
00000151 292.28085327 [6900] DBSC_StackSceneChanges: FS=(RT_BitAnd(FLGS,$C0000000)!=0)?"USER OVERRIDE":(RT_BitTst(FLGS,16))?"PIXELCOUNT OVERRIDE":
00000152 292.28085327 [6900] DBSC_StackSceneChanges:
00000153 292.28088379 [6900] DBSC_StackSceneChanges: \ RT_BitTst(FLGS,17)?"MULTIFLASH OVERRIDE" : (RT_BitTst(FLGS,15))?"FADE-TO-BLACK":""
00000154 292.28088379 [6900] DBSC_StackSceneChanges:
00000155 292.28094482 [6900] DBSC_StackSceneChanges:
00000156 292.28094482 [6900] DBSC_StackSceneChanges:
00000157 292.28097534 [6900] DBSC_StackSceneChanges:
00000158 292.28097534 [6900] DBSC_StackSceneChanges:
00000159 292.28097534 [6900] DBSC_StackSceneChanges: Mn = RT_DBaseGetField(InfoDB,n,0)
00000160 292.28100586 [6900] DBSC_StackSceneChanges:
00000161 292.28100586 [6900] DBSC_StackSceneChanges: Mx = RT_DBaseGetField(InfoDB,n,1)
00000162 292.28103638 [6900] DBSC_StackSceneChanges:
00000163 292.28103638 [6900] DBSC_StackSceneChanges: MnMx = RT_DBaseGetField(InfoDB,n,2)
00000164 292.28106689 [6900] DBSC_StackSceneChanges:
00000165 292.28106689 [6900] DBSC_StackSceneChanges: Med = RT_DBaseGetField(InfoDB,n,3)
00000166 292.28109741 [6900] DBSC_StackSceneChanges:
00000167 292.28109741 [6900] DBSC_StackSceneChanges: AveY = RT_DBaseGetField(InfoDB,n,4)
00000168 292.28112793 [6900] DBSC_StackSceneChanges:
00000169 292.28112793 [6900] DBSC_StackSceneChanges: StdY = RT_DBaseGetField(InfoDB,n,5)
00000170 292.28112793 [6900] DBSC_StackSceneChanges:
00000171 292.28115845 [6900] DBSC_StackSceneChanges:
00000172 292.28115845 [6900] DBSC_StackSceneChanges:
00000173 292.28118896 [6900] DBSC_StackSceneChanges: Last = (SC==1) ? STARTCLIP : (SC==2) ? ENDCLIP : (SC==3) ? SINGLECLIP : Last
00000174 292.28118896 [6900] DBSC_StackSceneChanges:
00000175 292.28121948 [6900] DBSC_StackSceneChanges: RT_Subtitle(FMT, n,SC,SceneNo,SceneCnt,n-SOS,SOS,EOS,EOS-SOS+1,Ax,B,Cx,PxDif,CorrY,OVR,FLGS,FS)
00000176 292.28121948 [6900] DBSC_StackSceneChanges:
00000177 292.28125000 [6900] DBSC_StackSceneChanges: RT_Subtitle(FMT2,mn,mx,MnMx,Med,AveY,StdY,align=1)
00000178 292.28125000 [6900] DBSC_StackSceneChanges:
00000179 292.28128052 [6900] DBSC_StackSceneChanges: Return Last
00000180 292.28128052 [6900] DBSC_StackSceneChanges:
00000181 292.28128052 [6900] DBSC_StackSceneChanges:
00000182 292.31399536 [6900] DBSC_WriteFiles: Writing Start_Fn File '20160310_010658_294_Start.txt'
00000183 292.31411743 [6900] DBSC_WriteFiles: Writing End_Fn File '20160310_010658_294_End.txt'
00000184 292.76455688 [6900] DBSC_WriteFiles: Total Time taken = 0.47 Seconds (0.01 Mins)

StainlessS
10th March 2016, 05:15
I'm wondering that maybe v2.6MT behaves a little differently (apart from the obvious), anyway I noticed that I
added an arg to ScriptClip in current DBSC and perhaps it might cure the problem in version you have.


RT_DebugF("InfoDB=%s\nScanDB=%s\nScriptClip Script=\n%s",InfoDB,SCanDB,Script,name=myName)
Last.ScriptClip(Script,Args="InfoDB,ScanDB,FMT,FMT2,SceneCnt,STARTCLIP,ENDCLIP,SINGLECLIP,OVR,DupTh,ChromaWeight",Local=True)
} Else {
RT_DebugF("ScanDB=%s\nScriptClip SUBS_Script=\n%s",SCanDB,SUBS_Script,name=myName)
Last.ScriptClip(SUBS_Script,Args="ScanDB,STARTCLIP,ENDCLIP,SINGLECLIP",Local=True)

Supposed to cure a bug in Avisynth, where variables can interfere with each other, but still dont know if could be cause.
Perhaps you could add fix to your version DBSC and retry (no need to re-create DBases.)

Anyway, whether works or not here is current version with a Beta of v2 RT_Stats, no additional docs (v2.6 only).

Best of luck, hope it works ok. :)

EDIT: Must re-create DBases, different format for v2 RT, also supports greater than 2GB Array/DBase.

EDIT: Oops, and here the link:- http://www.mediafire.com/download/5vmkryz27gokbg9/DBSCv0.6B.zip

bcn_246
15th March 2016, 19:02
Thanks again for all the hard work, same error though :( 00000001 0.00000000 [4724] TffdshowBase::Constructor
00000002 0.00139088 [4724] TffdshowDecVideo::Constructor
00000003 0.00142574 [4724] TffdshowDecVideoOutputPin::Constructor
00000004 0.05437928 [4724] TffdshowDecVideo::Destructor
00000005 0.05556829 [4724] TffdshowDecVideoOutputPin::Destructor
00000006 7.66806078 [4724] RemoveDirt 1.0
00000007 9.64088249 [4724] SSETools 0.1
00000008 10.84836483 [4724] DBSC_CreateInfo: DBSC_CreateInfo: InfoDB does NOT exist
00000009 10.84837818 [4724] DBSC_CreateInfo: 'input.avi_Info.DB'
00000010 10.84884453 [4724] DBSC_CreateInfo: Initializing INFO DBase C:\edit\input.avi_Info.DB
00000011 11.40705109 [4724] DBSC_CreateInfo: 100 ] 5% Complete
00000012 11.92880726 [4724] DBSC_CreateInfo: 200 ] 10% Complete
00000013 12.47432137 [4724] DBSC_CreateInfo: 300 ] 15% Complete
00000014 13.00868320 [4724] DBSC_CreateInfo: 400 ] 20% Complete
00000015 13.52539349 [4724] DBSC_CreateInfo: 500 ] 25% Complete
00000016 14.05308437 [4724] DBSC_CreateInfo: 600 ] 30% Complete
00000017 14.58929062 [4724] DBSC_CreateInfo: 700 ] 35% Complete
00000018 15.11684227 [4724] DBSC_CreateInfo: 800 ] 40% Complete
00000019 15.64067173 [4724] DBSC_CreateInfo: 900 ] 45% Complete
00000020 16.16324425 [4724] DBSC_CreateInfo: 1000 ] 50% Complete
00000021 16.69487953 [4724] DBSC_CreateInfo: 1100 ] 55% Complete
00000022 17.20796013 [4724] DBSC_CreateInfo: 1200 ] 60% Complete
00000023 17.74340820 [4724] DBSC_CreateInfo: 1300 ] 65% Complete
00000024 18.27809906 [4724] DBSC_CreateInfo: 1400 ] 70% Complete
00000025 18.81997108 [4724] DBSC_CreateInfo: 1500 ] 75% Complete
00000026 19.36166382 [4724] DBSC_CreateInfo: 1600 ] 80% Complete
00000027 19.89013100 [4724] DBSC_CreateInfo: 1700 ] 85% Complete
00000028 20.42737961 [4724] DBSC_CreateInfo: 1800 ] 90% Complete
00000029 20.94775581 [4724] DBSC_CreateInfo: 1900 ] 95% Complete
00000030 21.48851967 [4724] DBSC_CreateInfo: Total Time taken = 10.66 Seconds (0.18 Mins)
00000031 21.54249573 [4724] DBSC_Scan: DBSC_Scan: ScanDB does NOT exist
00000032 21.54251099 [4724] DBSC_Scan: 'input.avi_Scan.DB'
00000033 21.54333878 [4724] DBSC_Scan: Initializing Scenechange Scan DBase C:\edit\input.avi_Scan.DB
00000034 21.54419136 [4724] DBSC_Scan: Deleting Existing logs
00000035 21.54808807 [4724] DBSC_Scan: Creating Scan DBase
00000036 24.71230888 [4724] DBSC_Scan: ReScan for Fade-to-Black SceneChanges:
00000037 24.82045364 [4724] DBSC_Scan: Writing Full SceneChange DBase Data
00000038 25.41054726 [4724] DBSC_Scan: Total Time taken = 3.92 Seconds (0.07 Mins)
00000039 25.54019165 [4724] DBSC_WriteFiles: Writing Start_Fn File '~20160315_175830_505_Start.txt'
00000040 25.54027939 [4724] DBSC_WriteFiles: Writing End_Fn File '~20160315_175830_505_End.txt'
00000041 25.64020538 [4724] DBSC_WriteFiles: Total Time taken = 0.14 Seconds (0.00 Mins) http://i.imgur.com/bp9jk7b.jpg

StainlessS
16th March 2016, 12:10
Sorry bcn, I'm completely stumped.
Can you post TEM.Log please.

EDIT: Can you also amend SubsClip source as below (additions in BLUE)


Met1 = """
iex = RT_VarExist("InfoDB")
eex = (iex && Exist(InfoDB))
RT_DebugF("iex=%s eex=%s InfoDB='%s'",iex,eex,iex?InfoDB:"",name="InfoDBTest: ")

SOS = RT_DBaseGetField(ScanDB,n,0)
EOS = RT_DBaseGetField(ScanDB,n,1)


and at end of the function


""")
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}


Should output something like this


00000008 11:03:30 InfoDBTest: About to call ScriptClip InfoDB='D:\DBSC\I.avi_Info.DB'
00000009 11:03:30 InfoDBTest: Args='InfoDB,ScanDB,STARTCLIP,ENDCLIP,SINGLECLIP,FMT,FMT2,SceneCnt,OVR,dFact,dMinim,dMinLen,oCorr,fCorr,
fFrames,DupTh,Matrix,Thresh,ChromaWeight'
00000010 11:03:30 InfoDBTest: iex=True eex=True InfoDB='D:\DBSC\I.avi_Info.DB'


EDIT: CAll as so

# MaxCrop_Client.avs

Import("DBSC.avs")

#VideoFileName = "I.avi"
VideoFileName = "Input.avi"

InfoDB = VideoFileName+"_Info.DB" # INFO DBase
ScanDB = VideoFileName+"_Scan.DB" # SCAN DBase
LogFn = VideoFileName+"_User.Log"
SpliceDB = VideoFileName+"_Splice.DB"

RECYCLE_INFO_DB= True
RECYCLE_SCAN_DB= True
OVERRIDE = "Override.txt" # Override as Filename
#FUNC = "DBSC_AutoContrast(SpliceDB=SpliceDB,SceneNo=SceneNo,Show=True)"
FUNC = "DBSC_MaxCrop(SpliceDB=SpliceDB,SceneNo=SceneNo)"

# Scene change detection
dFact = 2.0 # lower more sensitive
dMinim = 4.0 # lower more sensitive
dMinLen= 12 # Least number of frames in scene


Avisource(VideoFileName)

DBSC_CreateInfo(InfoDB,RecycleDB=RECYCLE_INFO_DB) # Create INFO DB (REQUIRED), for fast scanning
DBSC_Scan(InfoDB,ScanDB,RecycleDB=RECYCLE_SCAN_DB,dfact=dFact,dMinim=dMinim,dminlen=dMinLen) # Detect Scene Changes and store in ScanDB

#DBSC_Override(ScanDB,OVERRIDE) # Only if required (Probably NOT necessary)

#Return DBSC_StackSceneChanges(Last,InfoDB,ScanDB).ConvertToRGB32 # Check detections START/END of scene STACKED.



# VIEW SCene Changes Before DBSC_DynaCrop
Return DBSC_SubsClip(InfoDB,ScanDB,Subs=True,Metrics=True,Metrics2=True) # View detection metrics

bcn_246
16th March 2016, 14:47
Hey, cheers mate. As I am sure you can tell I am no scripter... I wasn't sure where to put the Met1 =, so I just have just put it after the input clip call). So far the script now looks like so: # MaxCrop_Client.avs

Import("DBSC.avs")

#VideoFileName = "I.avi"
VideoFileName = "Input.avi"

Met1 = """
iex = RT_VarExist("InfoDB")
eex = (iex && Exist(InfoDB))
RT_DebugF("iex=%s eex=%s InfoDB='%s'",iex,eex,iex?InfoDB:"",name="InfoDBTest: ")

SOS = RT_DBaseGetField(ScanDB,n,0)
EOS = RT_DBaseGetField(ScanDB,n,1)

InfoDB = VideoFileName+"_Info.DB" # INFO DBase
ScanDB = VideoFileName+"_Scan.DB" # SCAN DBase
LogFn = VideoFileName+"_User.Log"
SpliceDB = VideoFileName+"_Splice.DB"

RECYCLE_INFO_DB= True
RECYCLE_SCAN_DB= True
OVERRIDE = "Override.txt" # Override as Filename
#FUNC = "DBSC_AutoContrast(SpliceDB=SpliceDB,SceneNo=SceneNo,Show=True)"
FUNC = "DBSC_MaxCrop(SpliceDB=SpliceDB,SceneNo=SceneNo)"

# Scene change detection
dFact = 2.0 # lower more sensitive
dMinim = 4.0 # lower more sensitive
dMinLen= 12 # Least number of frames in scene


Avisource(VideoFileName)

DBSC_CreateInfo(InfoDB,RecycleDB=RECYCLE_INFO_DB) # Create INFO DB (REQUIRED), for fast scanning
DBSC_Scan(InfoDB,ScanDB,RecycleDB=RECYCLE_SCAN_DB,dfact=dFact,dMinim=dMinim,dminlen=dMinLen) # Detect Scene Changes and store in ScanDB

#DBSC_Override(ScanDB,OVERRIDE) # Only if required (Probably NOT necessary)

#Return DBSC_StackSceneChanges(Last,InfoDB,ScanDB).ConvertToRGB32 # Check detections START/END of scene STACKED.



# VIEW SCene Changes Before DBSC_DynaCrop
Return DBSC_SubsClip(InfoDB,ScanDB,Subs=True,Metrics=True,Metrics2=True) # View detection metrics

###
### DynaCrop args
###

# Edges to crop: RLBT, Default 15($F). bit flags of edges to crop. 1=Top, 2=Bot, 4=Left, 8=Right. (1+2+4+8=15 = all sides)
RLBT=$F # Left and Right, TOP and BOT
# RoboCrop Thresh, -40 = current Robocrop AutoThresh : -32 = Older version RoboCrop AutoThresh
CropThresh= -40 # Current ver AutoThresh
# Maximum amount to crop that is OVER AND ABOVE least amount of cropping for entire clip. (ie is trial RoboCropped prior to Dynamic cropping)
CropLimit_Left = 8
CropLimit_Top = 8
CropLimit_Right= 8
CropLimit_Bot = 8



# Return one of two below funcs, DBSC_DynaCrop MUST have been called (at some time) before DBSC_DynaSplice (THEN COMMENT OUT)
Return DBSC_DynaCrop(ScanDB,SpliceDB=SpliceDB,rlbt=RLBT,LogFn=LogFn,CropLimit_Left=CropLimit_Left,CropLimit_Top=CropLimit_Top,Show=True,CropThresh=CropThresh,CropLimit_Right=CropLimit_Right,CropLimit_Bot=CropLimit_Bot,Debug=True)
# *** COMMENT OUT ABOVE DBSC_DynaCrop line after DBSC_DynaCrop creates SpliceDB ***

DBSC_DynaSplice(SpliceDB,Func) # See clip or DebugView for results
Return Last # *** This is YOUR REAL RESULT ***

DBSC_SubsClip(InfoDB,ScanDB,Subs=True,Metrics=true,Metrics2=False)
Return Last # Or Result with Scene Change detection Metrics

Function DBSC_MaxCrop(clip c,String "SpliceDB",Int "SceneNo" ) {
/*
Call DBSC_DynaSplice with eg
FUNC = "DBSC_MaxCrop(SpliceDB=SpliceDB,SceneNo=SceneNo)"
DBSC_DynaSplice(c,SpliceDB,func=FUNC)

DB Fields.
FieldNumber Type Contents
0 Int Start of Scene frame
1 Int End of Scene frame
2 Int Input clip Width (same for all DB).
3 Int Input clip Height (same for all DB).
4 Int Output clip resize Width (same for all DB).
5 Int Output clip resize Height (same for all DB).
6 Int Scene Crop left (X) offset
7 Int Scene Crop top (Y) offset
8 Int Scene Abs Crop Width
9 Int Scene Abs Crop Heigth
10 Int Scene signed crop width (width relative)
11 Int Scene signed crop height (height relative)
12 String Resizer String (256 chars], Same for all DB
*/
c
myName="DBSC_MaxCrop: "
Valid = (SpliceDB!="" && SceneNo>= 0) # Basic Validity test
Assert(Valid,RT_String("%sMUST Supply SpliceDB and SceneNo",myName))
Global Glb_DBSC_MaxCrop_X = RT_VarExist("Glb_DBSC_MaxCrop_X") ? Glb_DBSC_MaxCrop_X : 0 # Initialize Globals on first use
Global Glb_DBSC_MaxCrop_Y = RT_VarExist("Glb_DBSC_MaxCrop_Y") ? Glb_DBSC_MaxCrop_Y : 0
Global Glb_DBSC_MaxCrop_W = RT_VarExist("Glb_DBSC_MaxCrop_W") ? Glb_DBSC_MaxCrop_W : 0
Global Glb_DBSC_MaxCrop_H = RT_VarExist("Glb_DBSC_MaxCrop_H") ? Glb_DBSC_MaxCrop_H : 0
GScript("""
Assert(RT_DBaseGetID(SpliceDB,0)==DBSC_Str2ID("DYNS"),RT_String("%sNot a SpliceDB\n%s",myName,SpliceDB))
S = RT_DBaseGetField(SpliceDB,SceneNo,0) # SpliceDB Start Of Scene frame (0 relative)
E = RT_DBaseGetField(SpliceDB,SceneNo,1) # SpliceDB End Of Scene frame (0 relative)
Length = E-S+1 # Length of scene
X = RT_DBaseGetField(SpliceDB,SceneNo,6) # Curr Left Crop
Y = RT_DBaseGetField(SpliceDB,SceneNo,7) # Curr Top Crop
W = RT_DBaseGetField(SpliceDB,SceneNo,10) # Curr W Crop (Signed ie Right edge relative)
H = RT_DBaseGetField(SpliceDB,SceneNo,11) # Curr H Crop (Signed ie bot edge relative)
Global Glb_DBSC_MaxCrop_X = Max(Glb_DBSC_MaxCrop_X,X)
Global Glb_DBSC_MaxCrop_Y = Max(Glb_DBSC_MaxCrop_Y,Y)
Global Glb_DBSC_MaxCrop_W = Min(Glb_DBSC_MaxCrop_W,W)
Global Glb_DBSC_MaxCrop_H = Min(Glb_DBSC_MaxCrop_H,H)
RT_DebugF("#%d S=%d E=%d Len=%d : X=%d Y=%d W=%d H=%d : MxX=%d MxY=%d MxW=%d MxH=%d",
\ SceneNo,S,E,Length, X,Y,W,H, Glb_DBSC_MaxCrop_X,Glb_DBSC_MaxCrop_Y,Glb_DBSC_MaxCrop_W,Glb_DBSC_MaxCrop_H,name=myName)
RT_Subtitle("#%d S=%d E=%d Len=%d\nX=%d Y=%d W=%d H=%d\nMxX=%d MxY=%d MxW=%d MxH=%d",
\ SceneNo,S,E,Length, X,Y,W,H, Glb_DBSC_MaxCrop_X,Glb_DBSC_MaxCrop_Y,Glb_DBSC_MaxCrop_W,Glb_DBSC_MaxCrop_H,align=2)
""")
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}

I am sure I have edited something wrong, as I am now getting the following on attempting to open the file...
http://i.imgur.com/axesJmv.png

StainlessS
16th March 2016, 17:22
Hehe, not there old chum.

Sorry I should have said, in the SubsClip function in DBSC.avs, (search 'Met1').

PS, well actually I did say SubsClip, ie

Can you also amend SubsClip source as below (additions in BLUE)

and also add the 2nd bit as the end of the SubsClip function.

bcn_246
22nd March 2016, 17:32
Tried making the edits to DBSC.avs... the video is loading as before but the error number is now [(GScript], line 22), previously it was [(GScript], line 18). Also, while there were two different frames from the video stacked vertically, now there is just a single one.

http://i.imgur.com/ZgDmiF4.png

If you could check I have made the changes correctly and am not just being dim that would be great!

MaxCrop_Client.avs (edited)
https://paste2.org/vCvBp9IN

DBSC.avs (edited)
https://paste2.org/nHCcOVA5

StainlessS
23rd March 2016, 06:15
You missed out this bit from end of SubsClip function,


""")
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}


But what I wanted to see was the debug output, ie just the relevant lines ie (lines Starting with "InfoDBTest:")

this

RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")


and this

iex = RT_VarExist("InfoDB")
eex = (iex && Exist(InfoDB))
RT_DebugF("iex=%s eex=%s InfoDB='%s'",iex,eex,iex?InfoDB:"",name="InfoDBTest: ")

bcn_246
23rd March 2016, 14:21
Honestly I am a bit confused... I checked again and I think I have put the """)
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}
section at the end of the DBSC_SubsClip function (in DBSC.avs), replacing the original """)
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}

StainlessS
23rd March 2016, 20:07
Sorry, can't explain that, was sure that was missing when I checked earlier.
Anyway, what was the output ?

slavanap
24th March 2016, 12:12
Hey, bcn_246

You can try this out: http://sendfile.su/1217836
It's my old development to detect crops for 3D videos, I can compile it once more later, if needed.
It detects crop for every 20 frames, and picks the minimum one.

Usage with Avisynth:
LoadPlugin("cropdetect.dll")
CropDetect(leftviewclip, rightviewclip, "sample.crop")
You can set leftviewclip = rightviewclip = yoursourcevideo to make it work right now. Open this clip (with VirtualDub, for example) and wait till it render something.


The generated .crop file usage:
create another .avs with similar contents
FFMpegSource2("sample.mkv")
Import("sample.crop")
That's it. As the output you'll get properly cropped video.

StainlessS
24th March 2016, 20:48
Slavanap,

It detects crop for every 20 frames, and picks the minimum one

bcn_246 want Maximum crop ie chop off all borders down to max, minimum frame left.

AutoCrop, or RoboCrop select minimum amount of borders to crop, there may be sections that still have a little border, bcn want rid of all borders
leaving no borders whatsoever.

Are you saying that your script does as bcn requires ?

EDIT: Also, tell bcn which button to click on (I picked one of them and it did not work, my Russian aint great).

slavanap
25th March 2016, 00:16
Okey, I recompiled my old plugin with conversion from MSVS 2008 to MSVS 2013.

Here you can find it: <obsolete link removed>

And I mistook about 20 frames value. The plugin does not pick every 20 frames, it picks only 20 frames uniformly distributed over whole video. Detection process will be pretty fast.

bcn_246 want Maximum crop ie chop off all borders down to max, minimum frame left.
Well, in this case you can play with threshold value. The higher value will crop more. I suggest something like 100 or 200 instead default 24.

AutoCrop, or RoboCrop select minimum amount of borders to crop, there may be sections that still have a little border, bcn want rid of all borders
leaving no borders whatsoever.

Are you saying that your script does as bcn requires ?
Got it. Fixed it with adding threshold parameter.

slavanap
25th March 2016, 01:25
I made dumb bug in previous release.
Here's fixed one: <obsolete link removed>

Reel.Deel
25th March 2016, 03:00
@slavanap

What colorspaces does your plugin support? I looked at the source and it looks like it only supports RGB32.

StainlessS
25th March 2016, 06:40
What colorspaces does your plugin support? I looked at the source and it looks like it only supports RGB32.

It converts non RGB32 to RGB32. [EDIT: via the filter constructor.]


return env->Invoke("ConvertToRGB32", AVSValue(args, 1), arg_names).AsClip();

slavanap
25th March 2016, 10:13
Here's new release: https://github.com/slavanap/autocropper/releases/tag/0.3
And here's code diff: https://github.com/slavanap/autocropper/compare/0.2...0.3

Reel.Deel,
It supports all color spaces, but for processing it converts to RGB32 internally. Now that's explicit. Use any colorspace you want.

StainlessS,
Yes, you're right. Fixed that.

UPDATED:
CropDetect function moved to ssifSource.dll plugin. Here's its public release: https://github.com/slavanap/ssifSource/releases

bcn_246
6th April 2016, 12:09
Thanks for all the help guys. With regard to slavanap's suggestion is there a way to have it scan the whole video (or possibly set it to scan every nth frame) rather than just 20 frames spread out? The content I am working with is from the 90's, so just when I think I have all borders cropped I then notice one 10 second section with an extra few pixels of black border.

With regards to your script StanlessS, are any runtimes etc required? Still not having any luck [(GScript], line 22).

Regards,

Ben

StainlessS
6th April 2016, 22:39
You would have problems way before that error if runtimes missing.

You still have not given Debug Output, I expect it to tell Args, and InfoDB name before entry into GScript(script),
ie this line

""")
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}


and inside script clip tell if InfoDB variable exists and whether the file exists, ie this line

iex = RT_VarExist("InfoDB")
eex = (iex && Exist(InfoDB))
RT_DebugF("iex=%s eex=%s InfoDB='%s'",iex,eex,iex?InfoDB:"",name="InfoDBTest: ")


You could also change the first code block to this

""")
RT_DebugF("About to call ScriptClip InfoDB='%s'\nArgs='%s'",InfoDB,args,name="InfoDBTest: ")
RT_WriteFile("Debug_Script.txt","%s",Script)
(Subs||Metrics||Metrics2) ? GScript(Script) : NOP
return Last
}


Addition in blue. This will write the actual Scriptclip script to Debug_Script.txt.

Then post DebugView ouput text (just the relevant stuff above) and the Debug_Script file.

It actually sounds like a "Wind up", dont see how it is not working :)

StainlessS
15th April 2016, 17:19
Yo bcn,

I've just had a problem myself opening a DBase file under Media Player Classic Home Cinema, GOM Player and also Windows Media Player (v11.0, I think).
But no problems under Windows Media Player v2.0, Potplayer, or any Virtual Dub.

No idea how/when/why this came about, I'm quite sure that it use to work just fine under at least MPC-HC, I use it all of the time.
What are you trying to open the DBSC script with ? (try Vdub or PotPlayer or Media Player 2.0 if you have it).

Disabled AntiVirus and Firewall stuff, same.

slavanap
20th April 2016, 10:03
bcn_246,
There is a way to scan the whole video
CropDetect(source, "sample.crop", 24, source.framecount)
but I still don't get it what you want to do with this short part with additional black border. Do you want to crop the area to these 10 pixels, thus you'll loose 10 pixels of all other video part that doesn't have that 10 pixels additional black border? So you need to get maximum cropping values available? The main issue here is that crop values at totally black frames with such tactic will be wrong and will influence on result cropping values.

In this case, maybe, we can dump crop values detected for each frame in a vectors, e.g.
crop_left = array(0,0, ..., 0) -- framecount elements.
crop_top = array(10,11,9, ... , 8) etc.
then sort these arrays and pick the middle element value as a result crop value (i.e. perform median filtration of crop values).
What do you think about it?

Anyway, further task explanation required, because I think I yet don't understand what you want to achieve.

bcn_246
20th April 2016, 11:28
Yo bcn,

I've just had a problem myself opening a DBase file under Media Player Classic Home Cinema, GOM Player and also Windows Media Player (v11.0, I think).
But no problems under Windows Media Player v2.0, Potplayer, or any Virtual Dub.

No idea how/when/why this came about, I'm quite sure that it use to work just fine under at least MPC-HC, I use it all of the time.
What are you trying to open the DBSC script with ? (try Vdub or PotPlayer or Media Player 2.0 if you have it).

Disabled AntiVirus and Firewall stuff, same.

I will give it a try when I get back home. Thanks for all your help with this (and the duplicate frame interpolation script you posted the other day helped me out loads).

Regards,

Ben

StainlessS
25th August 2016, 19:41
Hi bcn,
If you have this problem in future, I suggest you look here:- http://forum.doom9.org/showthread.php?p=1778563#post1778563

Can call RoboCrop, which crops at outermost detected border, and then scan though in eg Vdub, when you come to a section with
more border, adjust eg AddTop to desired additional border value, and keep scanning and re-adjusting.
Its got to be way quicker and easier than using DBSC.
I dont want to encourage people to use DBSC for that and so shall remove the DBSC_MaxCrop (or whatever it was called) from DBSC scripts.

By the way, that little toadstool that you are probably sitting on (red cap with white dots) is quite poisonous (Fly Agaric), containing some kind
of sticky hallucinogenic and quite poisonous substance, do not be tempted to gobble it up, there is no known safe limit.
They used to soak it in milk and leave out on saucer, flies would visit, slurp it up and end up happy but dead in the milk.

So dont be tempted to snack on what you sit on, you know it makes sense. :)