Lichtung
Lichtung

Reputation: 131

Is it possible to vertically rotate a showwaves (or showfreqs) overlay using ffmpeg?

I wish to take a showwaves (or showfreqs) overlay and center it vertically using ffmpeg, e.g.

ffmpeg -i input.mp3 -filter_complex "[0:a]showspectrum=color=fiery:saturation=2:slide=scroll:scale=log:win_func=gauss:overlap=1:s=960x1080,pad=1920:1080[vs]; [0:a]showspectrum=color=fiery:saturation=2:slide=rscroll:scale=log:win_func=gauss:overlap=1:s=960x1080[ss]; [0:a]showwaves=s=1920x540:colors=B80000|950000|690000:mode=p2p,inflate[sw]; [vs][ss]overlay=w[out]; [out][sw]overlay=0:(H-h)/2[out]" -map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy output.mkv

enter image description here

As shown above, the showwaves output is centered horizontally. But would it also be possible to have it centered vertically? Specifically, using a single -filter_complex command argument?

I've looked through the ffmpeg manual and searched stackoverflow for an answer, but to no avail.

Upvotes: 1

Views: 269

Answers (1)

Gyan
Gyan

Reputation: 93201

Use the transpose filter.

ffmpeg -i input.mp3 -filter_complex "[0:a]showspectrum=color=fiery:saturation=2:slide=scroll:scale=log:win_func=gauss:overlap=1:s=960x1080,pad=1920:1080[vs]; [0:a]showspectrum=color=fiery:saturation=2:slide=rscroll:scale=log:win_func=gauss:overlap=1:s=960x1080[ss]; [0:a]showwaves=s=1080x540:colors=B80000|950000|690000:mode=p2p,inflate,transpose=cclock[sw]; [vs][ss]overlay=w[out]; [out][sw]overlay=(W-w)/2:0[out]" -map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy output.mkv

Upvotes: 2

Related Questions