summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-04-26 10:25:02 -0700
committerwm4 <wm4@nowhere>2014-04-27 15:34:52 +0200
commitae56b8d237be4cff44b3a92c5d2eeb44e3fda694 (patch)
tree743743a0e3bc074bf45d3a422ed269d29ee938b8 /TOOLS/lua
parentce48da9e027c9e8b685a74f04e9163952c5a5320 (diff)
downloadmpv-ae56b8d237be4cff44b3a92c5d2eeb44e3fda694.tar.bz2
mpv-ae56b8d237be4cff44b3a92c5d2eeb44e3fda694.tar.xz
TOOLS: move autocrop.lua to TOOLS/lua
in anticipation of more lua scripts
Diffstat (limited to 'TOOLS/lua')
-rw-r--r--TOOLS/lua/autocrop.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua
new file mode 100644
index 0000000000..e5292eee18
--- /dev/null
+++ b/TOOLS/lua/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)