Free audio display with FFmpeg and MPV

Just for fun, I wondered what useful stereo audio displays could be placed on a Windows desktop using a single open source suite. Using my binary distribution, here is a promising start.

Audio Meters with FFmpeg

Here, within the MPV player, FFmpeg libraries produce two kinds of spectrum, a phase indicator, an EBU R128 measurement tool, a display showing the musical pitch of incoming sounds, a display of coherence between channels with an average indication, and a volume meter. I’ve started calibration. The PPM is referenced to the BBC’s transmitted levels, and it therefore reads 5dB high. On the spectrum displays, the vertical intervals occur every 5kHz.

Use the MPV player, which can take full advantage of OpenGL acceleration in Windows and other OSes. Then it’s easier to change the stereo source on the end to anything you like. In the example below, I use the 320kbit/s AAC stream of BBC 6Music, which you can hear in the UK. Alter it to your own preferred stereo source.

Please ignore line breaks in what follows… (a straight copy-and-paste into Windows Powershell works perfectly).

mpv --lavfi-complex="[aid1]asplit=7[a][b][c][d][e][f][g];[a]avectorscope=size=480x480:zoom=2:draw=line:r=25,drawgrid=240:240:color=gray[z];[b]ebur128=video=1:meter=18[q][x];[q]scale=480:480[y];[z][y]hstack[w];[c]showfreqs=fscale=lin:win_size=w4096:cmode=separate:size=480x480:minamp=1e-009,drawgrid=x=0:y=479:w=100:h=60:color=gray[u];[d]showspectrum=size=480x480:overlap=1:slide=scroll:scale=5thrt:mode=combined[t];[t][u]hstack[v];[e]showvolume=r=25:w=960:h=50:t=0:f=0.9,drawtext=font=Arial:fontsize=24:text='1':x=47:y=40:fontcolor=white,drawtext=font=Arial:fontsize=24:text='2':x=77:y=40:fontcolor=white,drawtext=font=Arial:fontsize=24:text='3':x=128:y=40:fontcolor=white,drawtext=font=Arial:fontsize=24:text='4':x=206:y=40:fontcolor=cyan,drawtext=font=Arial:fontsize=24:text='5':x=330:y=40:fontcolor=white,drawtext=font=Arial:fontsize=24:text='6':x=528:y=40:fontcolor=red,drawtext=font=Arial:fontsize=24:text='7':x=842:y=40:fontcolor=pink[s];[f]showcqt=size=960x180:r=25:bar_g=7:timeclamp=0.5[r];[g]aphasemeter=size=960x40:mpc=red[h][p];[h]anullsink;[v][w][r][p][s]vstack=inputs=5[vo];[x]anull[ao]" http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_6music.m3u8

Leave a Reply

Your email address will not be published. Required fields are marked *