user24346: The code below runs a perfect red audiovisualizer when run on a “black” colored background. But when used with any other colored jpg image the visualizer just doesn't show up. What's missing? 
ffmpeg -y -i music.mp3 -loop 1 -i black.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




user1760: ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[v];[1:v][v]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4


Remove the format filter after showwaves.
Use format=auto in the overlay filter.
Do all of the filtering within the filtergraph, so remove -pix_fmt and replace it with the format filter.

If you want image.jpg to fit within a specific size such as 1280x720:
ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[fg];[1:v]scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720,setsar=1[bg];[bg][fg]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4


24346: <p>The code below runs a perfect red audiovisualizer when run on a “black” colored background. But when used with any other colored jpg image the visualizer just doesn't show up. What's missing? </p>

<pre><code>ffmpeg -y -i music.mp3 -loop 1 -i black.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
</code></pre>

<p><a href="https://i.stack.imgur.com/lKCoz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lKCoz.jpg" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/FmKVc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FmKVc.jpg" alt="enter image description here"></a></p>
 1760: <pre><code>ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[v];[1:v][v]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4
</code></pre>

<ul>
<li><p>Remove the <a href="https://ffmpeg.org/ffmpeg-filters.html#format" rel="nofollow noreferrer">format</a> filter after showwaves.</p></li>
<li><p>Use <code>format=auto</code> in the <a href="https://ffmpeg.org/ffmpeg-filters.html#overlay" rel="nofollow noreferrer">overlay</a> filter.</p></li>
<li><p>Do all of the filtering within the filtergraph, so remove <code>-pix_fmt</code> and replace it with the format filter.</p></li>
</ul>

<p>If you want <code>image.jpg</code> to fit within a specific size such as 1280x720:</p>

<pre><code>ffmpeg -i music.mp3 -loop 1 -i image.jpg -filter_complex "[0:a]showwaves=s=1280x175:colors=Red:mode=p2p[fg];[1:v]scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720,setsar=1[bg];[bg][fg]overlay=(W-w)/2:(H-h)/2:format=auto,format=yuv420p[outv]" -map "[outv]" -map 0:a -c:v libx264 -c:a copy -shortest -movflags +faststart output.mp4
</code></pre>
