Reputation: 2241
ffmpeg can draw a waveform with showwavespic
which works fine. But in my case, I have a file with multiple audio tracks and I want to specify which audio track to use to draw the waveform.
The default example is: ffmpeg -i input -filter_complex "showwavespic=s=640x120" -frames:v 1 output.png
I tried to add a map 0:a:0
inbetween but that gives strange ffmpeg errors.
Does anybody know how I can set the track index to use without first extracting the desired audiotrack?
Upvotes: 1
Views: 295
Reputation: 1263
This can be achieved using filtergraph link labels (see https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1) to select the relevant input eg:
ffmpeg -i input -filter_complex "[0:a:6]showwavespic=s=640x240" -frames:v 1 output.png
Upvotes: 3