#8919 closed defect (fixed)
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 (3)
Change History (9)
by , 4 years ago
by , 4 years ago
Attachment: | output.png added |
---|
Result with the attached testfile and the code-example provided in the description
comment:1 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 3 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
We've just revied the function in the current version of ffmpeg (2021-10-18-git-d04c005021-full) and I have to report that the issue is still nox fixed.
Choosing frequencies from 500 to 20000 Hz in my example the ration between two steps on the y-axis starts at around 1.4 at max. values and steadyly decreases to round about 1 at the bottom of the axis.
by , 3 years ago
Attachment: | 1khz_spectrumpic_1024x768.png added |
---|
output with start=500 and stop =20000, y-axis scaling still not fixed
comment:3 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
You are not using log scale.
follow-up: 6 comment:5 by , 3 years ago
The frequency log scale axis matches the spectrum output.
What you want would make high spectrum content not displayed at all.
Imagining you want: 0.1 1 10 100 1000 scale.
comment:6 by , 3 years ago
Replying to Elon Musk:
The frequency log scale axis matches the spectrum output.
What you want would make high spectrum content not displayed at all.
Imagining you want: 0.1 1 10 100 1000 scale.
Yes, that is what I would understand as a log-scaled y-axis.
Testfile I used to create the attached output-file