How to change the audio sample rate using FFmpeg?

I have a lossy AAC audio file and I would like it to be high quality while still keeping the lossy encoding. Is there any way I can change the sample rate of the audio file using FFmpeg?

Hey Komal,

FFmpeg provides the -ar option to change the audio sample rate, you can change the sample rate for your audio file with the following command.

ffmpeg -i input.aac -ar 44100 output.aac

How do I determine the audio rate to use in FFmpeg?

Most likely, 44100 for the audio sample rate and 128 for the bit rate will be adequate.

For examples of sampling rate and audio bit rate settings that are appropriate for what you’re attempting to do, consult Wikipedia.

So, is there a command that I can run immediately to check?

Yes, to find out the sample rate and bitrate of the audio stream in the source video.avi, use ffmpeg -i video.avi

With the same sample rate and bitrate, the audio stream can be retrieved without reducing the quality.

You can choose to decrease one of them to make it smaller, but don’t increase one of them to make it better because you can never improve the original quality.

Personally, for Avi and Mpeg video files, I use the -ar 22050 and -ab 48 switches. It functions normally.