[Libav-user] Questions with avf_showspectrum.c
Clément Bœsch
u at pkh.me
Thu May 15 09:05:33 CEST 2014
On Wed, May 14, 2014 at 06:54:45PM -0700, Ricky Huang wrote:
> Hello all,
>
> I am currently examining avf_showspectrum.c and I have a few questions that I am hoping you guys can clarify for me:
>
> (This is the command I am running, BTW: ./ffmpeg -i input.mp3 -filter_complex showspectrum=mode=separate:color=intensity:slide=0:scale=cbrt -y output.avi)
>
> 1) First it is about the output: I am assuming the plotted image has time horizontally, the frequency range vertically, and the intensity of color as the amplitude. Is that correct?
>
Yes
> 2) In plot_spectrum_column() function, the code copies some amount of the data to the rdft_data:
> > s->rdft_data[ch][start + n] = p[n] * s->window_func_lut[start + n];
>
> and then performs a av_rdft_calc() on the data. But it's never clear the s->rdft_data array, does this mean the plot is cumulative over time?
>
see s->filled, which represents the amount of data loaded in rdft_data. It
doesn't need to be cleared, the buffer content will be replaced, and when
it's fully replaced a new av_rdft_calc() will occur. Every sample will be
used only once, no accumulation.
>
> Thanks in advance.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140515/b66ad11a/attachment.asc>
More information about the Libav-user
mailing list