summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-12-10 16:20:51 +0100
committerCarl Hetherington <cth@carlh.net>2023-12-12 15:03:23 +0100
commitb4a306418f70cd0f43f1b91a9bb96b1714c0fa25 (patch)
tree1fa8b4ff7c15103ebd737c4f1d5fd4ae5a7d5784 /src
parent9e142b4410f9b1c703f3f12ced07c45dc2a0db24 (diff)
Add a premultiply filter to sources with an alpha channel (#2681).
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg_content.cc3
-rw-r--r--src/lib/filter.cc1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index ceebb5572..20fe7776b 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -299,6 +299,9 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
_filters.push_back(*Filter::from_id("90anticlock"));
}
}
+ if (examiner->has_alpha()) {
+ _filters.push_back(*Filter::from_id("premultiply"));
+ }
}
if (!examiner->audio_streams().empty()) {
diff --git a/src/lib/filter.cc b/src/lib/filter.cc
index 5a94c0b43..9a14795ec 100644
--- a/src/lib/filter.cc
+++ b/src/lib/filter.cc
@@ -103,6 +103,7 @@ Filter::setup_filters ()
maybe_add (N_("hqdn3d"), _("High quality 3D denoiser"), _("Noise reduction"), N_("hqdn3d"));
maybe_add (N_("telecine"), _("Telecine filter"), _("Misc"), N_("telecine"));
maybe_add (N_("ow"), _("Overcomplete wavelet denoiser"), _("Noise reduction"), N_("mp=ow"));
+ maybe_add (N_("premultiply"), _("Premultiply alpha channel"), _("Misc"), N_("premultiply=inplace=1"));
}