[FFmpeg-user] Selecting colors of the waveform

Michael Koch astroelectronic at t-online.de
Fri Mar 10 10:00:28 EET 2023


Am 10.03.2023 um 06:01 schrieb Marcin Borkowski:
> On 2023-03-08, at 19:15, Michael Koch <astroelectronic at t-online.de> wrote:
>
>> Am 08.03.2023 um 18:48 schrieb Marcin Borkowski:
>>> Hi all,
>>>
>>> I'm fairly new to ffmpeg, so sorry, if this is something obvious.  (I'd
>>> also appreciate any pointers to the docs - I haven't read them all, of
>>> course, but I _did_ try to find the answer to my questions there.)
>>>
>>> I know that I can create a bitmap with the waveform of a selected part
>>> of a media file and send it to stdout like this:
>>>
>>> ffmpeg -ss 00:10 -to 00:11 -i file.mp4 -filter_complex showwavespic=s=600x40 -frames:v 1 -f image2 -
>>>
>>> Now the question is, how do I change the colors (background and
>>> foreground)?  I already know about `:colors=white' for the foreground,
>>> but how about the background?
>> It seems this filter has no option for changing the black background.
>> If you need white background, you could simply invert the output video
>> with "negate" filter.
>> For other colors you could use a workaround with "colorkey" and
>> "overlay" filters.
> Thanks.  I used `showwavespic=s=600x40:colors=white,negate` which
> helped, though now I can't really change the _white_ background to
> e.g. light grey;-).  I think I'll not try to use `overlay` -- the docs
> imply that it is a bit too complex for a beginner like me

see the example in chapter 2.89 in
http://www.astro-electronic.de/FFmpeg_Book.pdf

Michael



More information about the ffmpeg-user mailing list