i’m gonna be the nerd that tries to clarify terminology.
although the term is kinda generic, common usage of “spectrogram” is for an image of the spectrum over time - that is, taking periodic snapshots of the spectrum with a sliding analysis window (STFT), and rendering the result as a heatmap or waterfall (in three dimensions.)
what the OP wants is perhaps most clearly described as a spectrum plot. that is, taking a single DFT of the entire signal and plotting the bin amplitudes (in two dimensions.) this is a less common use case because it really only makes sense for very small slices of time like single waveforms.
ffmpeg only produces spectrograms.
i’m afraid i can’t think of an accessible, batchable tool to make spectrum plots of signals. as pointed out, it is an easy thing to code up in any environment with access to FFT and bitmap generation libraries. librosa has a builtin function, but it requires NumPy and getting that set up is maybe a little much for the casual python user.
sox stat -freq is close to what you want, but is hardcoded to use a 4096-point DFT. for longer samples it performs repeated DFTs. a shell-only solution could process the [freq, amp] pairs from sox, average the amps if there are multiple windows in the signal, and use imagemagick or similar to build a bitmap.
if you can compile a c/c++ program, i can maybe throw something together, since i happen to be building a frequency scope widget right this very minute.