我希望采取showwaves
(或showfreqs
)覆盖,并使用FFMPEG垂直居中,例如
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
如上所示,showwaves
输出水平居中。然而这也有可能把它垂直居中?具体地,使用一个单一的-filter_complex
命令参数?
我已经通过FFmpeg用户手册看起来并搜查计算器的答案,但无济于事。
使用转置过滤器。
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