summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-04-11 04:50:06 -0700
committerwm4 <wm4@nowhere>2014-04-13 18:03:01 +0200
commitf5954b222365c6a9224a90be112e6842c8f62e62 (patch)
tree0da18f673905322816dbbcd7b1e84e321df6dfbc
parent9eb061a72b66702d394584fac371358050f7ad18 (diff)
downloadmpv-f5954b222365c6a9224a90be112e6842c8f62e62.tar.bz2
mpv-f5954b222365c6a9224a90be112e6842c8f62e62.tar.xz
TOOLS: vf-metadata: lua cropdetect example script
Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--TOOLS/autocrop.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/TOOLS/autocrop.lua b/TOOLS/autocrop.lua
new file mode 100644
index 0000000000..e5292eee18
--- /dev/null
+++ b/TOOLS/autocrop.lua
@@ -0,0 +1,11 @@
+mp.command('vf add @autocrop.cropdetect:lavfi=graph="cropdetect=limit=24:round=2:reset=0"')
+
+function update_crop_handler()
+ cropdetect_metadata=mp.get_property_native("vf-metadata/autocrop.cropdetect")
+ mp.command(string.format('vf add @autocrop.crop:crop=%s:%s:%s:%s',
+ cropdetect_metadata['lavfi.cropdetect.w'],
+ cropdetect_metadata['lavfi.cropdetect.h'],
+ cropdetect_metadata['lavfi.cropdetect.x'],
+ cropdetect_metadata['lavfi.cropdetect.y']))
+end
+mp.add_key_binding("C","update_crop",update_crop_handler)