Skip to content

Instantly share code, notes, and snippets.

@mxmilkiib
Last active March 6, 2021 17:55
Show Gist options
  • Save mxmilkiib/3dd5207c75b489811c3d062f41f5f354 to your computer and use it in GitHub Desktop.
Save mxmilkiib/3dd5207c75b489811c3d062f41f5f354 to your computer and use it in GitHub Desktop.
quick jack audio to waterfall spectrgraph (ffmpeg showcqt filter in mpv)
# https://github.com/mfcc64/mpv-scripts/blob/master/visualizer.lua
# https://github.com/mfcc64/showcqt-bash
# fixed to 800x600 atm. todo; migrate calculations from other projects
# basic, no data image
mpv --config=no --quiet --lavfi-complex="[aid1] asplit [ao], afifo, aformat = channel_layouts = stereo, firequalizer = gain = '1.4884e8 * f*f*f / (f*f + 424.36) / (f*f + 1.4884e8) / sqrt(f*f + 25122.25)': scale = linlin : wfunc = tukey: zero_phase = on: fft2 = on, showcqt = size = 800x600 : count= 2.5 : csp = bt709 : bar_g = 2: sono_g = 4 : bar_v= 9 : sono_v = 17 : font = 'Nimbus Mono L,Courier New,mono' : fontcolor = 'st(0, (midi(f)-53.5)/12); st(1, 0.5 - 0.5 * cos(PI*ld(0))); r(1-ld(1)) + b(ld(1))' : tc = 0.33 : attack = 0.033 : tlength= 'st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))', format = yuv420p [vo]" av://jack:"mpv JACK"
# silly long, includes data image for horizontal axis note/octave labels
mpv --config=no --quiet --lavfi-complex="[aid1] asplit [ao], afifo, aformat = channel_layouts = stereo, firequalizer = gain = '1.4884e8 * f*f*f / (f*f + 424.36) / (f*f + 1.4884e8) / sqrt(f*f + 25122.25)': scale = linlin : wfunc = tukey: zero_phase = on: fft2 = on, showcqt = size = 800x600 : count= 2.5 : csp = bt709 : bar_g = 2: sono_g = 4 : bar_v= 9 : sono_v = 17 : axisfile = data\\\\:'image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAAgCAQAAABZEK0tAAAACXBIWXMAAA7EA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mwPdnf+uKfb1BP/9s76mX/75u7PVOr8/u/qK+Yx1j5p/x2q93en329Hf5q86r3PlPvd08o35809U7vT67+5ucGbnX74M1jO3aMNZ6p9dnd39TsoaHum/wVzlLGPvXP8Za7/T67O4v7GcPitZ32K93en329dfwZdCfOvIAoyN/Y8xskbF9eqfXZ3d/EV/zZsDXdV30qDl79U6vz+7+bPJknAAG2oe6jm///hhjdfvvPz3lxfkXDtcfZay7pf5obYX02vKk6Z1en739PTuP37PQ1VR/tP6o5yJjks92S5re6fXZ3Z/L3VzdXP351oObqvcNdfv6jX/mwU690+uzu7+wn9jZfinysInx0Du9Pvv662rsaancvn9TzT5vz1D3tOyx1ju9Prv7c7n5mb3hn59u6bjCTJcY26l3en1298f9nqf7+njqnV6fff2Vv8t/4urEzu8+8/V7e1Izx1rv9Prs7u/xF2srTuy4+q9gYKizcPnY651en9392ezJSLJ+5VAXX4DdenZq1v2oF3vl9uhN1v7+2Id1j43e6fXZ29/shfF3RryQM7Z6p9dnd38ud/W+yL0Zva3rV4693un12d0f9x+n8x+zZ+yeZ1LGeOidXp+d/ZVv9PaE9293i9kdtnbqnV6f3f3x59u3/Cf84JQv3h8PvdPrs7s/l/uR5/pu6Sxu19U7vT57+6v9OHyG6WuL/tTLWOqdXp+9/WXk8AfMMea5+ItXxkPv9Prs7s9mT9YpIHepTvvjrYfD4Waempm7tDj/+QVWl7fo6p1en939wcfXH3luweKifLMfmbFf7/T67O6Pe/ary/MefWH89E6vz+7+4OPpU7Pyls38pfXzi67e6fXZ29/kzOV5OrMLXb3T67O7P1sdBxc4HA6Hw+FwOBwOhz8UDgRwOBwOh8PhcDgcDn8oHAjgcDgcDofD4XA4HP4w+P8AQEuXMXpD8/kAAAAASUVORK5CYII=' : font = 'Nimbus Mono L,Courier New,mono' : fontcolor = 'st(0, (midi(f)-53.5)/12); st(1, 0.5 - 0.5 * cos(PI*ld(0))); r(1-ld(1)) + b(ld(1))' : tc = 0.33 : attack = 0.033 : tlength= 'st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))', format = yuv420p [vo]" av://jack:"mpv JACK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment