【问题标题】:ffmpeg transparent waveform and solid backgroundffmpeg 透明波形和纯色背景
【发布时间】:2018-04-06 06:31:14
【问题描述】:

我正在尝试创建具有透明波和纯色背景颜色的波形图像。我在这里找到了类似的主题:

FFMPEG waveform transparent, background solid color

但答案对我不起作用:( 也许你知道为什么这段代码会在控制台命令中暂停程序。

ffmpeg -i input.mp3 -filter_complex \    "[0:a]aformat=channel_layouts=mono,compand=gain=-6, \
    showwavespic=s=600x120:colors=white,negate[a]; \
    color=red:600x120[c]; \
    [c][a]alphamerge"  -vframes 1 output.png

【问题讨论】:

  • 共享完整的控制台输出。
  • 这里:prnt.sc/j1le2x 并且程序停止在线“编码器:Lavc57.107.100 png”我试图将颜色从蓝色变为白色,但效果相同。但是作者的原始主题代码正在运行,但有黑色
  • 波形颜色必须为白色,因为它将用于 Alpha 通道。无论如何,在另一台机器上尝试另一个 mp3。
  • 我不是编码员,只是一个业余爱好者,但我相信你想要的可以通过几个命令来完成。如果您可以使用 Windows 批处理文件,我可以为您提供我的工作解决方案。
  • 该命令在安装了 ffmpeg 工具的 linux (debian) 和 windows 10 机器上不起作用:( 我必须在 linux 系统上生成这样的波形。

标签: ffmpeg transparent waveform


【解决方案1】:

好的,所以最后我分三步完成

首先在纯色背景上生成黑色波形:

ffmpeg -y -i test.mp3 -f lavfi -i color=s=600x240:c=red -filter_complex "[0:a]showwavespic=s=600x240:colors=#000000[fg];[1:v][fg]overlay=format=rgb" -frames:v 1 output.png

我们可以使用其他背景颜色(十六进制),例如 c:0xC7C7C7 和下一个可爱的黑色 wafevorm

ffmpeg -y -i output.png -vf colorkey=0x000000:0.6:0.2 Finished.png

并删除临时文件

rm output.png

谢谢大家的帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-22
    • 2014-04-29
    • 2015-04-25
    • 2016-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多