ApparentFPS

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (added category)
(add archived downloads section)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
{{FilterCat4|External_filters|Plugins|Duplicate_Frame_Detectors|TODO}}
+
{{FilterCat4|External_filters|Plugins|Plugins_x64|Duplicate_Frame_Detectors}}
 
+
 
{{Filter3
 
{{Filter3
|1=StainlessS
+
|1={{Author/StainlessS}}
|2=0.01
+
|2=1.08
|3=[http://forum.doom9.org/showthread.php?t=171339 Doom9.org]
+
|3=[https://web.archive.org/web/20200521161531if_/https://files.videohelp.com/u/223002/ApparentFPS_25_26_x86_x64_dll_v1-08_20190506.zip ApparentFPS_25_26_x86_x64_dll_v1-08_20190506.zip]
 
|4=External filters
 
|4=External filters
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
|6=[http://forum.doom9.org/showthread.php?t=171339 Doom9.org]
+
|6=[http://forum.doom9.org/showthread.php?t=171339 Doom9 Forum]
 
}}
 
}}
 
<br>
 
<br>
Line 15: Line 14:
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==
* AviSynth v2.58 or v2.6
+
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
* <!-- source video: interlaced? progressive? -->progressive
+
* [x64]: [[AviSynth+]]
* <!-- color formats -->Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]], <span style="color:red">*</span>[[YV16]], <span style="color:red">*</span>[[YV24]], <span style="color:red">*</span>[[YV411]], <span style="color:red">*</span>[[Y8]]
+
*Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
: <span style="color:red">*</span> Not available in AviSynth 2.5.8.
+
<br>
* <!-- CPU/GPU -->[[MMX]] or [[SSE2]] capable CPU
+
* [https://www.microsoft.com/en-us/download/details.aspx?id=26368 Microsoft Visual C++ 2008 Redistributable Package (x86 / x64)]
* [https://www.mediafire.com/folder/hb26mthbjz7z6/StainlessS MediaFire]
+
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>ApparentFPS-x86</tt>
* dependent plugins = ?
+
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>ApparentFPS-x64</tt>
 
<br>
 
<br>
  
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|ApparentFPS (clip clp, float ''DupeThresh'', float ''FrameRate'', int ''Samples'', float ''ChromaWeight'', string ''Prefix'', bool ''Show'', bool ''Verbose'', bool ''Debug'')}}
+
:{{Template:FuncDef|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")}}
::{{Par2|clp| | }}
+
<br>
:::Input clip.       
+
::{{Par2| |clip| }}
 +
:::Input clip.
 +
<br>        
 
::{{Par2|DupeThresh|float|0.5}}
 
::{{Par2|DupeThresh|float|0.5}}
 
:::(Greater than 0.0), suggest 0.5 -> 1.0. FrameDifference below or equal to this is a dupe.
 
:::(Greater than 0.0), suggest 0.5 -> 1.0. FrameDifference below or equal to this is a dupe.
 +
<br>
 
::{{Par2|FrameRate|float|clp.FrameRate}}
 
::{{Par2|FrameRate|float|clp.FrameRate}}
 
:::FrameRate of clp. Probably of no great use, just use default.
 
:::FrameRate of clp. Probably of no great use, just use default.
 +
<br>
 
::{{Par2|Samples|int|Round(FrameRate)}}
 
::{{Par2|Samples|int|Round(FrameRate)}}
 
:::(1 or more). Min Frames to sample for underlying framerate detection. Suggest as FrameRate.
 
:::(1 or more). Min Frames to sample for underlying framerate detection. Suggest as FrameRate.
 +
<br>
 
::{{Par2|ChromaWeight|float|1.0/3.0}}
 
::{{Par2|ChromaWeight|float|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).
 
:::(0.0 -> 1.0). YUV Only. Suggest 1.0/3.0 -> 1.0/2.0. (Use 0.0 for GreyScale YUV).
 +
<br>
 
::{{Par2|Prefix|string|""}}
 
::{{Par2|Prefix|string|""}}
 
:::Prefix for returned Local vars. "" = None returned.
 
:::Prefix for returned Local vars. "" = None returned.
 +
<br>
 
::{{Par2|Show|bool|true}}
 
::{{Par2|Show|bool|true}}
 
:::If true, show Info
 
:::If true, show Info
 +
<br>
 
::{{Par2|Verbose|bool|true}}
 
::{{Par2|Verbose|bool|true}}
 
:::If true, show additional info, Sequence as binary digits
 
:::If true, show additional info, Sequence as binary digits
 +
<br>
 
::{{Par2|Debug|bool|true}}
 
::{{Par2|Debug|bool|true}}
 
:::Not of any great use.
 
:::Not of any great use.
 +
<br>
 +
::{{Par2|mode|int|0}}
 +
:::Mode:
 +
:::*0 : Standard RT_FrameDifference mode.
 +
:::*1 : FrameMovement mode, difference is greatest difference for any BlkWxBlkH block.
 +
<br>
 +
::{{Par2||int|}}
 +
:::Matrix used in Conversion of RGB to Luma-Y.
 +
:::*2 : PC.601
 +
:::*3 : PC.709
 +
:::Default: <code>(c.Width>1100||c.Height>600)?3:2</code>
 +
<br>
 +
::{{Par2|BlkW|int|64}}
 +
::{{Par2|BlkH|int|BlkW}}
 +
:::Block Width and Height for Mode 1 (not used for Mode=0).
 +
<br>
 +
::{{Par2|oLapX|int|BlkW/2}}
 +
::{{Par2|oLapY|int|BlkH/2}}
 +
:::Horizontal and Vertical block Overlap for Mode = 1.
 
<br>
 
<br>
  
Line 50: Line 77:
  
 
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.
 
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.
  
  
Line 59: Line 93:
  
 
== Examples ==
 
== Examples ==
<!-- example code block: 1st char in each line = space -->
 
 
  ## This is some example code.
 
  ## This is some example code.
 
  Avisource("example.avi")
 
  Avisource("example.avi")
 
  ExampleFilter(blah=true)
 
  ExampleFilter(blah=true)
<!-- new code block: no leading space -->
+
<br>
  
## This is another example.
+
== Changelog ==
Avisource("example.avi")
+
<pre>
ExampleFilter(blah=false)
+
v1.00. - 29 Mar 2015.  
 +
v1.01. - 07 Apr 2015, Extended Samples to 1024.
 +
v1.02. - 28 Apr 2015, Changed default Samples=int(ceil(FrameRate)) [From int(FrameRate+0.5)].
 +
v1.03, - 17 Dec 2015. Added UniqMax.
 +
v1.05, - 17 Dec 2016. Added FrameMovement Mode 1.
 +
v1.06, - 27 Nov 2018. Added version resource, moved to VS2008 with x64.
 +
v1.07, - 05 May 2019. Add Maxndl and Maxndl_frm.
 +
v1.08, - 06 May 2019. Added P_MinAboveDupeDif_Frm and P_MaxBelowDupeDif_Frm.
 +
</pre>
 +
<br>
 +
 
 +
== Archived Downloads ==
 +
{| class="wikitable" border="1"; width="500px"
 +
|-
 +
!!width="100px"| Version
 +
!!width="200px"| Download
 +
!!width="200px"| Mirror
 +
|-
 +
!v1.08
 +
|[https://web.archive.org/web/20200521161531if_/https://files.videohelp.com/u/223002/ApparentFPS_25_26_x86_x64_dll_v1-08_20190506.zip ApparentFPS_25_26_x86_x64_dll_v1-08_20190506.zip]
 +
|[http://www.mediafire.com/file/cgqbwb6px661qi3/ApparentFPS_25%252626_x86_x64_dll_v1-08_20190506.zip/file ApparentFPS_25&26_x86_x64_dll_v1-08_20190506.zip]
 +
|}
 
<br>
 
<br>
 
<br>
 
<br>
 
-----------------------------------------------
 
-----------------------------------------------
 
'''Back to [[External_filters|External Filters]] &larr;'''
 
'''Back to [[External_filters|External Filters]] &larr;'''

Latest revision as of 18:26, 26 May 2020

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

[edit] Description

Shows underlying framerate where a clip has had many duplicates inserted, easier than counting unique frames.

[edit] Requirements


*** vcredist_x86.exe is required for ApparentFPS-x86
*** vcredist_x64.exe is required for ApparentFPS-x64


[edit] 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.


float  DupeThresh = 0.5
(Greater than 0.0), suggest 0.5 -> 1.0. FrameDifference below or equal to this is a dupe.


float  FrameRate = clp.FrameRate
FrameRate of clp. Probably of no great use, just use default.


int  Samples = Round(FrameRate)
(1 or more). Min Frames to sample for underlying framerate detection. Suggest as 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).


string  Prefix = ""
Prefix for returned Local vars. "" = None returned.


bool  Show = true
If true, show Info


bool  Verbose = true
If true, show additional info, Sequence as binary digits


bool  Debug = true
Not of any great use.


int  mode = 0
Mode:
  • 0 : Standard RT_FrameDifference mode.
  • 1 : FrameMovement mode, difference is greatest difference for any BlkWxBlkH block.


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


int  BlkW = 64
int  BlkH = BlkW
Block Width and Height for Mode 1 (not used for Mode=0).


int  oLapX = BlkW/2
int  oLapY = BlkH/2
Horizontal and Vertical block Overlap for Mode = 1.


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.


[edit] Examples

## This is some example code.
Avisource("example.avi")
ExampleFilter(blah=true)


[edit] Changelog

v1.00. - 29 Mar 2015. 
v1.01. - 07 Apr 2015, Extended Samples to 1024.
v1.02. - 28 Apr 2015, Changed default Samples=int(ceil(FrameRate)) [From int(FrameRate+0.5)].
v1.03, - 17 Dec 2015. Added UniqMax.
v1.05, - 17 Dec 2016. Added FrameMovement Mode 1.
v1.06, - 27 Nov 2018. Added version resource, moved to VS2008 with x64.
v1.07, - 05 May 2019. Add Maxndl and Maxndl_frm.
v1.08, - 06 May 2019. Added P_MinAboveDupeDif_Frm and P_MaxBelowDupeDif_Frm.


[edit] Archived Downloads

Version Download Mirror
v1.08 ApparentFPS_25_26_x86_x64_dll_v1-08_20190506.zip ApparentFPS_25&26_x86_x64_dll_v1-08_20190506.zip




Back to External Filters

Personal tools