【问题标题】:FFMpeg Piped GNUPlot Audio Waveform, "Can't Change Waveform Color" (Windows)FFMpeg 管道 GNUPlot 音频波形,“无法更改波形颜色”(Windows)
【发布时间】:2021-10-28 21:17:30
【问题描述】:

我花了几天时间尝试更改命令行 Gnuplot 部分中的默认波形颜色,但没有成功。这是完美运行的代码,它在透明背景上输出紫色音频波形。我希望能够将紫色更改为 RGB 颜色(即“#ff0000”格式)。

ffmpeg -y -i "Traveling Man.mp3" -ac 1 -filter:a aresample=8000 -map 0:a -c:a pcm_s16le -f data - | gnuplot -p -e "set terminal png size 1000,250; set output 'waveform.png'; unset key;  set term png transparent truecolor; unset tics; unset border; set lmargin 0; set rmargin 0; set tmargin 0; set bmargin 0; plot '-' binary filetype=bin format='%int16' endian=little array=1:0 with lines;"

我已尝试添加:

set linetype 9 lc rgb '0000ff'; set linetype cycle 9;

到各个地方的命令行,它要么抛出错误,要么在透明时输出紫色。

这必须非常简单,我似乎无法理解它,因为文档没有显示任何有用的命令行示例。欢迎任何想法,谢谢。

【问题讨论】:

    标签: audio ffmpeg colors gnuplot waveform


    【解决方案1】:

    您可以通过明确指定来更改每个图的颜色。对于示例中的“线条”样式,您可以通过在“带线条”之后添加“lc rgb '#ff0000'”来指定线条颜色。修改后的绘图命令将如下所示。

    plot '-' binary filetype=bin format='%int16' endian=little array=1:0 with lines lc rgb '#ff0000';
    

    您可以通过在 gnuplot 提示符下键入以下帮助命令来更详细地控制每个绘图的样式。

    gnuplot> help plot with
    

    【讨论】:

    • 非常感谢宾佐!那完美的伎俩,我知道这将是一件简单的事情。再次感谢。
    • @JimDandyBOA 请不要忘记“接受”这是正确的答案,如果它完成了这项工作。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-09
    • 2017-07-08
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多