Commit 9b964690 authored by Clément Bœsch's avatar Clément Bœsch

avfilter: add palettegen filter

parent 3cab173e
......@@ -6909,6 +6909,51 @@ pad="2*iw:2*ih:ow-iw:oh-ih"
@end example
@end itemize
@section palettegen
Generate one palette for a whole video stream.
It accepts the following options:
@table @option
@item max_colors
Set the maximum number of colors to quantize in the palette.
Note: the palette will still contain 256 colors; the unused palette entries
will be black.
@item reserve_transparent
Create a palette of 255 colors maximum and reserve the last one for
transparency. Reserving the transparency color is useful for GIF optimization.
If not set, the maximum of colors in the palette will be 256. You probably want
to disable this option for a standalone image.
Set by default.
@item stats_mode
Set statistics mode.
It accepts the following values:
@table @samp
@item full
Compute full frame histograms.
@item diff
Compute histograms only for the part that differs from previous frame. This
might be relevant to give more importance to the moving part of your input if
the background is static.
@end table
Default value is @var{full}.
@end table
@subsection Examples
@itemize
@item
Generate a representative palette of a given video using @command{ffmpeg}:
@example
ffmpeg -i input.mkv -vf palettegen palette.png
@end example
@end itemize
@section perspective
Correct perspective of video not recorded perpendicular to the screen.
......
......@@ -160,6 +160,7 @@ OBJS-$(CONFIG_OPENCL) += deshake_opencl.o unsharp_opencl.
OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o dualinput.o framesync.o
OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o
OBJS-$(CONFIG_PAD_FILTER) += vf_pad.o
OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o
OBJS-$(CONFIG_PERMS_FILTER) += f_perms.o
OBJS-$(CONFIG_PERSPECTIVE_FILTER) += vf_perspective.o
OBJS-$(CONFIG_PHASE_FILTER) += vf_phase.o
......
......@@ -175,6 +175,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(OVERLAY, overlay, vf);
REGISTER_FILTER(OWDENOISE, owdenoise, vf);
REGISTER_FILTER(PAD, pad, vf);
REGISTER_FILTER(PALETTEGEN, palettegen, vf);
REGISTER_FILTER(PERMS, perms, vf);
REGISTER_FILTER(PERSPECTIVE, perspective, vf);
REGISTER_FILTER(PHASE, phase, 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