Commit 76bce46d authored by Clément Bœsch's avatar Clément Bœsch

avfilter: add signalstats filter

Signed-off-by: 's avatarMark Heath <silicontrip@gmail.com>
Signed-off-by: 's avatarDave Rice <dave@dericed.com>
Signed-off-by: 's avatarClément Bœsch <u@pkh.me>
parent 881ee369
...@@ -28,6 +28,7 @@ version <next>: ...@@ -28,6 +28,7 @@ version <next>:
- WebVTT encoder - WebVTT encoder
- showcqt multimedia filter - showcqt multimedia filter
- zoompan filter - zoompan filter
- signalstats filter
version 2.2: version 2.2:
......
...@@ -7532,6 +7532,172 @@ Swap the second and third planes of the input: ...@@ -7532,6 +7532,172 @@ Swap the second and third planes of the input:
ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
@end example @end example
@section signalstats
Evaluate various visual metrics that assist in determining issues associated
with the digitization of analog video media.
By default the filter will log these metadata values:
@table @option
@item YMIN
Display the minimal Y value contained within the input frame. Expressed in
range of [0-255].
@item YLOW
Display the Y value at the 10% percentile within the input frame. Expressed in
range of [0-255].
@item YAVG
Display the average Y value within the input frame. Expressed in range of
[0-255].
@item YHIGH
Display the Y value at the 90% percentile within the input frame. Expressed in
range of [0-255].
@item YMAX
Display the maximum Y value contained within the input frame. Expressed in
range of [0-255].
@item UMIN
Display the minimal U value contained within the input frame. Expressed in
range of [0-255].
@item ULOW
Display the U value at the 10% percentile within the input frame. Expressed in
range of [0-255].
@item UAVG
Display the average U value within the input frame. Expressed in range of
[0-255].
@item UHIGH
Display the U value at the 90% percentile within the input frame. Expressed in
range of [0-255].
@item UMAX
Display the maximum U value contained within the input frame. Expressed in
range of [0-255].
@item VMIN
Display the minimal V value contained within the input frame. Expressed in
range of [0-255].
@item VLOW
Display the V value at the 10% percentile within the input frame. Expressed in
range of [0-255].
@item VAVG
Display the average V value within the input frame. Expressed in range of
[0-255].
@item VHIGH
Display the V value at the 90% percentile within the input frame. Expressed in
range of [0-255].
@item VMAX
Display the maximum V value contained within the input frame. Expressed in
range of [0-255].
@item SATMIN
Display the minimal saturation value contained within the input frame.
Expressed in range of [0-~181.02].
@item SATLOW
Display the saturation value at the 10% percentile within the input frame.
Expressed in range of [0-~181.02].
@item SATAVG
Display the average saturation value within the input frame. Expressed in range
of [0-~181.02].
@item SATHIGH
Display the saturation value at the 90% percentile within the input frame.
Expressed in range of [0-~181.02].
@item SATMAX
Display the maximum saturation value contained within the input frame.
Expressed in range of [0-~181.02].
@item HUEMED
Display the median value for hue within the input frame. Expressed in range of
[0-360].
@item HUEAVG
Display the average value for hue within the input frame. Expressed in range of
[0-360].
@item YDIF
Display the average of sample value difference between all values of the Y
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0-255].
@item UDIF
Display the average of sample value difference between all values of the U
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0-255].
@item VDIF
Display the average of sample value difference between all values of the V
plane in the current frame and corresponding values of the previous input frame.
Expressed in range of [0-255].
@end table
The filter accepts the following options:
@table @option
@item stat
@item out
@option{stat} specify an additional form of image analysis.
@option{out} output video with the specified type of pixel highlighted.
Both options accept the following values:
@table @samp
@item tout
Identify @var{temporal outliers} pixels. A @var{temporal outlier} is a pixel
unlike the neighboring pixels of the same field. Examples of temporal outliers
include the results of video dropouts, head clogs, or tape tracking issues.
@item vrep
Identify @var{vertical line repetition}. Vertical line repetition includes
similar rows of pixels within a frame. In born-digital video vertical line
repetition is common, but this pattern is uncommon in video digitized from an
analog source. When it occurs in video that results from the digitization of an
analog source it can indicate concealment from a dropout compensator.
@item brng
Identify pixels that fall outside of legal broadcast range.
@end table
@item color, c
Set the highlight color for the @option{out} option. The default color is
yellow.
@end table
@subsection Examples
@itemize
@item
Output data of various video metrics:
@example
ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
@end example
@item
Output specific data about the minimum and maximum values of the Y plane per frame:
@example
ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
@end example
@item
Playback video while highlighting pixels that are outside of broadcast range in red.
@example
ffplay example.mov -vf values="out=brng:color=red"
@end example
@end itemize
@anchor{smartblur} @anchor{smartblur}
@section smartblur @section smartblur
......
...@@ -174,6 +174,7 @@ OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o ...@@ -174,6 +174,7 @@ OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o
OBJS-$(CONFIG_SETTB_FILTER) += settb.o OBJS-$(CONFIG_SETTB_FILTER) += settb.o
OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o
OBJS-$(CONFIG_SHUFFLEPLANES_FILTER) += vf_shuffleplanes.o OBJS-$(CONFIG_SHUFFLEPLANES_FILTER) += vf_shuffleplanes.o
OBJS-$(CONFIG_SIGNALSTATS_FILTER) += vf_signalstats.o
OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o
OBJS-$(CONFIG_SPLIT_FILTER) += split.o OBJS-$(CONFIG_SPLIT_FILTER) += split.o
OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o
......
...@@ -191,6 +191,7 @@ void avfilter_register_all(void) ...@@ -191,6 +191,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SETTB, settb, vf); REGISTER_FILTER(SETTB, settb, vf);
REGISTER_FILTER(SHOWINFO, showinfo, vf); REGISTER_FILTER(SHOWINFO, showinfo, vf);
REGISTER_FILTER(SHUFFLEPLANES, shuffleplanes, vf); REGISTER_FILTER(SHUFFLEPLANES, shuffleplanes, vf);
REGISTER_FILTER(SIGNALSTATS, signalstats, vf);
REGISTER_FILTER(SMARTBLUR, smartblur, vf); REGISTER_FILTER(SMARTBLUR, smartblur, vf);
REGISTER_FILTER(SPLIT, split, vf); REGISTER_FILTER(SPLIT, split, vf);
REGISTER_FILTER(SPP, spp, vf); REGISTER_FILTER(SPP, spp, vf);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 4 #define LIBAVFILTER_VERSION_MAJOR 4
#define LIBAVFILTER_VERSION_MINOR 7 #define LIBAVFILTER_VERSION_MINOR 8
#define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
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