summaryrefslogtreecommitdiffstats
path: root/TOOLS/vf_dlopen/ildetect.sh
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2013-06-14 14:32:18 +0200
committerRudolf Polzer <divverent@xonotic.org>2013-06-16 17:11:25 +0200
commit7ae4242820236bdd32ed080d05d674fdfe16483e (patch)
treef625666c77cc3abee2772816484ecb4a0be07230 /TOOLS/vf_dlopen/ildetect.sh
parentde63e1d15e93892c2c74c417fdf4b195b70fc8ee (diff)
downloadmpv-7ae4242820236bdd32ed080d05d674fdfe16483e.tar.bz2
mpv-7ae4242820236bdd32ed080d05d674fdfe16483e.tar.xz
vf_dlopen filters: add an "ildetect" filter that detects interlacing
The filter analyzes each frame for combing, and decides at the end whether the content is likely interlaced, telecined or progressive.
Diffstat (limited to 'TOOLS/vf_dlopen/ildetect.sh')
-rwxr-xr-xTOOLS/vf_dlopen/ildetect.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/TOOLS/vf_dlopen/ildetect.sh b/TOOLS/vf_dlopen/ildetect.sh
new file mode 100755
index 0000000000..e9027077d2
--- /dev/null
+++ b/TOOLS/vf_dlopen/ildetect.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+case "$0" in
+ */*)
+ MYDIR=${0%/*}
+ ;;
+ *)
+ MYDIR=.
+ ;;
+esac
+
+set -e
+
+make -C "$MYDIR"
+
+testfun()
+{
+ ${MPV:-mpv} "$@" \
+ -vf dlopen="$MYDIR/ildetect.so" \
+ -o /dev/null -of nut -ovc rawvideo -no-audio \
+ | grep "^ildetect:"
+}
+
+out=`testfun "$@"`
+echo
+echo
+echo "$out"
+echo
+echo
+case "$out" in
+ *"probably: PROGRESSIVE"*)
+ ${MPV:-mpv} "$@"
+ ;;
+ *"probably: INTERLACED"*)
+ ${MPV:-mpv} "$@" -vf-pre yadif
+ ;;
+ *"probably: TELECINED"*)
+ ${MPV:-mpv} "$@" -vf-pre pullup
+ ;;
+ *)
+ false
+ ;;
+esac