Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced VideoTek() as waveform monitor for video #27

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
067203e
Changed default behavior to "off"
FranceBB Apr 10, 2021
9f6af30
Updated documentation
FranceBB Apr 10, 2021
6fc7397
Update Readme.md
FranceBB Apr 10, 2021
ba0bfea
Delete firequalizer15.lua
FranceBB Apr 10, 2021
289a685
Update Readme.md
FranceBB Apr 10, 2021
534db36
Update Readme.md
FranceBB Apr 10, 2021
7a2b0e3
Improved documentation
FranceBB Jun 16, 2021
085c340
Introduced support to VideoTek
FranceBB Jun 20, 2021
eac846b
Merge branch 'mfcc64:master' into master
FranceBB Jun 20, 2021
ddea852
Added screenshot for VideoTek
FranceBB Jun 20, 2021
5b2a452
Added screenshot for VideoTek
FranceBB Jun 20, 2021
7468bc3
Add files via upload
FranceBB Jun 20, 2021
aa61282
Add files via upload
FranceBB Jun 20, 2021
9afc6a3
Delete screenshoots directory
FranceBB Jun 20, 2021
4b131b2
Added VideoTek in documentation
FranceBB Jun 20, 2021
b6d80c8
Update Readme.md
FranceBB Jun 20, 2021
9ea991d
Fixed issue with Luma visualization
FranceBB Jun 21, 2021
5d267be
Delete VideoTek1.jpg
FranceBB Jun 21, 2021
5bb0d9d
Delete VideoTek2.jpg
FranceBB Jun 21, 2021
9beb95a
Add files via upload
FranceBB Jun 21, 2021
f023f42
Update Readme.md
FranceBB Jun 21, 2021
4acc874
Fixed a bug reported by Frank on returning A/V
FranceBB Sep 3, 2022
4ffe139
Update visualizer.lua
FranceBB Sep 3, 2022
e5d11a7
Merge pull request #1 from mfcc64/master
FranceBB Sep 3, 2022
45c2a29
Update VideoTek.lua
FranceBB Sep 3, 2022
a9a1a97
Update VideoTek.lua
FranceBB Sep 3, 2022
8e6bd66
Add files via upload
FranceBB Feb 24, 2023
e952c3b
Update Readme.md
FranceBB Feb 24, 2023
23cfcd3
Updated documentation
FranceBB Feb 24, 2023
7c1724f
Force Window option introduction in Visualizer + bug fix
FranceBB Feb 24, 2023
04edbc0
Merge branch 'mfcc64:master' into master
FranceBB Jul 4, 2024
268b01f
Merge branch 'mfcc64:master' into master
FranceBB Sep 29, 2024
65d3386
Update Readme section with related projects
FranceBB Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
## Various mpv lua scripts

- visualizer.lua - various audio visualization.
## Waveform Monitor LUA Script for MPV

- VideoTek.lua is a waveform monitor for MPV.
- visualizer.lua is a script that shows various audio visualization for MPV.
- firequalizer.lua - linear phase 15-bands equalizer.

## Key bindings

Look at the lua scripts.
Both filters are disabled by default.
<br>
Press "Y" to turn on "VideoTek" and have a waveform monitor for luma, chroma, phase and loudness.
<br>
Press "C" to turn on "Visualizer" and switch between showcqt, avectorscope, showspectrum, showcqtbar and showwaves.
<br>

## Screenshots

### VideoTek.lua

![VideoTek](Screenshots/VideoTek.jpg)

## Screenshoots

### visualizer.lua

- showcqt

![showcqt](screenshoots/showcqt.jpg)
![showcqt](Screenshots/showcqt.jpg)

- avectorscope

![avectorscope](screenshoots/avectorscope.jpg)
![avectorscope](Screenshots/avectorscope.jpg)

- showspectrum

![showspectrum](screenshoots/showspectrum.jpg)
![showspectrum](Screenshots/showspectrum.jpg)

- showcqtbar

![showcqtbar](screenshoots/showcqtbar.jpg)
![showcqtbar](Screenshots/showcqtbar.jpg)

- showwaves

![showwaves](screenshoots/showwaves.jpg)
![showwaves](Screenshots/showwaves.jpg)

### firequalizer15.lua

![firequalizer15](screenshoots/firequalizer15.jpg)
![firequalizer15](Screenshots/firequalizer15.jpg)

## Related projects

- [HTML5 ShowCQTBar](https://github.com/mfcc64/html5-showcqtbar) - showcqt/showcqtbar visualizer on an HTML5 page.
- [YouTube Musical Spectrum](https://github.com/mfcc64/youtube-musical-spectrum) - showcqt visualizer as a Chrome extension.

### Contributors
- mfcc64 for the audio visualizers.
- Livio Aloja & Francesco Bucciantini for VideoTek.
Binary file added Screenshots/VideoTek.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
139 changes: 139 additions & 0 deletions VideoTek.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
-- various audio visualization



local opts = {
mode = "force",
-- off disable visualization
-- force always enable visualization



name = "off",
-- off
-- tektronix



quality = "medium",
-- medium




}



-- key bindings
-- cycle visualizer
local cycle_key = "y"



if not (mp.get_property("options/lavfi-complex", "") == "") then
return
end



local visualizer_name_list = {
"off",
"tektronix",
}





local options = require 'mp.options'
local msg = require 'mp.msg'



options.read_options(opts)

local function get_visualizer(name)


-- Here we define the Graph
if name == "tektronix" then
return "color=c=black:s=1280x720[black];[vid1]split=3[v1][v2][v3];[aid1]asplit[a1][a2];[a1]avectorscope=s=240x160:zoom=2:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7[avect-out];[a2]showvolume=r=25:w=140:h=10:t=0:f=0.9[vol-out];[v1]scale=640x360[v1-o];[v2]hflip,waveform=m=1:d=0:r=1:c=7,scale=640x360,setsar=1,hflip[v2-o];[v3]vectorscope=m=0:g=green,scale=300x300,setsar=1[vect];[black][v1-o]overlay=0:0[q1];[q1][vol-out]overlay=640:0[q2];[q2][v2-o]overlay=0:360[q3];[q3][avect-out]overlay=1000:490[q4];[q4][vect]overlay=700:390[q5];[q5] setpts=PTS [vo]"
elseif name == "off" then
return "[aid1] asetpts=PTS [ao]; [vid1] setpts=PTS [vo]"
end
msg.log("error", "invalid visualizer name")
return ""
end



local function select_visualizer(atrack, vtrack, albumart)
if opts.mode == "off" then
return ""
elseif opts.mode == "force" then
return get_visualizer(opts.name)



end



msg.log("error", "invalid mode")
return ""
end



local function visualizer_hook()
local count = mp.get_property_number("track-list/count", -1)
local atrack = 0
local vtrack = 0
local albumart = 0
if count <= 0 then
return
end
for tr = 0,count-1 do
if mp.get_property("track-list/" .. tr .. "/type") == "audio" then
atrack = atrack + 1
else
if mp.get_property("track-list/" .. tr .. "/type") == "video" then
if mp.get_property("track-list/" .. tr .. "/albumart") == "yes" then
albumart = albumart + 1
else
vtrack = vtrack + 1
end
end
end
end



mp.set_property("options/lavfi-complex", select_visualizer(atrack, vtrack, albumart))
end



mp.add_hook("on_preloaded", 50, visualizer_hook)



local function cycle_visualizer()
local i, index = 1
for i = 1, #visualizer_name_list do
if (visualizer_name_list[i] == opts.name) then
index = i + 1
if index > #visualizer_name_list then
index = 1
end
break
end
end
opts.name = visualizer_name_list[index]
visualizer_hook()
end



mp.add_key_binding(cycle_key, "cycle-visualizer", cycle_visualizer)
2 changes: 1 addition & 1 deletion visualizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local opts = {
-- novideo enable visualization when no video
-- force always enable visualization

name = "showcqt",
name = "off",
-- off
-- showcqt
-- avectorscope
Expand Down