Skip to content

Instantly share code, notes, and snippets.

@MatthewCallis
Created April 30, 2022 01:31
Show Gist options
  • Save MatthewCallis/8b947955bbcca0652b8810d8b6930004 to your computer and use it in GitHub Desktop.
Save MatthewCallis/8b947955bbcca0652b8810d8b6930004 to your computer and use it in GitHub Desktop.
Use FFMPEG to generate video for audio
# Game of Life
ffmpeg -i audio.wav \
-vsync vfr -filter_complex "life=size=1920x1554:mold=10:rate=60:random_fill_ratio=0.1:death_color=#ff32ff:life_color=#33feff[left]; \
[0:a]showspectrum=mode=separate:slide=scroll:color=rainbow:scale=cbrt:size=1920x1554[right]; \
[0:a]showwaves=size=3840x606:mode=p2p:rate=30:colors=0xff32ff|0x33feff[bottom]; \
[left][right]hstack[top]; \
[top][bottom]vstack[out]" -map "[out]" -map 0:a -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 384k -r 48000 -shortest -movflags +faststart -threads 0
# Cellauto
ffmpeg -i audio.wav \
-vsync vfr -filter_complex "cellauto=rule=110:rate=30:size=1920x1554[left]; \
[0:a]showspectrum=mode=separate:slide=scroll:color=moreland:scale=cbrt:size=1920x1554[right]; \
[0:a]showwaves=size=3840x606:mode=p2p:rate=30:colors=0xff32ff|0x33feff[bottom]; \
[left][right]hstack[top]; \
[top][bottom]vstack[out]" -map "[out]" -map 0:a -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 384k -r 48000 -shortest -movflags +faststart -threads 0
# Mandelbrot
ffmpeg -i audio.wav \
-vsync vfr -filter_complex "mandelbrot=inner=period:rate=30:size=1920x1554[left]; \
[0:a]showspectrum=mode=separate:slide=scroll:color=nebulae:scale=cbrt:size=1920x1554[right]; \
[0:a]showwaves=size=3840x606:mode=p2p:rate=30:colors=0xff32ff|0x33feff[bottom]; \
[left][right]hstack[top]; \
[top][bottom]vstack[out]" -map "[out]" -map 0:a -c:v libx264 -profile:v high -bf 2 -g 30 -crf 18 -pix_fmt yuv420p -c:a aac -b:a 384k -r 48000 -shortest -movflags +faststart -threads 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment