mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 01:52:19 +00:00
TOOLS: vf-metadata: lua cropdetect example script
Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
parent
9eb061a72b
commit
f5954b2223
11
TOOLS/autocrop.lua
Normal file
11
TOOLS/autocrop.lua
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user