MVTools2/MSCDetection

From Avisynth wiki
Jump to: navigation, search

MSCDetection creates scene detection mask clip from motion vectors data. The mask is created both on the luma and on chroma planes. Output without scene change is 0.

Syntax and Parameters

MSCDetection (clip, clip, int "Ysc", int "thSCD1", int "thSCD2", bool "isse")


clip   =
Input clip.


clip   =
Vector clip from MAnalyse.


int  Ysc = 255
The value taken by the mask on a scene change.


int  thSCD1 = 400
Threshold which decides whether a block has changed between the previous frame and the current one. When a block has changed, it means that motion estimation for it isn't relevant. It occurs for example at scene changes. So it is one of the thresholds used to tweak the scene changes detection engine. Raising it will lower the number of blocks detected as changed. It may be useful for noisy or flickered video. The threshold is compared to the SAD (Sum of Absolute Differences, a value which says how bad the motion estimation was) value. For exactly identical blocks we have SAD=0. But real blocks are always different because of objects complex movement (zoom, rotation, deformation), discrete pixels sampling, and noise. Suppose we have two compared 8x8 blocks with every pixel different by 5. It this case SAD will be 8x8x5 = 320 (block will not detected as changed for thSCD1=400). If you use 4x4 blocks, SAD will be 320/4. If you use 16x16 blocks, SAD will be 320*4. Really this parameter is scaled internally in MVTools, and you must always use reduced to block size 8x8 value. Default is 400.


int  thSCD2 = 130
Threshold which sets how many blocks have to change for the frame to be considered as a scene change. It is ranged from 0 to 255, 0 meaning 0%, 255 meaning 100%. Default is 130 (which means 51%).


bool  isse = true
Flag which allows to enable (if set to True) or disable (if set to False) ISSE, MMX and other CPU optimizations (for debugging). Default is True. If your processor doesn't support CPU optimizations, it will be disabled anyway (and you won't be able to activate them).


Examples

MSCDetection with default values.

AviSource("blah.avi")




Back to MVTools2

Personal tools