ApparentFPS
Abstract | |
---|---|
Author | StainlessS |
Version | 1.08 |
Download | ApparentFPS_25&26_x86_x64_dll_v1-08_20190506.zip |
Category | External filters |
License | GPLv2 |
Discussion | Doom9 Forum |
Contents |
Description
Shows underlying framerate where a clip has had many duplicates inserted, easier than counting unique frames.
Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: RGB24, RGB32, YUY2, Y8, YV12, YV16, YV24, YV411
- *** vcredist_x86.exe is required for ExactDedup-x86
- *** vcredist_x64.exe is required for ExactDedup-x64
Syntax and Parameters
- ApparentFPS (clip clp, float "DupeThresh", float "FrameRate", int "Samples", float "ChromaWeight", string "Prefix", bool "Show", bool "Verbose", bool "Debug", int "Mode", int "Matrix", int "BlkW", int "BlkH", int "oLapX", int "oLapY")
- clip =
- Input clip.
- clip =
- float DupeThresh = 0.5
- (Greater than 0.0), suggest 0.5 -> 1.0. FrameDifference below or equal to this is a dupe.
- float DupeThresh = 0.5
- float FrameRate = clp.FrameRate
- FrameRate of clp. Probably of no great use, just use default.
- float FrameRate = clp.FrameRate
- int Samples = Round(FrameRate)
- (1 or more). Min Frames to sample for underlying framerate detection. Suggest as FrameRate.
- int Samples = Round(FrameRate)
- float ChromaWeight = 1.0/3.0
- (0.0 -> 1.0). YUV Only. Suggest 1.0/3.0 -> 1.0/2.0. (Use 0.0 for GreyScale YUV).
- float ChromaWeight = 1.0/3.0
- string Prefix = ""
- Prefix for returned Local vars. "" = None returned.
- string Prefix = ""
- bool Show = true
- If true, show Info
- bool Show = true
- bool Verbose = true
- If true, show additional info, Sequence as binary digits
- bool Verbose = true
- bool Debug = true
- Not of any great use.
- bool Debug = true
- int mode = 0
- Mode:
- 0 : Standard RT_FrameDifference mode.
- 1 : FrameMovement mode, difference is greatest difference for any BlkWxBlkH block.
- Mode:
- int mode = 0
- int =
- Matrix used in Conversion of RGB to Luma-Y.
- 2 : PC.601
- 3 : PC.709
- Default:
(c.Width>1100||c.Height>600)?3:2
- Matrix used in Conversion of RGB to Luma-Y.
- int =
- int BlkW = 64
- int BlkH = BlkW
- Block Width and Height for Mode 1 (not used for Mode=0).
- int BlkW = 64
- int oLapX = BlkW/2
- int oLapY = BlkH/2
- Horizontal and Vertical block Overlap for Mode = 1.
- int oLapX = BlkW/2
Function samples over Samples frames, and shows instantaneous ApparentFPS and MaxApparentFPS, the real and perhaps most useful result is MaxApparentFPS.
If Prefix = "" (Default) then does not return any info Local vars. When set to eg "P_" will set Local P_ApparentFPS and P_MaxApparentFPS as Float. Also returns Locals P_MinAboveDupeDif, P_MaxBelowDupeDif and P_CurrentDif which may assist in choosing DupeThresh, they are min and max values so far, and difference between current and previous frame. P_MinAboveDupeDif is the difference to previous frame of the frame which has lowest difference that what considered NOT a dupe (above DupeThresh), MaxBelowDupeDif max difference of frame that WAS considered a dupe (below DupeThresh). Ideally in a clip containing duplicates, there would be a distinct gap between these two above/below dup dif values with DupeThresh somewhere in between.
- v1.07, Also sets P_Maxndl and P_Maxndl_Frm, Max Non dupe length (up to samples length) and frame number where first occurs.
- v1.08, Also sets P_MinAboveDupeDif_Frm and P_MaxBelowDupeDif_Frm.
!!! NOTE !!!, It may be better to set DupeThresh a little too high rather than too low, (where some motion frames will be mistaken as dupes), as it is likely that there will be at least one sequence in clip where there is sufficient motion to accurately set MaxApparentFPS.
Can switch Off metrics (Show=False), and set eg Prefix = "P_" to return Locals P_ApparentFPS and P_MaxApparentFPS with rough instantaneous estimate of current underlying framerate and maximum underlying framerate detected so far. NOTE, ApparentFPS can range from 0.0 in static scene (can be measure of how 'active' a scene is). 'Verbose' (Default True) shows additional info, a string of 1's and 0's showing duplicate and unique frames. Also shown in info is the Unique frame count for the current Sample spread (which will be reduced at either end of clip), current ApparentFPS is calculated as (FrameRate * UniqueFrameCount / CurrentSampleSpread), so where UniqueFrameCount == CurrentSampleSpread, the result is FrameRate, However, if CurrentSampleSpread is reduced due to being near clip ends, then current ApparentFPS will NOT be assigned to P_MaxApparentFPS even where greater than current P_MaxApparentFPS.
The rest should be pretty straight forward.
Examples
## This is some example code. Avisource("example.avi") ExampleFilter(blah=true)
Back to External Filters ←