[FFmpeg-devel] [PATCH] avfilter: add apitch filter

Marton Balint cus at passwd.hu
Sat May 18 20:25:07 EEST 2019



On Wed, 15 May 2019, Paul B Mahol wrote:

> On 5/12/19, Paul B Mahol <onemda at gmail.com> wrote:
>> On 5/12/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
>>> On Sun, May 12, 2019 at 11:00:51PM +0200, Nicolas George wrote:
>>>> Marton Balint (12019-05-12):
>>>> > Yeah, you are right, what I had in mind was this:
>>>> >
>>>> > apitch  ===  asetrate,aresample,atempo
>>>>
>>>> Exactly. And reciprocally, atempo = apitch+asetrate+aresample.
>>>>
>>>> Furthermore, since it works with the spectrum, the filter that does the
>>>> hard work can probably easily output at any sample rate, at a cost much
>>>> lower than resampling afterwards. Therefore, it makes most sense to have
>>>> a single filter with all three parameters (sample rate, speed adjustment
>>>> and pitch adjustment).
>>>
>>> and if thats done in our resampler than that can also be combined with
>>> changing the channel order, layout, sample type and so on.
>>> Iam not sure its a good idea but purely technically it should be more
>>> efficient to do it all together.
>>> Also swresample already supports an external FFT resampler so it might
>>> actually fit in there nicely and it might even allow us to remove an
>>> external
>>> dependancy without loosing a feature. (assuming the new FFT resampler
>>> would be equally good)
>>>
>>>
>>
>> To make it work dynamically, filter must resample audio internally.
>>
>
> Can I get testers?

It indeed sounds better for high and low speeds. For ~1 speeds there 
are some issues. I did a bit of testing with tempo=1.1 for file 
fate-suite/dts/dts.ts:

- the filter is changing loudness significantly (+1.8 dB).
- apitch generates 17 ms longer file than atempo
- apitch fades in audio from silence
- there is a noticable spectral difference, especially
   when the guitar play starts, or at the end.

The attached image shows the spectogram of the first audio channel. First 
row is the original, second is classic atempo filter, third is 
apitch=atempo=1.1.

Regards,
Marton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atempo.png
Type: image/png
Size: 224501 bytes
Desc: 
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190518/33f6f949/attachment.png>


More information about the ffmpeg-devel mailing list