我实际上使用此shell代码在FFMPEG背景图像上生成带有黑色波形的视频:
ffmpeg -y -i $local_mp3 -loop 1 -i $local_image -filter_complex "[0:a]showwaves=s=1280x720:mode=line,colorkey=0x000000:0.01:0.1,format=yuva420p[v];[1:v][v]overlay[outv]" -map "[outv]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -profile:v main -level 4.0 -acodec aac -strict -2 -shortest -movflags +faststart output.mp4
我只想看看如何为波形赋予不同的颜色。我尝试了很多,几十年后我仍然坚持下去:)
答案 0 :(得分:3)
使用
ffmpeg -y -i $local_mp3 -loop 1 -i $local_image -filter_complex "[0:a]showwaves=s=1280x720:mode=line:colors=black,colorkey=0x000000:0.01:0.1,format=yuva420p[v];[1:v][v]overlay[outv]" -map "[outv]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -profile:v main -level 4.0 -acodec aac -shortest -movflags +faststart output.mp4
请参阅showwaves过滤器的文档:https://ffmpeg.org/ffmpeg-filters.html#showwaves