Opened 7 months ago

#8919 new defect

Setting 'fscale=log' together w/ 'start>0' will mess up the scaling of the y-axis in showspectrum(pic)

Reported by: RKleinert Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: showspectrum, showspectrumpic
Cc: r.kleinert@unfallforensik.de Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

In the 'showspectrum' and 'showspectrumpic'-functions you can choose to scale the y-axis (frequencies) either linear or logarithmic (parameter 'fscale'). Also you can define the range of the y-axis (parameters 'start' and 'stop'). If you choose logarithmic scaling and start at y=0Hz ('start=0') the y-axis is scaled correctly; i.e. the proportions from one mark on the axis to the next in equal distances stays constant. If you however choose anything else than 'start=0' the scaling is entirely wrong. The ratio between the individual, equidistant marks on the y-axis will start somewhere above 2 at the higher values and decrease to 1 further down at the bottom of the axis.

TL;DR:

Setting parameter 'fscale=log' together with 'start>0'will mess up the scaling of the y-axis in showspectrum(pic)

How to reproduce:

The exact way of calling the function doesn't seem to matter. It's just about the situation explained above. I used this example to verify:

Sample Code:

ffmpeg -i input.wav -filter_complex "showspectrumpic=size=700x400:mode=combined:color=rainbow:scale=sqrt:fscale=log:legend=1:start=500:stop=20000" output.png

Attachments (2)

input.wav (864.1 KB ) - added by RKleinert 7 months ago.
Testfile I used to create the attached output-file
output.png (62.1 KB ) - added by RKleinert 7 months ago.
Result with the attached testfile and the code-example provided in the description

Download all attachments as: .zip

Change History (2)

by RKleinert, 7 months ago

Attachment: input.wav added

Testfile I used to create the attached output-file

by RKleinert, 7 months ago

Attachment: output.png added

Result with the attached testfile and the code-example provided in the description

Note: See TracTickets for help on using tickets.