Play a music file in your terminal with a nice visualization, using this one-liner. This is very nice way to get a simple animation whilst playing a music file. MPV does support a massive amount of playing options, and using a visualization while playing music is another hidden feature.
mpv --config=no --quiet --vo=tct --lavfi-complex='[aid1]asplit[ao][a1];[a1]avectorscope=r=25:m=lissajous_xy:bc=200:gc=100:rc=75:bf=5:gf=3:rf=1:zoom=2[vo]' https://www.gnu.org/music/markushaist-free-software-song.ogg |
Use this version for a traditional waveform visualization.
mpv --config=no --quiet --vo=tct --lavfi-complex='[aid1]asplit[ao][a1];[a1]showwaves=mode=cline:colors=white:rate=25[vo]' https://www.gnu.org/music/markushaist-free-software-song.ogg |
This is what the second example looks like in the Konsole terminal. It might look different depending on the terminal you use, whether it is urxvt or xterm.
This is a tweaked version of the first example, this works very well for playing music in a terminal.
mpv --config=no --quiet --vo=tct --lavfi-complex='[aid1]asplit[ao][a1];[a1]avectorscope=r=25:m=lissajous_xy:bc=100:gc=100:rc=75:bf=5:gf=3:rf=1:zoom=1[vo]' https://www.gnu.org/music/markushaist-free-software-song.ogg |
This is a very cool trick for playing music in a terminal. It is a good alternative to other music players. Maybe play around with the filters and see if you can get a more random result.
mpv –config=no –audio-device=pulse/alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo –quiet –vo=tct –lavfi-complex='[aid1]asplit[ao][a1];[a1]showcqt[vo]’ /media/sdc2/Projects/Music/NSF/amazingmusic/NSF_Archive/Chiptune_Artists/Originals/*
showcqt ftw!
thanks!
i already had a small mpv script with custom status but this made it miles better.Thanks for the amazing one-liner!
The above commands were meant for audio. However, with some tweaks, the waveform can be overlaid on the original video. I find this useful for detecting the exact frame for some scene changes. I also prefer log scale to maximize the height of the graph. Example:
Fantastic!! I had no idea this was built in. Love it, thank you!
both filters fail for me with mpv 0.32.0
[ffmpeg] AVFilterGraph: No such filter: ‘[aid1]asplit[ao][a1];[a1]avectorscope=r=25:m=lissajous_xy:bc=100:gc=100:rc=75:bf=5:gf=3:rf=1:zoom=1[vo]’
[lavfi] parsing the filter graph failed
I am using this version, maybe you have a different version?