summaryrefslogtreecommitdiffstats
path: root/TOOLS/lua
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2017-03-17 16:49:28 +0100
committerwm4 <wm4@nowhere>2017-03-25 12:57:10 +0100
commit222899fbbe523320e66ae1600fabe45b58d48686 (patch)
treecdd094f983583de621ebb3d69c1bd426c5e142f9 /TOOLS/lua
parentd663a0e90dc0df3d8c50a471b918d8a6c6f78da5 (diff)
downloadmpv-222899fbbe523320e66ae1600fabe45b58d48686.tar.bz2
mpv-222899fbbe523320e66ae1600fabe45b58d48686.tar.xz
af_drc: remove
Remove low quality drc filter. Anyone whishing to have dynamic range compression should use the much more powerful acompressor ffmpeg filter: mpv --af=lavfi=[acompressor] INPUT Or with parameters: mpv --af=lavfi=[acompressor=threshold=-25dB:ratio=3:makeup=8dB] INPUT Refer to https://ffmpeg.org/ffmpeg-filters.html#acompressor for a full list of supported parameters. Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'TOOLS/lua')
-rw-r--r--TOOLS/lua/drc-control.lua99
1 files changed, 0 insertions, 99 deletions
diff --git a/TOOLS/lua/drc-control.lua b/TOOLS/lua/drc-control.lua
deleted file mode 100644
index 83cdb9c935..0000000000
--- a/TOOLS/lua/drc-control.lua
+++ /dev/null
@@ -1,99 +0,0 @@
--- This script enables live control of the dynamic range compression
--- (drc) audio filter while the video is playing back. This can be
--- useful to avoid having to stop and restart mpv to adjust filter
--- parameters. See the entry for "drc" under the "AUDIO FILTERS"
--- section of the man page for a complete description of the filter.
---
--- This script registers the key-binding "\" to toggle the filter between
---
--- * off
--- * method=1 (single-sample smoothing)
--- * method=2 (multi-sample smoothing)
---
--- It registers the keybindings ctrl+9/ctrl+0 to decrease/increase the
--- target ampltiude. These keys will insert the filter at the default
--- target amplitude of 0.25 if it was not previously present.
---
--- OSD feedback of the current filter state is displayed on pressing
--- each bound key.
-
-script_name = mp.get_script_name()
-
-function print_state(params)
- if params then
- mp.osd_message(script_name..":\n"
- .."method = "..params["method"].."\n"
- .."target = "..params["target"])
- else
- mp.osd_message(script_name..":\noff")
- end
-end
-
-function get_index_of_drc(afs)
- for i,af in pairs(afs) do
- if af["label"] == script_name then
- return i
- end
- end
-end
-
-function append_drc(afs)
- afs[#afs+1] = {
- name = "drc",
- label = script_name,
- params = {
- method = "1",
- target = "0.25"
- }
- }
- print_state(afs[#afs]["params"])
-end
-
-function modify_or_create_af(fun)
- afs = mp.get_property_native("af")
- i = get_index_of_drc(afs)
- if not i then
- append_drc(afs)
- else
- fun(afs, i)
- end
- mp.set_property_native("af", afs)
-end
-
-function drc_toggle_method_handler()
- modify_or_create_af(
- function (afs, i)
- new_method=(afs[i]["params"]["method"]+1)%3
- if new_method == 0 then
- table.remove(afs, i)
- print_state(nil)
- else
- afs[i]["params"]["method"] = tostring((afs[i]["params"]["method"])%2+1)
- print_state(afs[i]["params"])
- end
- end
- )
-end
-
-function drc_scale_target(factor)
- modify_or_create_af(
- function (afs)
- afs[i]["params"]["target"] = tostring(afs[i]["params"]["target"]*factor)
- print_state(afs[i]["params"])
- end
- )
-end
-
-function drc_louder_handler()
- drc_scale_target(2.0)
-end
-
-function drc_quieter_handler()
- drc_scale_target(0.5)
-end
-
--- toggle between off, method 1 and method 2
-mp.add_key_binding("\\", "drc_toggle_method", drc_toggle_method_handler)
--- increase or decrease target volume
-mp.add_key_binding("ctrl+9", "drc_quieter", drc_quieter_handler)
-mp.add_key_binding("ctrl+0", "drc_louder", drc_louder_handler)