LinesLumaDiff

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(LinesLumaDiff v1.0.0)
 
m (Update the version)
 
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
|1={{Author/Asd-g}}
 
|1={{Author/Asd-g}}
|2=v1.0.0
+
|2=v2.1.0
|3=[https://github.com/Asd-g/AviSynth-LinesLumaDiff/releases/ LinesLumaDiff-1.0.0.7z]
+
|3=[https://github.com/Asd-g/AviSynth-LinesLumaDiff/releases/ LinesLumaDiff]
 
|4=Debug filter
 
|4=Debug filter
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
Line 13: Line 13:
 
<br>
 
<br>
 
== Requirements ==
 
== Requirements ==
* [x86] [[AviSynth+]]
+
* [x86/x64]: '''[[AviSynth+|AviSynth 3.6]] or greater is required in order to use this filter.'''
* [x64] [[AviSynth+]]
+
 
* Supported color formats: all [[planar]] YUV formats
 
* Supported color formats: all [[planar]] YUV formats
 
<br>
 
<br>
  
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|LinesLumaDiff (clip, int "left", int "top", int "right", int "bottom", float "tl", float "tt", float "tr", float "tb", string frames_file)}}
+
:{{Template:FuncDef|LinesLumaDiff (clip, string "output", int "left", int "top", int "right", int "bottom", float "tl", float "tt", float "tr", float "tb", bool "flush")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
 
::: A clip to process. It must in YUV planar format.
 
::: A clip to process. It must in YUV planar format.
 +
<br>
 +
::{{Par2|output|string|}}
 +
:::The path of the txt file with frames.
 
<br>
 
<br>
 
::{{Par2|left|int|5}}
 
::{{Par2|left|int|5}}
Line 31: Line 33:
 
:::Set one (or more) of the sides to 0 to not process it.
 
:::Set one (or more) of the sides to 0 to not process it.
 
:::Must not be negative.
 
:::Must not be negative.
:::Default: left = top = right = bottom = 5.
 
 
<br>
 
<br>
::{{Par2|tl|float|2.5}}
+
::{{Par2|tl|float|0.14}}
::{{Par2|tt|float|2.5}}
+
::{{Par2|tt|float|0.14}}
::{{Par2|tr|float|2.5}}
+
::{{Par2|tr|float|0.14}}
::{{Par2|tb|float|2.5}}
+
::{{Par2|tb|float|0.14}}
 
:::Threshold for each side.
 
:::Threshold for each side.
:::If the luma difference between the current and the neighbour line is above the threshold, the frame number will be written to file.
+
:::If the luma difference between the current and the neighbour line is above the threshold, frame property "LinesDiffLeft", "LinesDiffTop", "LinesDiffRight" or "LinesDiffBottom" with the difference is set. Optionally the frame number could be written in file by specifying "output".
:::Must not be negative.
+
:::Must be between 0.0 and 1.0.
:::Default: tl = tt = tr = tb = 2.5.
+
 
<br>
 
<br>
::{{Par2|frames_file|string|}}
+
::{{Par2|flush|bool|false}}
:::Set the path of the file with frame numbers.
+
:::True: The frame number is saved right after the difference is above the threshold.
 +
:::False: All frames with difference above the threshold are saved at once after the end of video.
 
<br>
 
<br>
 +
 
==Examples==
 
==Examples==
[[TODO]]
+
Check the difference between the first and second row:
 +
[[AviSource]]("Blah.avi")
 +
LinesLumaDiff(left=0, top=1, right=0, bottom=0)
 +
propShow() # if the difference is above the threshold there will be frame property "LinesDiffLeft"/"LinesDiffTop"/"LinesDiffRight"/"LinesDiffBottom"
 
<br>
 
<br>
 
<br>
 
<br>
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
  v1.0.0      2021/03/30      - Initial release  
+
v2.1.0      2022/03/09      - Added parameter flush.
 +
                              - Changed the name of the frame property showing the difference.<br>
 +
v2.0.0      2021/08/22      - Set frame property `_LinesDiff`.
 +
                              - Changed parameter name `frames_file` to `output`.<br>
 +
  v1.0.0      2021/03/30      - Initial release
  
 
<br>
 
<br>

Latest revision as of 02:56, 10 March 2022

Abstract
Author Asd-g
Version v2.1.0
Download LinesLumaDiff
Category Debug filter
License GPLv2
Discussion

Contents

[edit] Description

Checks if luma difference between lines are below or above given threshold and writes frame number in text file.

[edit] Requirements

  • [x86/x64]: AviSynth 3.6 or greater is required in order to use this filter.
  • Supported color formats: all planar YUV formats


[edit] Syntax and Parameters

LinesLumaDiff (clip, string "output", int "left", int "top", int "right", int "bottom", float "tl", float "tt", float "tr", float "tb", bool "flush")


clip   =
A clip to process. It must in YUV planar format.


string  output =
The path of the txt file with frames.


int  left = 5
int  top = 5
int  right = 5
int  bottom = 5
How many lines on each side will be checked.
Set one (or more) of the sides to 0 to not process it.
Must not be negative.


float  tl = 0.14
float  tt = 0.14
float  tr = 0.14
float  tb = 0.14
Threshold for each side.
If the luma difference between the current and the neighbour line is above the threshold, frame property "LinesDiffLeft", "LinesDiffTop", "LinesDiffRight" or "LinesDiffBottom" with the difference is set. Optionally the frame number could be written in file by specifying "output".
Must be between 0.0 and 1.0.


bool  flush = false
True: The frame number is saved right after the difference is above the threshold.
False: All frames with difference above the threshold are saved at once after the end of video.


[edit] Examples

Check the difference between the first and second row:

AviSource("Blah.avi")
LinesLumaDiff(left=0, top=1, right=0, bottom=0)
propShow() # if the difference is above the threshold there will be frame property "LinesDiffLeft"/"LinesDiffTop"/"LinesDiffRight"/"LinesDiffBottom"



[edit] Changelog

Version      Date            Changes
v2.1.0 2022/03/09 - Added parameter flush. - Changed the name of the frame property showing the difference.
v2.0.0 2021/08/22 - Set frame property `_LinesDiff`. - Changed parameter name `frames_file` to `output`.
v1.0.0 2021/03/30 - Initial release



[edit] External Links

  • GitHub - Source code repository.




Back to External Filters

Personal tools