Search code examples
phpffmpegffmpeg-php

How to change the size of audio visualisers in ffmpeg?


I have this command in ffmpeg:

echo shell_exec("$ffmpeg  -i test.aiff -y -filter_complex '[0:a]showfreqs=s=1920x1080:mode=bar:ascale=log:fscale=lin:win_size=w1024:win_func=poisson:colors=blue,format=yuv420p[v]' -map '[v]' -map 0:a output2.mp4 2>&1");

I want to make it so that the video dimensions are still 1080p but the showfreqs graph is squashed and located near the bottom of the screen. How do I do this? Thanks.


Solution

  • You would have to create it in the smaller size and pad your way to 1080p.

    ffmpeg  -i test.aiff -y -filter_complex 
        '[0:a]showfreqs=s=1920x300:mode=bar....colors=blue,
              pad=1920:1080:0:oh-ih,format=yuv420p[v]'
        -map '[v]' -map 0:a output2.mp4 2>&1