Convert wav to mp3 file

0
20
No Preview.

If you feel like this example could be improved, you may edit this example here.

ffmpeg -i input.wav -write_id3v1 1 -id3v2_version 3 -dither_method triangular -out_sample_rate 48k -qscale:a 1 output.mp3

4 comments
Anonymous
Markdown is supported
@polygonnedpotato
polygonnedpotatocommentedabout 3 years ago

look sick bro!

@jamescridland
jamescridlandcommented5 months ago

If I understand this website correctly, the dithering command, above, does nothing good when transferring from WAV to MP3. It’s only helpful when changing bit depth of audio.

https://www.waves.com/audio-dithering-what-you-need-to-know

@eladg
eladgcommented5 months ago

@jamescridland
If I understand this website correctly, the dithering command, above, does nothing good when transferring from WAV to MP3. It’s only helpful when changing bit depth of audio.

https://www.waves.com/audio-dithering-what-you-need-to-know

Partially true @jamescridland. Dither is needed when we change sample rate, not bit depth. In the above example it is needed depending on the sample rate of input.wav

From your source:

Dither to the Rescue

The solution is to add dither when you save the file to a lower sampling rate. When dither is added to audio with quantization distortion, it masks it (a process known as "decorrelation"), making it more random and therefore harder for your ears to discern. Instead of sounding harsh and grating, it turns the quantization distortion into a steady, low-level, analog-like hiss.

@jamescridland
jamescridlandcommented5 months ago

Also from the source:

However, if you’re bouncing your mix to a data-compression codec like MP3 or AAC, dithering is not necessary. They’re both formats that introduce artifacts into the signal that dither won’t remedy.

What I'd also say is that this example ought to default to 44.1kHz (the usual samplerate for audio work). But I appreciate that this is sometimes an argument others get rather worked up about!