You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows下FFmpeg管道调用GNUPlot生成音频波形无法修改颜色问题

解决方案

你之前的配置失效是因为默认绘图序列调用的是编号为1的linetype,且直接在绘图语句中指定颜色优先级更高、兼容性更好。

推荐写法(直接在绘图命令中指定颜色)

仅需在原有命令的with lines后追加lc 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 lc rgb '#ff0000';"

你可以替换#ff0000为任意你需要的RGB格式色值。

全局linetype修改写法(如果你需要统一多序列绘图样式)

如果需要通过全局linetype配置生效,将你之前的linetype编号从9改为1即可,无需设置linetype cycle,修改后的完整命令如下:

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; set linetype 1 lc rgb '#ff0000'; plot '-' binary filetype=bin format='%int16' endian=little array=1:0 with lines;"

内容的提问来源于stack exchange,提问作者Jim Dandy BOA

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.28 04:15:02