mushahidh
11th February 2016, 09:21
Hi experts,
Out of 100 if i want to find how much regular and irregular motion a YUV video have. How should i go about it in any simulation or video processing tool?
So my question is, Is there a way to find a regular or irregular motion value of video?
Thanks in advance
raffriff42
16th February 2016, 23:32
These three AviSynth (http://avisynth.nl/index.php/Main_Page) scripts return video clips where pixel brightness corresponds (more or less) to "motion"
(specifically, apparent pixel motion, as determined in various ways)
https://www.dropbox.com/s/z8mgoqe10pz3tmc/motion01-mshow.jpg?raw=1
(MVTools: MShow displaying motion vectors)
Screen grab from: Sintel, the Durian Open Movie Project (https://media.xiph.org/sintel/)
https://www.dropbox.com/s/6hh06xberbxeeu4/motion02-mshow2.jpg?raw=1
(MVTools: MShow with original video subtracted out)
FFvideosource (http://avisynth.nl/index.php/FFmpegSource)(...)
MVect2(underlay=false)
function MVect2(clip C, bool "underlay")
{
## requires MVTools2 (http://avisynth.nl/index.php/MVTools)
underlay = Default(underlay, true)
C ## Last==C
super = MSuper
fvec = MAnalyse(super, isb=false)
MShow(super, fvec)
BicubicResize(C.Width, C.Height,
\ src_left=8, src_top=8,
\ src_width=C.Width, src_height=C.Height)
return (underlay)
\ ? Last
\ : Subtract(Last, C).Levels(128, 1, 255, 0, 255, coring=false)
}
https://www.dropbox.com/s/bl4tjqw6v1lps58/motion03-mmask2.jpg?raw=1
(MVTools: MMask "motion mask")
FFvideosource (http://avisynth.nl/index.php/FFmpegSource)(...)
MMask2
function MMask2(clip C)
{
## requires MVTools2 (http://avisynth.nl/index.php/MVTools)
C ## Last==C
super = MSuper
fvec = MAnalyse(super, isb=false)
MMask(super, fvec, ml=100, gamma=0.5,
\ kind=0, Ysc=0, thSCD1=400, thSCD2=130)
Grayscale
Crop(0, 2, C.Width, C.Height, true)
return Last.Levels(0, 1, 128, 0, 255, coring=false)
}
https://www.dropbox.com/s/l663f4hh99lry3f/motion04-mdiff2.jpg?raw=1
(MaskTools: difference between adjacent frames)
FFvideosource (http://avisynth.nl/index.php/FFmpegSource)(...)
MDiff2
function MDiff2(clip C)
{
## requires MaskTools2 (http://avisynth.nl/index.php/MaskTools2)
mt_lutxy(C, C.Trim(1, 0), mt_polish("2*abs(x-y)"), U=-128, V=-128)
return Last
}
The first two are very susceptible to random noise, and all are fooled by scene changes, edits, lighting changes etc.
You can display the average brightness ("motion") with:ScriptClip(Last, "Subtitle(Last, String(AverageLuma)")
You can also write that number frame-by-frame to a file (http://avisynth.nl/index.php/WriteFile) for further analysis.
Whether that number corresponds to what you are looking for, is another matter.
(You have not stated your problem clearly at all)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.