[FFmpeg-user] afreqshift

Michael Koch astroelectronic at t-online.de
Wed Oct 21 22:02:20 EEST 2020


Am 21.10.2020 um 20:36 schrieb Paul B Mahol:
> On Wed, Oct 21, 2020 at 08:14:50PM +0200, Michael Koch wrote:
>> Hi,
>>
>> I'm just testing the new afreqshift filter.
>> In my first test I did use only *.wav audio files. This test was successful.
>>
>> In my next test I'm using MP4 files. First I make a test video with a 5kHz
>> tone:
>> ffmpeg -f lavfi -i sine=f=5000:r=48000:d=5 -f lavfi -i color=black -lavfi
>> showspectrum=legend=1 -y test.mp4
>>
>> Now I try to shift the frequency down by 4kHz:
>> ffmpeg -i test.mp4 -lavfi afreqshift=-4000,showspectrum=legend=1 -y out.mp4
>>
>> The spectrum display is showing the expected 1kHz, but what I hear is 5kHz.
>> What's wrong with my command line? Why is the output of the afreqshift
>> filter not mapped to the output file?
>>
> Something like this:
>
> ffmpeg -i test.mp4 -lavfi "asplit=2[a][b],[b]afreqshift=-4000,showspectrum=legend=1[b]" -map "[a]" -map "[b]" -y out.mp4
>
> You ignored fact that showspectrum is just A->V filter.

That did also not work, the audio output is 5kHz. But thanks for 
pointing me in the right direction. The asplit filter must be after the 
afreqshift filter. This works:

ffmpeg -i test.mp4 -lavfi 
afreqshift=-4000,asplit[a][b];[b]showspectrum=legend=1 -map "[a]" -y 
out.mp4

Thanks,
Michael



More information about the ffmpeg-user mailing list