43

I have to create a video. Part of it involves "showing" a radio interview. Rather than just having a black screen and listening to the audio, I'd like to have a varying waveform on the screen and a caption.

Is there any free or cheap tool I can use that will do this?


If I ask a friend to do it, is there anything in the Adobe Creative Suite that can do the job?

3
  • Audacity should show you the sound wave; you could record - visually - the wave.
    – boblet
    Dec 7, 2013 at 20:40
  • It's worth mentioning that the "visualizer" tool you're probably looking for is an oscilloscope, which may inform your search. Dec 12, 2013 at 18:42
  • You can use ffmpeg to convert directly - ffmpeg convert audio into video Using filters you can get an aesthetically pleasing video. Jul 6, 2020 at 21:17

7 Answers 7

66

You can use ffmpeg to create video from audio using several filters.


ahistogram

Convert input audio to a video output, displaying the volume histogram.

ahistogram

ffmpeg

ffmpeg -i input.flac -filter_complex \
"[0:a]ahistogram,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.flac, asplit [a][out1]; [a] ahistogram [out0]"

See the ahistogram documentation for more options and examples.


aphasemeter

Convert input audio to a video output, displaying the audio phase.

aphasemeter

ffmpeg

ffmpeg -i input.wav -filter_complex \
"[0:a]aphasemeter=s=1280x720:mpc=cyan,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.wav, asplit [a][out1]; [a] aphasemeter=s=1280x720:mpc=cyan [out0]"

See the aphasemeter documentation for more options and examples.


avectorscope

avectorscope filter

Convert input audio to a video output, representing the audio vector scope.

ffmpeg

ffmpeg -i input.mp3 -filter_complex \
"[0:a]avectorscope=s=1280x720,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.mp3, asplit [a][out1]; \
[a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]"

See the avectorscope documentation for more options and examples.


showcqt

showcqt filter

Convert input audio to a video output representing frequency spectrum with musical tone scale.

ffmpeg

ffmpeg -i input.mp4 -filter_complex \
"[0:a]showcqt,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.mp4, asplit [a][out1]; [a] showcqt [out0]"

See the showcqt documentation for more options and examples.


showfreqs

Convert input audio to video output representing the audio power spectrum. Audio amplitude is on Y-axis while frequency is on X-axis.

showfreqs

ffmpeg

ffmpeg -i input.mp4 -filter_complex \
"[0:a]showfreqs=mode=line:fscale=log,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.mp4, asplit [a][out1]; [a]  showfreqs=mode=line:fscale=log [out0]"

See the showfreqs documentation for more options and examples.


showspectrum

showspectrum image

Convert input audio to a video output, representing the audio frequency spectrum.

ffmpeg

ffmpeg -i input.oga -filter_complex \
"[0:a]showspectrum=s=1280x720,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.oga, asplit [a][out1]; \
[a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]"

See the showspectrum documentation for more options and examples.


showwaves

showwaves filter

Convert input audio to a video output, representing the samples waves.

ffmpeg

ffmpeg -i input.m4a -filter_complex \
"[0:a]showwaves=s=1280x720:mode=line:rate=25,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.m4a, asplit [a][out1]; [a] showwaves [out0]"

See the showwaves documentation for more options and examples.


showvolume

showvolume filter

Convert input audio volume to a video output.

ffmpeg

ffmpeg -i input.mka -filter_complex \
"[0:a]showvolume=f=1:b=4:w=720:h=68,format=yuv420p[vid]" \
-map "[vid]" -map 0:a output.mp4

ffplay

ffplay -f lavfi "amovie=input.mka, asplit [a][out1]; [a] showvolume=f=255:b=4:w=720:h=68 [out0]"

See the showvolume documentation for more options and examples.


Notes

  • See FFmpeg Wiki: H.264 Encoding Guide for more detailed information regarding output quality.

  • format=yuv420p makes sure that libx264 uses a pixel format that is compatible with crappy players like QuickTime.

  • Instead of re-encoding by default, you can use -c:a copy to stream copy the audio if your output container format supports the audio format. Think of stream copying (re-muxing) like a copy and paste – no re-encoding.


Get ffmpeg

You should always use a recent version since development is very active. Links to builds of ffmpeg for Windows, OS X, and Linux are available on the FFmpeg Download page. Or you can follow a step-by-step guide to compile ffmpeg.

4
  • 1
    The OP will probably want to look at the other answers which link to After Effects tutorials, but these excellent ffmpeg examples are really useful to have here. Thanks!
    – mivk
    May 19, 2015 at 17:44
  • 1
    @LordNeckbeard OP here. It's been a while, but I'm back, and this is a great answer.
    – ccleve
    Feb 13, 2016 at 3:59
  • I've just created a question superuser.com/questions/1184922/… How can I set a background image? Mar 3, 2017 at 18:28
  • For Ubuntu installation simply use sudo apt install ffmpeg. It includes ffplay and ffprobe which is all I needed for now. Your visualization techniques look promising for when playing song. When song paused the album artwork will be displayed instead. Jul 26, 2020 at 16:31
6

Adobe After Effects has a visualizer, see

There are also plugins such as here for Photoshop.

Good luck with your project.

4

I understood your question quite well. If you are trying to make a waveform pattern that moves according to the pitch and bass of your audio, then you can try this link.

http://www.videocopilot.net/tutorial/audio_to_animation/

Adobe After effects lets you do it easily. You can play along with the particle effects to get a more solid looking waveform.

Good luck!

3

Many music players have visualisers. Play the audio in one of them and use a screen-grabber to record the video.

You could also try to use gstreamer as described at http://www.vidarholen.net/contents/blog/?p=23

Another option is Sonic Candle, http://sourceforge.net/projects/soniccandle/

3

After reading the great answer from LordNeckbeard I went on created a small script to make a visualization with ffmpeg and the showspectrum filter. I also added an upload option for myself to encode directly to my remote server that has a better connection than at home to upload big videos. It also uses the great script youtube-upload!

EDIT: uploading directly slows down the encoding process significantly!!

Script

#!/bin/bash
# ffmpeg spectrum maker

action=$1

infile=$2

outfile=$3
upload_server="sftp://cloud"

upload_location="/home/master/videos/"

remote_command="youtube-upload --title=\"Remote_upload\" --privacy=\"private\" $upload_location$outfile"

#simple spectrum
filter1="showspectrum=s=1920x1080:slide=scroll:mode=combined:color=intensity:scale=cbrt:saturation=1:win_func=hann[tmp]"

#vertical mirror
filter2="[tmp]crop=iw:ih/2:0:ih/2-3,split[up][tmp];[tmp]vflip[down];[up][down]vstack[tmp]"

#horizontal mirror
filter3="[tmp]crop=iw/2:ih:iw/2:,split[left][tmp];[tmp]hflip[right];[left][right]hstack[tmp]"

#fisheye effect VERY SLOW!!! if used make change the size of the spectrum to (1920*11/10)x(1080*11/10) and use the crop filter below
filter4="[tmp]frei0r=filter_name=defish0r:filter_params=1.5|n[tmp]"

#make sure the resolution has the desired size
filter5="[tmp]crop=1920:1080"

#pass the stream to the output for ffplay
testpass="[tmp]copy[out0]"


vcodec="-codec:v libx264 -pix_fmt yuv420p -tune grain -crf 21 -preset medium -bf 2 -flags +cgop -r 25"

acodec="-codec:a libfdk_aac -b:a 128k -movflags +faststart"

#acodec="-codec:a copy"

extraflags="-movflags +faststart "


if [ "$action" = "test" ]
then
        ffplay -f lavfi "amovie=$infile,asplit[a][out1];[a]$filter1;$filter2;$filter3;$testpass"
fi

if [ "$action" = "make" ]
then
        ffmpeg -i "$infile" -filter_complex "[0:a]$filter1;$filter2;$filter3" -map [tmp] -map 0:a $vcodec $acodec $extraflags "$outfile"
fi
if [ "$action" = "upload" ]
then
        ffmpeg -i "$infile" -filter_complex "[0:a]$filter1;$filter2;$filter3" -map [tmp] -map 0:a $vcodec $acodec $extraflags "$upload_server$upload_location$outfile"
        ssh cloud $remote_command
fi
exit

0

If you have access to After Effects, there's a plugin called Trapcode Keys that can do this very effectively. The results look really nice - I've used it on many projects for exactly what you've described, but it's not cheap - $150 on it's own, or $899 for the full Trapcode Suite.

0

You can do it for free using VEED.IO, this video explains how to do it (Disclaimer, I am the developer of VEED.IO)

2
  • You need to disclaim your ownership of this program, since it's illegal promotion otherwise. Sep 4, 2020 at 15:01
  • 1
    Thank you @FlorianClaaßen, I have now added it. Sep 4, 2020 at 15:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.