VMAF

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(VMAF v1.0.0)
 
(VMAF 2.1.2)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{Filter3
 
{{Filter3
 
| 1={{Author/Asd-g}}
 
| 1={{Author/Asd-g}}
| 2=v1.0.0
+
| 2=v2.1.2
| 3=[https://github.com/Asd-g/AviSynth-VMAF/releases/ VMAF-1.0.0.7z]
+
| 3=[https://github.com/Asd-g/AviSynth-VMAF/releases/ VMAF]
 
| 4=Debug filter
 
| 4=Debug filter
 
| 5=[https://github.com/Asd-g/AviSynth-VMAF/blob/main/LICENSE MIT]
 
| 5=[https://github.com/Asd-g/AviSynth-VMAF/blob/main/LICENSE MIT]
Line 9: Line 9:
  
 
== Description ==
 
== Description ==
[[VMAF]] is a perceptual video quality assessment algorithm developed by Netflix. Refer to the [https://github.com/Netflix/vmaf/blob/master/FAQ.md FAQ] page for frequently asked questions of VMAF.
+
[[VMAF]] is a perceptual video quality assessment algorithm developed by Netflix. Refer to the [https://github.com/Netflix/vmaf/blob/master/resource/doc/faq.md FAQ] page for frequently asked questions of VMAF.
  
 
This is [https://github.com/HomeOfVapourSynthEvolution/VapourSynth-VMAF a port of the VapourSynth plugin VMAF.]
 
This is [https://github.com/HomeOfVapourSynthEvolution/VapourSynth-VMAF a port of the VapourSynth plugin VMAF.]
  
[https://github.com/Netflix/vmaf/tree/v1.3.15 vmaf] is used.
+
[https://github.com/Netflix/vmaf vmaf] is used.
 
<br>
 
<br>
 
<br>
 
<br>
 +
 
== Requirements ==
 
== Requirements ==
 
* [x86] [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
 
* [x86] [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6]
 
* [x64] [[AviSynth+]]
 
* [x64] [[AviSynth+]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
 
* Supported color formats: [[Y8]], [[YV12]], [[YV16]], [[YV24]], [[YV411]]
**AviSynth+: all [[planar]] Y and YUV formats (8/10/12/14/16bit) are supported.
+
**AviSynth+: all [[planar]] Y and YUV formats (8/10bit) are supported.
<br>
+
'''NOTE:'''The folder <code>model</code> must be located in the same folder as <code>VMAF.dll</code>.
+
 
<br>
 
<br>
 
<br>
 
<br>
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
:{{Template:FuncDef|VMAF (clip reference, clip distorted, int "model", string "log_path", int "log_fmt", bool "ssim", bool "ms_ssim", int "pool", bool "ci")}}
+
:{{Template:FuncDef|VMAF (clip reference, clip distorted, string log_path, int "log_format", int[] "model", int[] "feature", string "cambi_opt")}}
 +
:{{Template:FuncDef|VMAF2 (clip reference, clip "distorted", int[] "feature", string "cambi_opt")}}
 
<br>
 
<br>
::{{Par2| |clip| }}
+
::{{Par2| |reference| }}
::{{Par2| |clip| }}
+
::{{Par2| |distorted| }}
 
::: Clips to calculate VMAF score. Must be in YUV 8..16-bit planar format.
 
::: Clips to calculate VMAF score. Must be in YUV 8..16-bit planar format.
::: First input clip is the reference, second input clip is the distorted clip (e.g. processed, encoded, etc).
+
::: <code>distorted</code> must be specified when feature != 5. (VMAF2 only)
<br>
+
::: Must be in YUV 8/10-bit planar format with minimum three planes.
::{{Par2|model|int|0}}
+
:::Sets which model to use. Refer to the [https://github.com/Netflix/vmaf/blob/v1.3.15/resource/doc/models.md models] page for more details.
+
:::*0: vmaf_v0.6.1.pkl
+
:::*1: vmaf_4k_v0.6.1.pkl
+
:::Default: 0.
+
 
<br>
 
<br>
 
::{{Par2|log_path|string|}}
 
::{{Par2|log_path|string|}}
 
:::Sets the path of the log file.
 
:::Sets the path of the log file.
:::Default: None.
+
:::This parameter is for VMAF() only.
 
<br>
 
<br>
::{{Par2|log_fmt|int|0}}
+
::{{Par2|log_format|int|0}}
 
:::Sets the format of the log file.
 
:::Sets the format of the log file.
:::*0: xml.
+
:::*0 : xml.
:::*1: json.
+
:::*1 : json.
:::*2: csv.
+
:::*2 : csv.
:::Default: 0.
+
:::This parameter is for VMAF() only.
 
<br>
 
<br>
::{{Par2|ssim|bool|false}}
+
::{{Par2|model|int[]|}}
:::Whether to also calculate SSIM score.
+
:::Sets which model to use. Refer to [https://github.com/Netflix/vmaf/blob/master/resource/doc/models.md this], [https://netflixtechblog.com/toward-a-better-quality-metric-for-the-video-community-7ed94e752a30 this] and [https://github.com/Netflix/vmaf/blob/master/resource/doc/conf_interval.md this] page for more details.
:::Default: False.
+
:::*0 : vmaf_v0.6.1
 +
:::*1 : vmaf_v0.6.1neg (NEG mode)
 +
:::*2 : vmaf_b_v0.6.3 (Confidence Interval)
 +
:::*3 : vmaf_4k_v0.6.1
 +
:::This parameter is for VMAF() only.
 
<br>
 
<br>
::{{Par2|ms_ssim|bool|false}}
+
::{{Par2|feature|int[]|}}
:::Whether to also calculate MS-SSIM score.
+
:::*0 : PSNR
:::Default: False.
+
:::*1 : PSNR-HVS
 +
:::*2 : SSIM
 +
:::*3 : MS-SSIM
 +
:::*4 : CIEDE2000
 +
:::*5 : CAMBI
 
<br>
 
<br>
::{{Par2|pool|int|1}}
+
::{{Par2|cambi_opt|string|}}
:::Sets the method to pool the per-frame scores.
+
:::* enc_width, enc_height
:::*0: Mean.
+
:::: Encoding/processing resolution to compute the banding score, useful in cases where scaling was applied to the input prior to the computation of metrics.
:::*1: Harmonic mean.
+
:::: enc_width must be between 320 and 7680.
:::*2: Min.
+
:::: enc_height must be between 200 and 4320.
:::Default: 1.
+
:::: Default: Same as input image.
 +
:::* window_size
 +
:::: Window size to compute CAMBI.
 +
:::: Must be between 15 and 127.
 +
:::: Default: 63 (corresponds to ~1 degree at 4K resolution and 1.5H).
 +
:::* topk
 +
:::: Ratio of pixels for the spatial pooling computation.
 +
:::: Must be between 0.0001 and 1.0.
 +
:::: Default: 0.6.
 +
:::* tvi_threshold
 +
:::: Visibilty threshold for luminance ΔL < tvi_threshold*L_mean for BT.1886.
 +
:::: Must be between 0.0001 and 1.0.
 +
:::: Default: 0.019.
 +
::: Format: <code>option_name=value</code>.
 +
::: If more than one option is specified, the options must be separated by space.
 +
::: Usage example: <code>cambi_opt="windows_size=120 enc_width=1280 enc_height=720"</code>.
 
<br>
 
<br>
::{{Par2|ci|bool|false}}
+
: '''VMAF2()''' exports frame property with the name of the used feature.
:::Whether to enable confidence interval.
+
:::True: It uses vmaf_b_v0.6.3 for model=0 and vmaf_4k_rb_v0.6.2 for model=1.
+
:::Refer to the [https://github.com/Netflix/vmaf/blob/v1.3.15/resource/doc/conf_interval.md VMAF confidence interval page] for more details.
+
:::Default: False.
+
 
<br>
 
<br>
  
 
==Examples==
 
==Examples==
Comparing a high quality clip vs an encoded clip:  
+
Comparing a high quality clip vs an encoded clip:
  VMAF(HQ_original, HQ_encoded, model=0, ssim=false, ms_ssim=false, pool=1, ci=false)
+
  VMAF(HQ_original, HQ_encoded, model=0)
 
+
<br>
 +
Comparing a high quality clip vs an encoded clip with MS-SSIM metrics only:
 +
VMAF(HQ_original, HQ_encoded, feature=3)
 +
<br>
 +
Frame property <code>cambi</code> is set:
 +
VMAF2(clip, feature=5)
 
<br>
 
<br>
  
 
== Changelog ==
 
== Changelog ==
 
  Version      Date            Changes<br>
 
  Version      Date            Changes<br>
 +
v2.1.2      2022/10/06      - Fixed undefined behavior when upstream throw runtime error.<br>
 +
v2.1.1      2022/04/18      - Added `cambi_opt` options - `max_log_contrast`, `enc_bitdepth`, `eotf`
 +
                              - Added function `VMAF2`
 +
                              - Clips must have either 8-bit or 10-bit bit depth<br>
 +
v2.1.0      2021/11/14      - Added parameter cambi_opt
 +
                              - Removed model default value<br>
 +
v2.0.2      2021/10/20      - Fixed feature parameter
 +
                              - Updated vmaf lib to 2.3.0
 +
                              - Added feature CAMBI<br>
 +
v2.0.1      2021/10/02      - Fixed crashing when unsupported color formats are used
 +
                              - Updated libvmaf to 2.2.1<br>
 +
v2.0.0      2021/07/10      - Updated to libvmaf 2.x<br>
 
  v1.0.0      2020/11/14      - Initial release
 
  v1.0.0      2020/11/14      - Initial release
                               - AviSynth+: self-registers as [[MT_SERIALIZED]]  
+
                               - AviSynth+: self-registers as [[MT_SERIALIZED]]
 
<br>
 
<br>
  

Latest revision as of 08:35, 18 May 2023

Abstract
Author Asd-g
Version v2.1.2
Download VMAF
Category Debug filter
License MIT
Discussion

Contents

[edit] Description

VMAF is a perceptual video quality assessment algorithm developed by Netflix. Refer to the FAQ page for frequently asked questions of VMAF.

This is a port of the VapourSynth plugin VMAF.

vmaf is used.

[edit] Requirements



[edit] Syntax and Parameters

VMAF (clip reference, clip distorted, string log_path, int "log_format", int[] "model", int[] "feature", string "cambi_opt")
VMAF2 (clip reference, clip "distorted", int[] "feature", string "cambi_opt")


reference   =
distorted   =
Clips to calculate VMAF score. Must be in YUV 8..16-bit planar format.
distorted must be specified when feature != 5. (VMAF2 only)
Must be in YUV 8/10-bit planar format with minimum three planes.


string  log_path =
Sets the path of the log file.
This parameter is for VMAF() only.


int  log_format = 0
Sets the format of the log file.
  • 0 : xml.
  • 1 : json.
  • 2 : csv.
This parameter is for VMAF() only.


int[]  model =
Sets which model to use. Refer to this, this and this page for more details.
  • 0 : vmaf_v0.6.1
  • 1 : vmaf_v0.6.1neg (NEG mode)
  • 2 : vmaf_b_v0.6.3 (Confidence Interval)
  • 3 : vmaf_4k_v0.6.1
This parameter is for VMAF() only.


int[]  feature =
  • 0 : PSNR
  • 1 : PSNR-HVS
  • 2 : SSIM
  • 3 : MS-SSIM
  • 4 : CIEDE2000
  • 5 : CAMBI


string  cambi_opt =
  • enc_width, enc_height
Encoding/processing resolution to compute the banding score, useful in cases where scaling was applied to the input prior to the computation of metrics.
enc_width must be between 320 and 7680.
enc_height must be between 200 and 4320.
Default: Same as input image.
  • window_size
Window size to compute CAMBI.
Must be between 15 and 127.
Default: 63 (corresponds to ~1 degree at 4K resolution and 1.5H).
  • topk
Ratio of pixels for the spatial pooling computation.
Must be between 0.0001 and 1.0.
Default: 0.6.
  • tvi_threshold
Visibilty threshold for luminance ΔL < tvi_threshold*L_mean for BT.1886.
Must be between 0.0001 and 1.0.
Default: 0.019.
Format: option_name=value.
If more than one option is specified, the options must be separated by space.
Usage example: cambi_opt="windows_size=120 enc_width=1280 enc_height=720".


VMAF2() exports frame property with the name of the used feature.


[edit] Examples

Comparing a high quality clip vs an encoded clip:

VMAF(HQ_original, HQ_encoded, model=0)


Comparing a high quality clip vs an encoded clip with MS-SSIM metrics only:

VMAF(HQ_original, HQ_encoded, feature=3)


Frame property cambi is set:

VMAF2(clip, feature=5)


[edit] Changelog

Version      Date            Changes
v2.1.2 2022/10/06 - Fixed undefined behavior when upstream throw runtime error.
v2.1.1 2022/04/18 - Added `cambi_opt` options - `max_log_contrast`, `enc_bitdepth`, `eotf` - Added function `VMAF2` - Clips must have either 8-bit or 10-bit bit depth
v2.1.0 2021/11/14 - Added parameter cambi_opt - Removed model default value
v2.0.2 2021/10/20 - Fixed feature parameter - Updated vmaf lib to 2.3.0 - Added feature CAMBI
v2.0.1 2021/10/02 - Fixed crashing when unsupported color formats are used - Updated libvmaf to 2.2.1
v2.0.0 2021/07/10 - Updated to libvmaf 2.x
v1.0.0 2020/11/14 - Initial release - AviSynth+: self-registers as MT_SERIALIZED


[edit] External Links

  • GitHub - Source code repository.




Back to External Filters

Personal tools