diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2017-08-17 20:43:25 +0100 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2017-08-17 20:43:25 +0100 |
commit | 1171f92beb4fd89e1ba4e76c9b0accacca36a32d (patch) | |
tree | 15c131b11282e774b15302d39c8f5714b3152dbd /TOOLS/lua | |
parent | b9430309ec69e853add16c60e078710f5fc4052b (diff) | |
download | mpv-1171f92beb4fd89e1ba4e76c9b0accacca36a32d.tar.bz2 mpv-1171f92beb4fd89e1ba4e76c9b0accacca36a32d.tar.xz |
TOOLS/autocrop.lua: fix cropdetect black limit for 10-bit videos
Also update to use newer lavfi-bridges for the relevant filters to
shut up warnings about deprecated crop filter.
Diffstat (limited to 'TOOLS/lua')
-rw-r--r-- | TOOLS/lua/autocrop.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua index 35ca618c10..2316a46d00 100644 --- a/TOOLS/lua/autocrop.lua +++ b/TOOLS/lua/autocrop.lua @@ -66,8 +66,8 @@ function autocrop_start() -- insert the cropdetect filter ret=mp.command( string.format( - 'vf add @%s:lavfi=graph="cropdetect=limit=24:round=2:reset=0"', - cropdetect_label + 'vf add @%s:cropdetect=limit=%f:round=2:reset=0', + cropdetect_label, 24/255 ) ) -- wait to gather data @@ -79,6 +79,7 @@ function do_crop() local cropdetect_metadata = mp.get_property_native( string.format("vf-metadata/%s", cropdetect_label) ) + -- use it to crop if its valid if cropdetect_metadata then if cropdetect_metadata["lavfi.cropdetect.w"] @@ -86,7 +87,7 @@ function do_crop() and cropdetect_metadata["lavfi.cropdetect.x"] and cropdetect_metadata["lavfi.cropdetect.y"] then - mp.command(string.format("vf add @%s:crop=%s:%s:%s:%s", + mp.command(string.format("vf add @%s:lavfi-crop=w=%s:h=%s:x=%s:y=%s", crop_label, cropdetect_metadata["lavfi.cropdetect.w"], cropdetect_metadata["lavfi.cropdetect.h"], |