{"id":89487,"date":"2017-02-06T13:21:05","date_gmt":"2017-02-06T13:21:05","guid":{"rendered":"http:\/\/johnwarburton.net\/blog\/?p=89487"},"modified":"2017-02-08T21:08:53","modified_gmt":"2017-02-08T21:08:53","slug":"free-audio-display-with-ffmpeg-and-mpv","status":"publish","type":"post","link":"http:\/\/johnwarburton.net\/blog\/?p=89487","title":{"rendered":"Free audio display with FFmpeg and MPV"},"content":{"rendered":"<p>Just for fun, I wondered what useful stereo audio displays could be placed on a Windows desktop using a single open source suite. Using <a href=\"https:\/\/github.com\/Warblefly\/MultimediaTools-mingw-w64#readme\" target=\"_blank\">my binary distribution<\/a>, here is a promising start.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/johnwarburton.net\/blog\/wp-content\/uploads\/2017\/02\/audio-meters-4.png\" alt=\"Audio Meters with FFmpeg\" width=\"809\" height=\"1080\" class=\"alignnone size-full wp-image-89601\" srcset=\"http:\/\/johnwarburton.net\/blog\/wp-content\/uploads\/2017\/02\/audio-meters-4.png 809w, http:\/\/johnwarburton.net\/blog\/wp-content\/uploads\/2017\/02\/audio-meters-4-225x300.png 225w, http:\/\/johnwarburton.net\/blog\/wp-content\/uploads\/2017\/02\/audio-meters-4-768x1025.png 768w, http:\/\/johnwarburton.net\/blog\/wp-content\/uploads\/2017\/02\/audio-meters-4-767x1024.png 767w\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" \/><\/p>\n<p>Here, within the <a href=\"https:\/\/mpv.io\/\" target=\"_blank\">MPV player<\/a>, <a href=\"http:\/\/ffmpeg.org\/\" target=\"_blank\">FFmpeg libraries<\/a> 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&#8217;ve started calibration. The PPM is referenced to the BBC&#8217;s transmitted levels, and it therefore reads 5dB high. On the spectrum displays, the vertical intervals occur every 5kHz.<\/p>\n<p>Use the MPV player, which can take full advantage of OpenGL acceleration in Windows and other OSes. Then it&#8217;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.<\/p>\n<p>Please ignore line breaks in what follows&#8230; (a straight copy-and-paste into Windows Powershell works perfectly).<\/p>\n<pre><code>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<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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. Here, within the MPV player, FFmpeg libraries produce two kinds of spectrum, a phase indicator, an EBU R128 measurement tool, a display showing &hellip; <a href=\"http:\/\/johnwarburton.net\/blog\/?p=89487\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Free audio display with FFmpeg and MPV<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-89487","post","type-post","status-publish","format-standard","hentry","category-film-making"],"_links":{"self":[{"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/89487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89487"}],"version-history":[{"count":22,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/89487\/revisions"}],"predecessor-version":[{"id":89953,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/89487\/revisions\/89953"}],"wp:attachment":[{"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89487"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/johnwarburton.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}