Page 1 of 1

showspectrumpic and background color

Posted: Tue Jun 11, 2019 7:54 am
by gotostereo
Hello. How i can change background color from output image? Format image is PNG! I didn't see info in official doc. I think that this parameter needed. :(

Re: showspectrumpic and background color

Posted: Mon Jul 01, 2019 7:15 pm
by pandy
I don't understand your question, try to rephrase your question. Perhaps simple steps or some picture, provide your script code etc.

Re: showspectrumpic and background color

Posted: Wed Jul 10, 2019 11:06 am
by gotostereo
Okey, example
this result
ffmpeg -i 123.wav -lavfi showspectrumpic=s=1000x500:color=6:scale=log:win_func=hann:legend=disable image-out.png
Y1lXfLvxovh7t.png
Y1lXfLvxovh7t.png (88.75 KiB) Viewed 350 times
background color black, i need white color or without color

format png has alpha channel, pse-example
backgroundColor=rgba(0,0,0,0)

maybe for many this not no matter, but i need this parameter

Re: showspectrumpic and background color

Posted: Wed Jul 10, 2019 1:49 pm
by richardpl
Consider donating to FFmpeg for this addition.

Re: showspectrumpic and background color

Posted: Wed Jul 10, 2019 6:12 pm
by Djketley
Could you not invert the image i know your other colours will change but it's a way around it

Re: showspectrumpic and background color

Posted: Wed Jul 10, 2019 7:06 pm
by pandy
Black as transparent and overlay on top white field (but spectrum "fringes" may have bleed to black i.e. not nicely looking on white). Had similar problem in past trying to overlay transparently oscilogram - cli is probably suboptimal and poor but works for me and may works for you:

Code: Select all

@set name=%1

@ffplay -loop 0 -color_range 1 -f lavfi "amovie=%name%,asplit=2[out1],compand,showwaves=split_channels=1:s=1920x128:mode=p2p:colors=0x8888FF|0xFF8888:n=1:draw=full,colorkey=0x000000:1/96:1/4,scale=w=iw/4:h=ih[wfm];movie=%name%,hqdn3d=9,tmix=frames=6:weights='.004 .012 .037 .111 .333 1'[vout];[vout][wfm]overlay=(W-w)/2:((H-h)/4)*3:format=auto,scale=w=iw:h=-2[out0]" -color_range 2