Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG Waveform with specific color

Tags:

ffmpeg

looking to get a waveform from an input that is this specific gold color #ad9557 (173/255, 149/255, 87/255) and have a transparent background / or black if not possible.

I'm currently using this script to generate it:

command = new String[]{
                "-i", mRapFile.getAbsolutePath(),
                "-filter_complex",
                "showwavespic",
                "-frames:v",
                "1",
                mWaveFormFile.getAbsolutePath()};

The waveform is there but is a weird orange color now. How can I change this?

Thank you!

like image 919
Jeremy Avatar asked Oct 17 '16 17:10

Jeremy


1 Answers

enter image description here

Use the colors option in showwavespic filter:

ffmpeg -i input -filter_complex "aformat=channel_layouts=mono,showwavespic=colors=#ad9557" -frames:v 1 output.png

I had to make some assumptions because you did not include the complete console output from your command:

  • Your ffmpeg may be too old for the colors option. See FFmpeg Download page for links to up-to-date already compiled binaries for Linux, OS X, and Windows.

  • I don't know the channel layout of your input(s). I added aformat to make mono audio: otherwise all of the channels would be different colors and you would have to specify the color for each. Default is red|green|blue|yellow|orange|lime|pink|magenta|brown

like image 51
llogan Avatar answered Nov 09 '22 11:11

llogan