View Full Version : How to check if a shot is static?
spoRv
25th April 2018, 23:52
I want to apply a certain filter only on static shots, and other on moving shots.
Because even within static shots there are things in movements - like people, cars etc. - I guess the best option would be to check the corners; if, let's say, two or more corners have similar content than previous frame, *maybe* this is a static shot.
The problem is, how can I check if a frame is part of a static shot - taking in accounts also possible false positives due to grain?
Thanks in advance!
johnmeyer
26th April 2018, 00:22
The various AVISynth YDifference functions provide information on how much movement there is between frames. Also, StainlessS' "RTStats" may have functions you can use.
StainlessS
26th April 2018, 01:15
SpoRv,
You can try playing with this, but I'm not too hopefull, probably jumping continuously static/moving ad-nauseum.
#AvisourcE("..\G.avi")
AvisourcE(".\Temp.avi")
BLKW=48
BLKH=48
TH=0.900 # ~ 0.8 -> 1.0 (hi is match, max=1.0)
PC_MAT =6 # matching with prev (for static, MAX=8, or eg 9 ignore PC_MAT [there are only 8])
NC_MAT =6 # matching with next
TOT_MAT=9 # total matching
SHOW=True
VERB=True # Verbose
STATIC=1
MOVEY =2
FN="D:\ClipClopCmd.txt" # ClipClop(Src,StaticFiltClip,MovingFiltClip,Cmd="D:\ClipClopCmd.txt")
###################
RT_FileDelete(FN)
HILITE= "!"
NORM="-"
SSS="""
n=current_frame
M_X = (Width - BLKW)/4*2 M_Y = (Height - BLKH)/4*2
# Match to Prev
TL_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, W=BLKW,H=BLKH)
TM_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=M_X, W=BLKW,H=BLKH)
TR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=Width-BLKW, H=BLKH)
ML_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, y=M_Y, W=BLKW,H=BLKH)
MR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=Width-BLKW,y=M_Y, H=BLKH)
BL_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, y=Height-BLKH,W=BLKW )
BM_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=M_X, y=Height-BLKH,W=BLKW )
BR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=width-BLKW,y=Height-BLKH)
# Match to Next
TL_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, W=BLKW,H=BLKH)
TM_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=M_X, W=BLKW,H=BLKH)
TR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=Width-BLKW, H=BLKH)
ML_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, y=M_Y, W=BLKW,H=BLKH)
MR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=Width-BLKW,y=M_Y, H=BLKH)
BL_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, y=Height-BLKH,W=BLKW )
BM_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=M_X, y=Height-BLKH,W=BLKW )
BR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=width-BLKW,y=Height-BLKH)
PC=0 # Prev Count
if(n>0) { # Avoid false match on first frame
if(TL_P>=TH){PC=PC+1} if(TM_P>=TH){PC=PC+1} if(TR_P>=TH){PC=PC+1}
if(ML_P>=TH){PC=PC+1} if(MR_P>=TH){PC=PC+1}
if(BL_P>=TH){PC=PC+1} if(BM_P>=TH){PC=PC+1} if(BR_P>=TH){PC=PC+1}
}
NC=0 # Next Count
if(n<FrameCount-1) { # Avoid false match on last frame
if(TL_N>=TH){NC=NC+1} if(TM_N>=TH){NC=NC+1} if(TR_N>=TH){NC=NC+1}
if(ML_N>=TH){NC=NC+1} if(MR_N>=TH){NC=NC+1}
if(BL_N>=TH){NC=NC+1} if(BM_N>=TH){NC=NC+1} if(BR_N>=TH){NC=NC+1}
}
TOT=PC+NC
IsPCMAT =(PC>=PC_MAT) IsNCMAT =(NC>=NC_MAT) IsTOTMAT=(TOT>=TOT_MAT)
IsStatic = (IsPCMAT || IsNCMAT || IsTOTMAT) # Maybe mod to your own logic
if(SHOW) {
PCOL=(ISPCMAT) ? HILITE:NORM
NCOL=(ISNCMAT) ? HILITE:NORM
TCOL=(IsTOTMAT) ? HILITE:NORM
SCOL=IsStatic ? HILITE:NORM
RT_Subtitle("\a%sPC=%d\a- : \a%sNC=%d\a- : \a%sTot=%d\a- : \a%sSTATIC=%s",PCOL,PC,NCOL,NC,TCOL,TOT,SCOL,IsStatic)
if(VERB) {
RT_SubTitle(
\ "TL_P=%6.3f TM_P=%6.3f TR_P=%6.3f\r" +
\ "ML_P=%6.3f MR_P=%6.3f\r" +
\ "BL_P=%6.3f BM_P=%6.3f BR_P=%6.3f\r\r" +
\ "TL_N=%6.3f TM_N=%6.3f TR_N=%6.3f\r" +
\ "ML_N=%6.3f MR_N=%6.3f\r" +
\ "BL_N=%6.3f BM_N=%6.3f BR_N=%6.3f",
\ TL_P,TM_P,TR_P,ML_P,MR_P,BL_P,BM_P,BR_P,
\ TL_N,TM_N,TR_N,ML_N,MR_N,BL_N,BM_N,BR_N,
\ x=(width-350)/2,y=(Height-140)/2)
}
}
if(IsStatic) {
RT_WriteFile(FN,"%d %d",STATIC,n,Append=True) # Static frame at clipclop clip index STATIC, and frame n
} else {
RT_WriteFile(FN,"%d %d",MOVEY,n,Append=True) # Moving frame at clipclop clip index MOVEY, and frame n
}
return last
"""
Scriptclip(SSS)
return Last
I've tried to make it as easily hackable as I can, you will have to do any tweaking, I dont have the time to play with it.
burfadel
26th April 2018, 01:16
YDifference may not work too well, depending on the moving subject. For example, a moving car with a 'single' base colour background like the road. As the car moves the background effectively remains the same since it's consistent, and the car luma stays the same since they don't change colour. The YDifference therefore will be very limited.
If you use selectodd and selecteven, you can compare side by side frames. You can then use Masktools to see the difference, and then mask the moving areas (there is another way that is a little less precise possibly). You can then apply the filter only to the moving elements of the frame, and the different filter to the static areas.
johnmeyer
26th April 2018, 02:18
YDifference may not work too well, depending on the moving subject. For example, a moving car with a 'single' base colour background like the road. As the car moves the background effectively remains the same since it's consistent, and the car luma stays the same since they don't change colour. The YDifference therefore will be very limited.I don't think that is true. My understanding is that the various YDifference functions that are built into AVISynth compute a sum of absolute differences on each pixel in the current frame with the pixels in the same position in the adjacent frame. Thus, a moving car will generate significant differences because the pixel that is depicting a shiny spot on the car in the current frame will go dark as the car moves because a dull spot on the car is now occupying the same pixel position and therefore generates a large absolute difference.
I just did a quick test to prove my point. Here's a link to a video of a car, with the camera panning to keep the car in frame, followed by a hand-held static shot. As you see, the YDifference values are much larger for the car shot.
YDifference Test File (10 MB) (http://www.mediafire.com/file/gmqoh5ovza7bl77/temp.avi)
If the car were actually traveling through the frame, the YDifference values would be much higher.
StainlessS
26th April 2018, 02:24
Variations on a Theme
# Req RT_Stats v2.0 Beta.
#AvisourcE("..\G.avi")
AvisourcE(".\Temp.avi")
BLKW=48
BLKH=48
TH=0.08 # ~ 0.0 -> 8.0 (low is match, 255.0 is totally diff)
CW=0.2 # ChromaWeight, 0.0 = Luma Only : 1.0=Chroma Only (0.0->1.0)
PC_MAT =6 # matching with prev (for static, MAX=8, or eg 9 ignore PC_MAT [there are only 8])
NC_MAT =6 # matching with next
TOT_MAT=9 # total matching
SHOW=True
VERB=True # Verbose
STATIC=1
MOVEY =2
FN="D:\ClipClopCmd.txt" # ClipClop(Src,StaticFiltClip,MovingFiltClip,Cmd="D:\ClipClopCmd.txt")
###################
RT_FileDelete(FN)
HILITE= "!"
NORM="-"
SSS="""
n=current_frame
M_X = (Width - BLKW)/4*2 M_Y = (Height - BLKH)/4*2
# Match to Prev
TL_P=RT_FrameDifference(Last,Last,n=n,n2=n-1, W=BLKW,H=BLKH,ChromaWeight=CW)
TM_P=RT_FrameDifference(Last,Last,n=n,n2=n-1,x=M_X, W=BLKW,H=BLKH,ChromaWeight=CW)
TR_P=RT_FrameDifference(Last,Last,n=n,n2=n-1,x=Width-BLKW, H=BLKH,ChromaWeight=CW)
ML_P=RT_FrameDifference(Last,Last,n=n,n2=n-1, y=M_Y, W=BLKW,H=BLKH,ChromaWeight=CW)
MR_P=RT_FrameDifference(Last,Last,n=n,n2=n-1,x=Width-BLKW,y=M_Y, H=BLKH,ChromaWeight=CW)
BL_P=RT_FrameDifference(Last,Last,n=n,n2=n-1, y=Height-BLKH,W=BLKW ,ChromaWeight=CW)
BM_P=RT_FrameDifference(Last,Last,n=n,n2=n-1,x=M_X, y=Height-BLKH,W=BLKW ,ChromaWeight=CW)
BR_P=RT_FrameDifference(Last,Last,n=n,n2=n-1,x=width-BLKW,y=Height-BLKH ,ChromaWeight=CW)
# Match to Next
TL_N=RT_FrameDifference(Last,Last,n=n,n2=n+1, W=BLKW,H=BLKH,ChromaWeight=CW)
TM_N=RT_FrameDifference(Last,Last,n=n,n2=n+1,x=M_X, W=BLKW,H=BLKH,ChromaWeight=CW)
TR_N=RT_FrameDifference(Last,Last,n=n,n2=n+1,x=Width-BLKW, H=BLKH,ChromaWeight=CW)
ML_N=RT_FrameDifference(Last,Last,n=n,n2=n+1, y=M_Y, W=BLKW,H=BLKH,ChromaWeight=CW)
MR_N=RT_FrameDifference(Last,Last,n=n,n2=n+1,x=Width-BLKW,y=M_Y, H=BLKH,ChromaWeight=CW)
BL_N=RT_FrameDifference(Last,Last,n=n,n2=n+1, y=Height-BLKH,W=BLKW ,ChromaWeight=CW)
BM_N=RT_FrameDifference(Last,Last,n=n,n2=n+1,x=M_X, y=Height-BLKH,W=BLKW ,ChromaWeight=CW)
BR_N=RT_FrameDifference(Last,Last,n=n,n2=n+1,x=width-BLKW,y=Height-BLKH ,ChromaWeight=CW)
PC=0 # Prev Count
if(n>0) { # Avoid false match on first frame
if(TL_P<=TH){PC=PC+1} if(TM_P<=TH){PC=PC+1} if(TR_P<=TH){PC=PC+1}
if(ML_P<=TH){PC=PC+1} if(MR_P<=TH){PC=PC+1}
if(BL_P<=TH){PC=PC+1} if(BM_P<=TH){PC=PC+1} if(BR_P<=TH){PC=PC+1}
}
NC=0 # Next Count
if(n<FrameCount-1) { # Avoid false match on last frame
if(TL_N<=TH){NC=NC+1} if(TM_N<=TH){NC=NC+1} if(TR_N<=TH){NC=NC+1}
if(ML_N<=TH){NC=NC+1} if(MR_N<=TH){NC=NC+1}
if(BL_N<=TH){NC=NC+1} if(BM_N<=TH){NC=NC+1} if(BR_N<=TH){NC=NC+1}
}
TOT=PC+NC
IsPCMAT =(PC>=PC_MAT) IsNCMAT =(NC>=NC_MAT) IsTOTMAT=(TOT>=TOT_MAT)
IsStatic = (IsPCMAT || IsNCMAT || IsTOTMAT) # Maybe mod to your own logic
if(SHOW) {
PCOL=(ISPCMAT) ? HILITE:NORM
NCOL=(ISNCMAT) ? HILITE:NORM
TCOL=(IsTOTMAT) ? HILITE:NORM
SCOL=IsStatic ? HILITE:NORM
RT_Subtitle("\a%sPC=%d\a- : \a%sNC=%d\a- : \a%sTot=%d\a- : \a%sSTATIC=%s",PCOL,PC,NCOL,NC,TCOL,TOT,SCOL,IsStatic)
if(VERB) {
RT_SubTitle(
\ "TL_P=%7.3f TM_P=%7.3f TR_P=%7.3f\r" +
\ "ML_P=%7.3f MR_P=%7.3f\r" +
\ "BL_P=%7.3f BM_P=%7.3f BR_P=%7.3f\r\r" +
\ "TL_N=%7.3f TM_N=%7.3f TR_N=%7.3f\r" +
\ "ML_N=%7.3f MR_N=%7.3f\r" +
\ "BL_N=%7.3f BM_N=%7.3f BR_N=%7.3f",
\ TL_P,TM_P,TR_P,ML_P,MR_P,BL_P,BM_P,BR_P,
\ TL_N,TM_N,TR_N,ML_N,MR_N,BL_N,BM_N,BR_N,
\ x=(width-380)/2,y=(Height-140)/2)
}
}
if(IsStatic) {
RT_WriteFile(FN,"%d %d",STATIC,n,Append=True) # Static frame at clipclop clip index STATIC, and frame n
} else {
RT_WriteFile(FN,"%d %d",MOVEY,n,Append=True) # Moving frame at clipclop clip index MOVEY, and frame n
}
return last
"""
Scriptclip(SSS)
return Last
Prev script also updated, Again. Prev sclipt spots every frame exact for Johns clip.
Above script dont do well with Johns clip.
raffriff42
26th April 2018, 03:12
If I were doing this I would first try Deshaker (http://www.guthspot.se/video/deshaker.htm), leveraging its years of development and tuning. After you run pass 1, you get a report of camera pan & zoom in the log file.
Here's a sample log. The source video was 99% static shots with a few subtle camera moves in one section. I've added column labels (see documentation (http://www.guthspot.se/video/deshaker.htm) - scroll down to "Log file format"). You can spot scenes with camera movement pretty easily.COLUMNS:
Frame# | pan X | pan Y | rot | zoom | (...) |scene | % OK
=====================================================================================
1 0.01 0.03 -0.004 0.99982 0.00 97.62
2 0.01 0.03 -0.004 0.99983 0.01 97.62
3 0.01 0.04 -0.000 0.99983 0.01 100.00
4 0.01 0.04 0.000 0.99983 0.00 100.00
5 0.01 0.03 -0.004 0.99984 0.00 97.62
6 0.01 0.03 -0.004 0.99983 0.01 97.62
7 0.02 0.05 0.000 0.99985 0.00 100.00
(skipping down...)
13445 skipped 10.79 4.76
13446 24.66 21.69 -2.833 0.88973 5.74 8.33
13447 -0.20 -0.44 -0.107 0.99816 2.78 51.59
13448 0.54 -0.21 -0.139 1.00280 7.64 26.19
13449 0.29 -0.08 0.067 0.99905 6.49 47.62
13450 skipped 19.90 6.35
13451 skipped 6.24 6.35
13452 -0.01 -0.32 0.151 0.99988 4.64 60.32
13453 -1.00 -0.22 0.368 1.00243 6.15 33.33
13454 0.30 0.17 0.198 0.99832 2.39 42.06
13455 0.17 0.03 0.012 0.99916 0.00 77.78
13456 skipped 19.46 3.97
13457 skipped 14.73 0.00
13458 0.06 -0.15 -0.047 0.99904 4.10 47.62
13459 -14.22 2.88 -3.708 0.98801 9.30 11.11
13460 -0.33 0.07 -0.027 0.99789 1.50 57.14
13461 skipped 9.30 4.37
13462 19.24 18.95 -0.285 0.92961 6.35 9.13
13463 -0.09 -0.15 -0.095 0.99777 3.11 49.21
13464 0.26 -0.42 0.181 0.99812 8.11 24.60
13465 0.38 -0.35 -0.021 0.99963 6.69 42.86
13466 skipped n_scene 20.16 4.76
13467 -4.10 4.05 0.317 0.98448 46.73 15.87
13468 skipped n_scene 22.82 3.57
13469 -2.05 -0.14 -0.254 0.99055 21.31 17.46
13470 skipped 7.38 3.17
(continues...)
burfadel
26th April 2018, 03:58
I don't think that is true. My understanding is that the various YDifference functions that are built into AVISynth compute a sum of absolute differences on each pixel in the current frame with the pixels in the same position in the adjacent frame. Thus, a moving car will generate significant differences because the pixel that is depicting a shiny spot on the car in the current frame will go dark as the car moves because a dull spot on the car is now occupying the same pixel position and therefore generates a large absolute difference.
I just did a quick test to prove my point. Here's a link to a video of a car, with the camera panning to keep the car in frame, followed by a hand-held static shot. As you see, the YDifference values are much larger for the car shot.
YDifference Test File (10 MB) (http://www.mediafire.com/file/gmqoh5ovza7bl77/temp.avi)
If the car were actually traveling through the frame, the YDifference values would be much higher.
Ah okay! I think you're right 😀. For some reason I was thinking it was a whole frame difference. However, if the OP applies it based on that, the static areas of the frame will still be processed using the filter they want for movement, and potentially vice versa depending on the threshold. If the filter is only applied on moving areas and the static filter only on still areas using one of the motion mask methods the scene cohesion should be better when viewing it as video.
johnmeyer
26th April 2018, 17:27
If I were doing this I would first try Deshaker (http://www.guthspot.se/video/deshaker.htm), leveraging its years of development and tuning. After you run pass 1, you get a report of camera pan & zoom in the log file.Wow, that's a great idea!
StainlessS
26th April 2018, 17:38
Yeh nice Raff.
But, as I've already done it (and maybe of use for something else), here mod of 1st script, forget all about 2nd script not much use at all.
StaticCam.avs
# StaticCam.avs # https://forum.doom9.org/showthread.php?p=1840393#post1840393
#AvisourcE("..\G.avi")
AvisourcE(".\Temp.avi")
BLKW=48
BLKH=48
TH=0.900 # ~ 0.8 -> 1.0 (hi is match, max=1.0)
# There are 8 correlation block measurements made between Cur and Prv and Cur and Nxt Frames [4 corners & 4 mid edges for each frame].
# Blocks with correlation>=Th are counted separately for Cur to Prv frame and Cur to Nxt frame.
# If Count of Prev matching blocks >= PC_MAT or Next matching blocks >= NC_MAT or Total matches >= TOT_MAT then is STATIC.
PC_MAT =6 # matching with prev (MAX=8, or eg set 9 to ignore PC_MAT [there are only 8 blocks])
NC_MAT =6 # matching with next, count threshold.
TOT_MAT=9 # total matching, count threshold.
METRICS= 3 # 0 = OFF, 1 = Top line metrics, 2 = Mid metrics, 3+ = All
STATIC=1 # ClipClop Index to use for static frame
MOVEY =2 # ClipClop Index to use for moving frame
FN="D:\ClipClopCmd.txt" # ClipClop(Src,StaticFiltClip,MovingFiltClip,Cmd="D:\ClipClopCmd.txt")
###################
RT_FileDelete(FN)
HILITE= "!"
LOLITE= "L"
NORM="-"
EndC = Last.ConvertToY8.EndOfSceneClip()
StartC = Last.ConvertToY8.StartOfSceneClip()
SSS="""
n=current_frame
M_X = (Width - BLKW)/4*2 M_Y = (Height - BLKH)/4*2
IsEOS = EndC.RT_AverageLuma(W=1,H=1)>0.0
IsSOS = StartC.RT_AverageLuma(W=1,H=1)>0.0
PC=0 # Prev match Count
if(!IsSOS) { # Avoid false match on first frame and Start Of Scene
# Match to Prev
TL_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, W=BLKW,H=BLKH)
TM_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=M_X, W=BLKW,H=BLKH)
TR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=Width-BLKW, H=BLKH)
ML_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, y=M_Y, W=BLKW,H=BLKH)
MR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=Width-BLKW,y=M_Y, H=BLKH)
BL_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1, y=Height-BLKH,W=BLKW )
BM_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=M_X, y=Height-BLKH,W=BLKW )
BR_P=RT_LumaCorrelation(Last,Last,n=n,n2=n-1,x=width-BLKW,y=Height-BLKH)
if(TL_P>=TH){PC=PC+1} if(TM_P>=TH){PC=PC+1} if(TR_P>=TH){PC=PC+1}
if(ML_P>=TH){PC=PC+1} if(MR_P>=TH){PC=PC+1}
if(BL_P>=TH){PC=PC+1} if(BM_P>=TH){PC=PC+1} if(BR_P>=TH){PC=PC+1}
} Else { # No Matches, zero vars
TL_P=0.0 TM_P=0.0 TR_P=0.0
ML_P=0.0 MR_P=0.0
BL_P=0.0 BM_P=0.0 BR_P=0.0
}
NC=0 # Next match Count
if(!IsEOS) { # Avoid false match on last frame and End Of Scene
# Match to Next
TL_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, W=BLKW,H=BLKH)
TM_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=M_X, W=BLKW,H=BLKH)
TR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=Width-BLKW, H=BLKH)
ML_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, y=M_Y, W=BLKW,H=BLKH)
MR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=Width-BLKW,y=M_Y, H=BLKH)
BL_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1, y=Height-BLKH,W=BLKW )
BM_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=M_X, y=Height-BLKH,W=BLKW )
BR_N=RT_LumaCorrelation(Last,Last,n=n,n2=n+1,x=width-BLKW,y=Height-BLKH)
if(TL_N>=TH){NC=NC+1} if(TM_N>=TH){NC=NC+1} if(TR_N>=TH){NC=NC+1}
if(ML_N>=TH){NC=NC+1} if(MR_N>=TH){NC=NC+1}
if(BL_N>=TH){NC=NC+1} if(BM_N>=TH){NC=NC+1} if(BR_N>=TH){NC=NC+1}
} Else { # No Matches, zero vars
TL_N=0.0 TM_N=0.0 TR_N=0.0
ML_N=0.0 MR_N=0.0
BL_N=0.0 BM_N=0.0 BR_N=0.0
}
TOT=PC+NC
IsPCMAT =(PC>=PC_MAT) IsNCMAT =(NC>=NC_MAT) IsTOTMAT=(TOT>=TOT_MAT)
IsStatic = (IsPCMAT || IsNCMAT || IsTOTMAT) # Maybe mod to your own logic
if(METRICS>=1) {
EOSCOL=IsEOS ? NORM :LOLITE
SOSCOL=IsSOS ? NORM :LOLITE
PCOL=(ISPCMAT) ? HILITE:NORM
NCOL=(ISNCMAT) ? HILITE:NORM
TCOL=(IsTOTMAT) ? HILITE:NORM
SCOL=IsStatic ? HILITE:LOLITE
RT_Subtitle("%d] \a%sE\a%sS \a%sPC=%2d\a- : \a%sNC=%2d\a- : \a%sTOT=%2d\a- : \a%sSTATIC",
\ n,EOSCOL,SOSCOL,PCOL,PC,NCOL,NC,TCOL,TOT,SCOL)
if(METRICS>=2) {
TL_PC=(TL_P>=TH)?HILITE:NORM TM_PC=(TM_P>=TH)?HILITE:NORM TR_PC=(TR_P>=TH)?HILITE:NORM
ML_PC=(ML_P>=TH)?HILITE:NORM MR_PC=(MR_P>=TH)?HILITE:NORM
BL_PC=(BL_P>=TH)?HILITE:NORM BM_PC=(BM_P>=TH)?HILITE:NORM BR_PC=(BR_P>=TH)?HILITE:NORM
TL_NC=(TL_N>=TH)?HILITE:NORM TM_NC=(TM_N>=TH)?HILITE:NORM TR_NC=(TR_N>=TH)?HILITE:NORM
ML_NC=(ML_N>=TH)?HILITE:NORM MR_NC=(MR_N>=TH)?HILITE:NORM
BL_NC=(BL_N>=TH)?HILITE:NORM BM_NC=(BM_N>=TH)?HILITE:NORM BR_NC=(BR_N>=TH)?HILITE:NORM
RT_SubTitle(
\ "Prev\r" +
\ "\a%sTL=%6.3f \a%sTM=%6.3f \a%sTR=%6.3f\r" +
\ "\a%sML=%6.3f \a%sMR=%6.3f\r" +
\ "\a%sBL=%6.3f \a%sBM=%6.3f \a%sBR=%6.3f\r\r" +
\ "Next\r" +
\ "\a%sTL=%6.3f \a%sTM=%6.3f \a%sTR=%6.3f\r" +
\ "\a%sML=%6.3f \a%sMR=%6.3f\r" +
\ "\a%sBL=%6.3f \a%sBM=%6.3f \a%sBR=%6.3f",
\ TL_PC,TL_P,TM_PC,TM_P,TR_PC,TR_P,ML_PC,ML_P,MR_PC,MR_P,BL_PC,BL_P,BM_PC,BM_P,BR_PC,BR_P,
\ TL_NC,TL_N,TM_NC,TM_N,TR_NC,TR_N,ML_NC,ML_N,MR_NC,MR_N,BL_NC,BL_N,BM_NC,BM_N,BR_NC,BR_N,
\ x=(width-320)/2,y=(Height-180)/2)
if(METRICS>=3) {
RT_Subtitle("BLK=%2dx%2d : Th=%5.3f\nPC_MAT=%2d : NC_MAT=%2d : TOT_MAT=%2d",BLKW,BLKH,TH,PC_MAT,NC_MAT,TOT_MAT,align=1)
}
}
}
if(IsStatic) {
RT_WriteFile(FN,"%d %d",STATIC,n,Append=True) # Static frame at clipclop clip index STATIC, and frame n
} else {
RT_WriteFile(FN,"%d %d",MOVEY,n,Append=True) # Moving frame at clipclop clip index MOVEY, and frame n
}
return last
"""
Scriptclip(SSS)
return Last
Function EndOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at EOS Else 0
thSCD1=Default(thSCD1,400) thSCD2=Default(thSCD2,130)
sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
bv=sup.MAnalyse(isb=true, delta=1,blksize=16)
Return c.MSCDetection(bv,thSCD1=thSCD1,thSCD2=thSCD2)
}
Function StartOfSceneClip(clip c,Int "thSCD1",Int "thSCD2") { # All Luma Samples set 255 at SOS Else 0
thSCD1=Default(thSCD1,400) thSCD2=Default(thSCD2,130)
sup=c.MSuper(pel=1,sharp=0,rfilter=2,hpad=16, vpad=16)
fv=sup.MAnalyse(isb=false,delta=1,blksize=16)
Return c.MSCDetection(fv,thSCD1=thSCD1,thSCD2=thSCD2)
}
https://s20.postimg.cc/n6hyebzyl/Corners_1.jpg (https://postimages.org/)
https://s20.postimg.cc/a2ce1nncd/Corners_2.jpg (https://postimages.org/)
The ES flags (lo-lited in both shots probably) are End Of Scene and Start of Scene Flags [EDIT: Yes lo-lited, after frame number top line].
PC is the number of blocks matching (>=Th) via correlation with the previous frame.
NC is the number of blocks matching (>=Th) via correlation with the next frame.
TOT is the total number of blocks matching with either the previous or next frames.
STATIC is declared if PC>= PC_MAT or NC>=NC_MAT, or TOT>=TOT_MAT.
EDIT: The first half of clip (car) is fuly identified as moving (non static) and 2nd half fully Static.
EDIT: It is an AVS+ only script due to embedded GScript stuff.
EDIT: The Yellow text is from John's Metrics embedded in clip.
John, Aint Michelle Meyer that Austin Powers fellow ?
johnmeyer
27th April 2018, 00:04
EDIT: The Yellow text is from John's Metrics embedded in clip.
StainlessS, if you want the original video, without my text overlays, let me know.John, Aint Michelle Meyer that Austin Powers fellow ?Hah!! :) I think that is Mike Myers. :)
FWIW, you can click on the following link and see the Michelle Meyer (https://manage.kmail-lists.com/subscriptions/web-view?a=wszaaW&c=FaEkmw&r=aHigA2e&m=HpEYXm&k=8ea8095ab01e2a38fee288a20e524a78) who was sitting in that parade car ten years ago, but current day (this ad just started running on Monday).
StainlessS
27th April 2018, 01:33
if you want the original video, without my text overlays
No thanks, the text dont interfere as left 'Next/Prev' bit is static (Block Sample only overlies the 'Next/P' bit).
I think that is Mike Myers
Yep, that sounds more like it. (I assumed that it may have been the wife/daughter [I assume she of the link pic]),
I thought it was actually 'Mike Meyers', a failed attempt at humour. :(
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.