From aba926e7d654b6dfab680130c92e571ee9a956f0 Mon Sep 17 00:00:00 2001 From: Bjorn Roche Date: Mon, 23 Oct 2017 19:12:57 -0400 Subject: lavfi/paletteuse: fix to support transparency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch enables paletteuse to identify the transparency in incoming video and tag transparent pixels on outgoing video with the correct index from the palette. This requires tracking the transparency index in the palette, establishing an alpha threshold below which a pixel is considered transparent and above which the pixel is considered opaque, and additional changes to track the alpha value throughout the conversion process. This change is a partial fix for https://trac.ffmpeg.org/ticket/4443 However, animated GIFs are still output incorrectly due to a bug in gif optimization which does not correctly handle transparency. Signed-off-by: Clément Bœsch --- doc/filters.texi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/filters.texi b/doc/filters.texi index ce7e053194..64e84d9b45 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11545,6 +11545,13 @@ Default is @var{none}. @item new Take new palette for each output frame. + +@item alpha_threshold +Sets the alpha threshold for transparency. Alpha values above this threshold +will be treated as completely opaque, and values below this threshold will be +treated as completely transparent. + +The option must be an integer value in the range [0,255]. Default is @var{128}. @end table @subsection Examples -- cgit v1.2.3