summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-07-15 03:20:40 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit9cfeafa89e2e8cbd67ba60371804e817c72e701a (patch)
tree7d4b1d0edf7f21ec244146d80254f435c4ed693a /filters
parentda612acacdf41a9a72b095fa582a6b37996b0811 (diff)
downloadmpv-9cfeafa89e2e8cbd67ba60371804e817c72e701a.tar.bz2
mpv-9cfeafa89e2e8cbd67ba60371804e817c72e701a.tar.xz
video: add vf_fingerprint and a skip-logo script
skip-logo.lua is just what I wanted to have. Explanations are on the top of that file. As usual, all documentation threatens to remove this stuff all the time, since this stuff is just for me, and unlike a normal user I can afford the luxuary of hacking the shit directly into the player. vf_fingerprint is needed to support this script. It needs to scale down video frames as part of its operation. For that, it uses zimg. zimg is much faster than libswscale and generates more correct output. (The filter includes a runtime fallback, but it doesn't even work because libswscale fucks up and can't do YUV->Gray with range adjustment.) Note on the algorithm: seems almost too simple, but was suggested to me. It seems to be pretty effective, although long time experience with false positives is missing. At first I wanted to use dHash [1][2], which is also pretty simple and effective, but might actually be worse than the implemented mechanism. dHash has the advantage that the fingerprint is smaller. But exact matching is too unreliable, and you'd still need to determine the number of different bits for fuzzier comparison. So there wasn't really a reason to use it. [1] https://pypi.org/project/dhash/ [2] http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html
Diffstat (limited to 'filters')
-rw-r--r--filters/user_filters.c3
-rw-r--r--filters/user_filters.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/filters/user_filters.c b/filters/user_filters.c
index e1b7a8bce1..1a4cf3b122 100644
--- a/filters/user_filters.c
+++ b/filters/user_filters.c
@@ -64,6 +64,9 @@ const struct mp_user_filter_entry *vf_list[] = {
&vf_lavfi,
&vf_lavfi_bridge,
&vf_sub,
+#if HAVE_ZIMG
+ &vf_fingerprint,
+#endif
#if HAVE_VAPOURSYNTH
&vf_vapoursynth,
#endif
diff --git a/filters/user_filters.h b/filters/user_filters.h
index 88cb859a71..9bf40e248b 100644
--- a/filters/user_filters.h
+++ b/filters/user_filters.h
@@ -33,3 +33,4 @@ extern const struct mp_user_filter_entry vf_format;
extern const struct mp_user_filter_entry vf_vdpaupp;
extern const struct mp_user_filter_entry vf_vavpp;
extern const struct mp_user_filter_entry vf_d3d11vpp;
+extern const struct mp_user_filter_entry vf_fingerprint;