From 1171f92beb4fd89e1ba4e76c9b0accacca36a32d Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Thu, 17 Aug 2017 20:43:25 +0100 Subject: 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. --- TOOLS/lua/autocrop.lua | 7 ++++--- 1 file 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"], -- cgit v1.2.3