diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-08 15:31:40 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-18 15:21:34 +0000 |
commit | d305dc8d253985f4d7ca324231658ed6f323ab37 (patch) | |
tree | 72270adbc1d0c89d9fdfd22e01c8d109b1a7ec36 | |
parent | 46842da8d515e7a176896354395c12c675a25084 (diff) | |
download | mpv-d305dc8d253985f4d7ca324231658ed6f323ab37.tar.bz2 mpv-d305dc8d253985f4d7ca324231658ed6f323ab37.tar.xz |
TOOLS/autocrop.lua: disable hwdec when needed instead using -copy one
This is more stable in practice. Avoids switching between possibly
different hwdecs and avoids unnecessary init. Software decoding should be
more stable and possibly faster overall for decoding this small portion
of video needed for cropdetect.
-rw-r--r-- | TOOLS/lua/autocrop.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua index b3bc68c52b..b9e1120ea5 100644 --- a/TOOLS/lua/autocrop.lua +++ b/TOOLS/lua/autocrop.lua @@ -17,9 +17,8 @@ inserting the cropdetect filter and setting video-crop, the "C" key should be pressed at a position in the video where the crop region is unambiguous (i.e., not a black frame, black background title card, or dark scene). -If non-copy-back hardware decoding is in use, hwdec is temporarily set to -auto-copy-safe for the duration of cropdetect as the filter would fail -otherwise. +If non-copy-back hardware decoding is in use, hwdec is temporarily disabled for +the duration of cropdetect as the filter would fail otherwise. These are the default options. They can be overridden by adding script-opts-append=autocrop-<parameter>=<value> to mpv.conf. @@ -132,7 +131,7 @@ function detect_crop() if hwdec_current:find("-copy$") == nil and hwdec_current ~= "no" and hwdec_current ~= "crystalhd" and hwdec_current ~= "rkmpp" then hwdec_backup = mp.get_property("hwdec") - mp.set_property("hwdec", "auto-copy-safe") + mp.set_property("hwdec", "no") end -- Insert the cropdetect filter. |