Commit 615479d5 authored by Ashish Singh's avatar Ashish Singh Committed by Ronald S. Bultje

avfilter: add LIBVMAF filter

This one changes the previous vmaf patch to libvmaf to keep it separate from the
native implementation of vmaf inside ffmpeg later.
Signed-off-by: 's avatarAshish Singh <ashk43712@gmail.com>
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 4de4308d
......@@ -27,6 +27,7 @@ version <next>:
- additional frame format support for Interplay MVE movies
- support for decoding through D3D11VA in ffmpeg
- limiter video filter
- libvmaf video filter
version 3.3:
- CrystalHD decoder moved to new decode API
......
......@@ -256,6 +256,7 @@ External library support:
--enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libv4l2 enable libv4l2/v4l-utils [no]
--enable-libvidstab enable video stabilization using vid.stab [no]
--enable-libvmaf enable vmaf filter via libvmaf [no]
--enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
--enable-libvorbis enable Vorbis en/decoding via libvorbis,
native implementation exists [no]
......@@ -1569,6 +1570,7 @@ EXTERNAL_LIBRARY_LIST="
libtheora
libtwolame
libv4l2
libvmaf
libvorbis
libvpx
libwavpack
......@@ -3186,6 +3188,7 @@ uspp_filter_deps="gpl avcodec"
vaguedenoiser_filter_deps="gpl"
vidstabdetect_filter_deps="libvidstab"
vidstabtransform_filter_deps="libvidstab"
vmaf_filter_deps="libvmaf"
zmq_filter_deps="libzmq"
zoompan_filter_deps="swscale"
zscale_filter_deps="libzimg"
......@@ -5902,6 +5905,8 @@ enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
enabled libvmaf && { check_lib libvmaf "libvmaf.h" "compute_vmaf" -lvmaf -lstdc++ -lpthread -lm ||
die "ERROR: libvmaf must be installed"; }
enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
enabled libvorbis && require_pkg_config vorbis vorbis/codec.h vorbis_info_init &&
require_pkg_config vorbisenc vorbis/vorbisenc.h vorbis_encode_init
......
......@@ -9639,6 +9639,70 @@ The formula that generates the correction is:
where @var{r_0} is halve of the image diagonal and @var{r_src} and @var{r_tgt} are the
distances from the focal point in the source and target images, respectively.
@section libvmaf
Obtain the average VMAF (Video Multi-Method Assessment Fusion)
score between two input videos.
This filter takes two input videos.
Both video inputs must have the same resolution and pixel format for
this filter to work correctly. Also it assumes that both inputs
have the same number of frames, which are compared one by one.
The obtained average VMAF score is printed through the logging system.
It requires Netflix's vmaf library (libvmaf) as a pre-requisite.
After installing the library it can be enabled using:
@code{./configure --enable-libvmaf}.
If no model path is specified it uses the default model: @code{vmaf_v0.6.1.pkl}.
On the below examples the input file @file{main.mpg} being processed is
compared with the reference file @file{ref.mpg}.
The filter has following options:
@table @option
@item model_path
Set the model path which is to be used for SVM.
Default value: @code{"vmaf_v0.6.1.pkl"}
@item log_path
Set the file path to be used to store logs.
@item log_fmt
Set the format of the log file (xml or json).
@item enable_transform
Enables transform for computing vmaf.
@item phone_model
Invokes the phone model which will generate VMAF scores higher than in the
regular model, which is more suitable for laptop, TV, etc. viewing conditions.
@item psnr
Enables computing psnr along with vmaf.
@item ssim
Enables computing ssim along with vmaf.
@item ms_ssim
Enables computing ms_ssim along with vmaf.
@item pool
Set the pool method to be used for computing vmaf.
@end table
For example:
@example
ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
@end example
Example with options:
@example
ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf="psnr=1:enable-transform=1" -f null -
@end example
@section limiter
Limits the pixel components values to the specified range [min, max].
......
......@@ -216,6 +216,7 @@ OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o
OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o
OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
OBJS-$(CONFIG_LIBVMAF_FILTER) += vf_libvmaf.o dualinput.o framesync.o
OBJS-$(CONFIG_LIMITER_FILTER) += vf_limiter.o
OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o
OBJS-$(CONFIG_LUMAKEY_FILTER) += vf_lumakey.o
......
......@@ -228,6 +228,7 @@ static void register_all(void)
REGISTER_FILTER(INTERLEAVE, interleave, vf);
REGISTER_FILTER(KERNDEINT, kerndeint, vf);
REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf);
REGISTER_FILTER(LIBVMAF, libvmaf, vf);
REGISTER_FILTER(LIMITER, limiter, vf);
REGISTER_FILTER(LOOP, loop, vf);
REGISTER_FILTER(LUMAKEY, lumakey, vf);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment