Roemer
Roemer

Reputation: 2241

Select audio track to use when generating a waveform image

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

Answers (1)

Anonymous Coward
Anonymous Coward

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

Related Questions