Opened 3 years ago

Closed 3 years ago

Last modified 17 months ago

#9461 closed defect (worksforme)

Showpectrumpic: scale doesn't work anymore

Reported by: RKleinert Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by RKleinert)

Summary of the bug:

In https://trac.ffmpeg.org/ticket/8919 I had adressed a bug that would mess up the scaling of the frequency-axis in showspectrum() and showspectrumpic() when choosing a starting-frequency that is not zero. This bug is now supposedly fixed.

Now after the fix Showspectrum() seems to work just fine. On the other hand showspectrumpic() won't work anymore at all when used with my prevousily used arguments. Especialy defining an output size (which is crucial) seems to lead to a never ending loop where ffmepg doesn't get anywhere. My batch-script doesn't end and no output is written.

Secondly I noticed, that the argument "legend" doesn't default to 0 (as it states in the doc) but to 1 - so the legend and axes are always enabled if not actively disabled.

How to reproduce:

The 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

leads into an endless loop. Whereas the code without the size-argument:

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

does the trick (although it takes quite some time to run)

ffmpeg version 2021-10-18-git-d04c005021-full
built from gyan.dev

I supplied the input.wav file which is a test-sample with a 1kHz-Sinewave

Attachments (1)

input.wav (864.1 KB ) - added by RKleinert 3 years ago.
1kHz-Sinewave for testing

Download all attachments as: .zip

Change History (7)

by RKleinert, 3 years ago

Attachment: input.wav added

1kHz-Sinewave for testing

comment:1 by RKleinert, 3 years ago

Description: modified (diff)
Summary: Showpectrum scale doesn't work anymoreShowpectrumpic: scale doesn't work anymore

comment:2 by Elon Musk, 3 years ago

It still works just fine, just no longer trims upper frequencies if user have supplied non power of 2 height or width (for vertical orientation).

Contrary to your claims, it does not loop forever, it just executes really slow because of current very slow and naive fft implementation for sizes you set.

in reply to:  2 comment:3 by RKleinert, 3 years ago

Replying to Elon Musk:

It still works just fine, just no longer trims upper frequencies if user have supplied non power of 2 height or width (for vertical orientation).

Contrary to your claims, it does not loop forever, it just executes really slow because of current very slow and naive fft implementation for sizes you set.

Thanks for your quick reply. As I don't really have insight in the workings of the function could you tell me, which sizes would work and which won't? So far I've gotten it to work with 1024x768 for instance. 1000x768 works as well, but 1024x700 doesn't. So it works with a height of 768 but not 700 although 768 is not a power of 2.

Last edited 3 years ago by RKleinert (previous) (diff)

comment:4 by Elon Musk, 3 years ago

It works for width you set, not for output width with included legend pad.

comment:5 by RKleinert, 3 years ago

Resolution: worksforme
Status: newclosed

comment:6 by Elon Musk, 17 months ago

Speed for sizes other than power of 2 have dramatically improved in latest git version.
Also there is new filter, showcwt that supports log and other scales natively.

Note: See TracTickets for help on using tickets.