Answers.Body: <p>Use</p>
  
  <p><code>ffmpeg -y -i music.mp3 -loop 1 -i image -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuva420p,split=2[w][b];[b]format=yuv420p,drawbox=c=blue:t=fill[b];[b][w]overlay[wv];[1:v][wv]overlay=0:200:shortest=1[outv]" -map "[outv]" -pix_fmt yuv420p -map 0:a -c:v libx264 -c:a copy output_bg.mp4</code></p>
  
  <p>The showwaves will make the background transparent if the filter can output to a frame format with alpha. <code>yuv420p</code> does not have alpha, so the value of the format filter should be changed to a format that does, like <code>yuva420p</code>. Then this picture is cloned; one copy is made opaque and has a color drawn on it. The other copy with the transparent BG is overlaid on top. Finally, this result is overlaid on the image.</p>
  
  <p>It's better to limit the video stream within the overlay filter, if possible. So, <code>-shortest</code> removed.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-04T14:31:37.980Z
Answers.Text: thanks for the script but  running it, gives the following error :-Stream specifier 'v' in filtergraph description [0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuva420p,split=2[w][b];[b]format=yuv420p,drawbox=c=blue:t=fill[b];[b][v]overlay[wv];[1:v][wv]overlay=0:200:shortest=1[outv] matches no streams.
Answers.UserDisplayName: srt111
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T11:56:13.717Z
Answers.LastActivityDate: 2019-03-04T14:55:38.847Z
Answers.LastEditDate: 2019-03-04T14:55:38.847Z
Answers.UserDisplayName: Gyan
Body: <p>There is a padding (default black) under the audio visualiser in the script below ,how could one change the color of this padding ? 
  <a href="https://i.sstatic.net/IWUDx.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IWUDx.jpg" alt="enter image description here"></a>I tried adding option "overlay :colors= Blue" but received an error= "Option 'colors' not found" </p>
  
  <blockquote>
    <p>fmpeg -y -i music.mp3 -loop 1 -i whiteImage.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuv420p[v];[1:v][v]overlay=0:200[outv]" -map "[outv]" -pix_fmt yuv420p -map 0:a -c:v libx264 -c:a copy -shortest output_bg.mp4</p>
  </blockquote>
  
Tags: <ffmpeg>
Title: FFmpeg change overlay color (with audiovisualiser)
UserDisplayName: srt111
ThreadText: # FFmpeg change overlay color (with audiovisualiser)
  
  (Asked by: username_0 on 2019-02-14)
  
  There is a padding (default black) under the audio visualiser in the script below ,how could one change the color of this padding ?
  [![enter image description here](https://i.sstatic.net/IWUDx.jpg)](https://i.sstatic.net/IWUDx.jpg)I tried adding option "overlay :colors= Blue" but received an error= "Option 'colors' not found"
  
  > fmpeg -y -i music.mp3 -loop 1 -i whiteImage.jpg -filter\_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuv420p[v];[1:v][v]overlay=0:200[outv]" -map "[outv]" -pix\_fmt yuv420p -map 0:a -c:v libx264 -c:a copy -shortest output\_bg.mp4
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-14. Score: 1
  
  Use
  
  `ffmpeg -y -i music.mp3 -loop 1 -i image -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuva420p,split=2[w][b];[b]format=yuv420p,drawbox=c=blue:t=fill[b];[b][w]overlay[wv];[1:v][wv]overlay=0:200:shortest=1[outv]" -map "[outv]" -pix_fmt yuv420p -map 0:a -c:v libx264 -c:a copy output_bg.mp4`
  
  The showwaves will make the background transparent if the filter can output to a frame format with alpha. `yuv420p` does not have alpha, so the value of the format filter should be changed to a format that does, like `yuva420p`. Then this picture is cloned; one copy is made opaque and has a color drawn on it. The other copy with the transparent BG is overlaid on top. Finally, this result is overlaid on the image.
  
  It's better to limit the video stream within the overlay filter, if possible. So, `-shortest` removed.
  
  > **Comments:**
  > **username_0**: thanks for the script but  running it, gives the following error :-Stream specifier 'v' in filtergraph description [0:a]showwaves=s=1280x175:colors=Red:mode=p2p,format=yuva420p,split=2[w][b];[b]format=yuv420p,drawbox=c=blue:t=fill[b];[b][v]overlay[wv];[1:v][wv]overlay=0:200:shortest=1[outv] matches no streams.  
  
  ---
  
  