You have several options here:
Option 1: Use &&
In Bash you can use an and list to concatenate commands. Each command will be executed one after the other. The and list will terminate when a command fails, or when all commands have been successfully executed.
ffmpeg -i audio.mp3 audio.wav && wav2png -o output.png audio.wav
Using -acodec libmp3lame
when outputting to WAV makes no sense, so I removed that.
WAV ignores bitrate options, so I removed -ab
.
Do you really need to change the audio rate (-ar
)? Removed.
Option 2: Pipe from ffmpeg
to wav2png
Instead of making a temporary WAV file you can pipe the output from ffmpeg
directly to wav2png
:
ffmpeg -i audio.mp3 -f wav - | wav2png -o output.png /dev/stdin
Option 3: Just use ffmpeg
Saving the best for last, you can try the showwavespic filter.

ffmpeg -i music.wav -filter_complex showwavespic=s=640x320 showwaves.png