Commit Graph

14 Commits

Author SHA1 Message Date
Guido Cella 6fe4fc4593 TOOLS/autocrop.lua: allow hiding OSD messages
Because having these on every video is annoying, and when you resume
from watch later files, the filters are applied immediately so they hide
your osd-playing-msg or equivalent show-text commands.
2021-07-27 20:32:05 +03:00
Guido Cella 075154175d TOOLS/autocrop.lua: improve enable/disable condition
The previous code tried to disable autocrop for cover-art by testing
that track-list/$vid/albumart is false, however, $vid is completely
unrelated to the track-list index.

It only sometimes succeeded to disable for albumart, by accident,
e.g. with one audio track and one video track where $vid==1 and
track-list/1 happens to be the video (cover art) track.

The new code detects the currently-used video track by finding a track
with type=="video" and selected==true. Unlike the previous code, it
also works in scenarios with many audio/video/sub tracks.

Additionally, autocrop is now enabled also with lavfi-complex, which
should be considered an improvement. The previous code implicitly
disabled it with lavfi-complex because $vid is nil on such case.
2021-07-14 11:58:29 +03:00
ヒカリ 376aea36eb TOOLS/autocrop.lua: automatically crop at startup 2020-06-01 23:07:26 -07:00
Ricardo Constantino 1171f92beb
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.
2017-08-17 20:43:25 +01:00
Avi Halachmi (:avih) 39e04e9294 options: deprecate 'lua' based options/dirs for 'script'
- --lua and --lua-opts change to --script and --script-opts
- 'lua' default script dirs change to 'scripts'
- DOCS updated

- 'lua-settings' dir was _not_ modified

The old lua-based names/dirs still work, but display a warning.

Signed-off-by: wm4 <wm4@nowhere>
2014-12-15 04:39:56 +01:00
Kevin Mitchell 3617399a46 TOOLS/lua: remove tabs from some lua scripts 2014-10-21 00:55:15 +02:00
Kevin Mitchell 6e62779e98 TOOLS/lua: conform to whitespace coding-style 2014-05-06 09:59:59 -07:00
Kevin Mitchell 20b5fecdf1 TOOLS/lua: use double quotes unless there's a good reason 2014-05-04 12:59:21 -07:00
Kevin Mitchell c91373a202 TOOLS/lua/autocrop: handle case of user hitting hotkey while cropdetection already running 2014-05-04 12:54:03 -07:00
Kevin Mitchell 74984aaff1 TOOLS/lua: no longer gsub out "lua/" prefix, now that its no longer there 2014-05-04 12:29:32 -07:00
Kevin Mitchell 8e8758dbe1 TOOLS: better documentation of lua scripts 2014-04-29 08:31:44 -07:00
Kevin Mitchell 4b0a760d86 TOOLS: improve autocrop.lua
It now inserts no filters and does nothing until the hot-key is pressed.
This makes it more suitable to be put in ~/.mpv/lua.

When the hot-key is pressed, it now inserts the cropdetect filter and
waits 1 second (or a --lua-opts specified duration) before gathering
the cropdetect metadata and inserting the appropriate crop filter. A
second press of the hotkey removes the crop.
2014-04-29 08:31:44 -07:00
Kevin Mitchell 4e973c059a TOOLS: indent lua scripts by 4 spaces instead of 3 2014-04-27 15:34:53 +02:00
Kevin Mitchell ae56b8d237 TOOLS: move autocrop.lua to TOOLS/lua
in anticipation of more lua scripts
2014-04-27 15:34:52 +02:00