[FFmpeg-user] Conversion and Down sampling of ".Wav" to ".mp3"

Richard Bartczak richard.bartczak at gmx.de
Wed May 28 04:27:20 EEST 2025


Am 28.05.25 um 00:49 schrieb Connor Grooms:
> Hello,
>
> I am currently working on converting a large number of files from wav (Max freq 64000 Hz) to mp3 (max Freq 48000 Hz).
>
> My current call is:
>
> ffmpeg -i "INPUTFILENAME.WAV" -af "aresample=resampler=soxr:precision=33" -q:a 2 -ar 48000 -first_pts 0 "OUTPUTFILENAME.mp3"
>
> Also without the "first_pts 0" call I was noticing that there was a taper of the waveform amplitude at the start and end of the output files.
>
> I want to use the full dynamic range of the file and each file has a varying maximum sound levels.
>
> I have investigated ffmpeg-normalize however it seem to cause artifacts in the mp3 files over the last 3 seconds where the file is repetitively clipped in 0.1 second intervals.
>
> Normalizing a file to the maximum recorded level seems like a trivial thing to do with ffmpeg... am I missing something obvious. Any ideas or assistance are welcome.
>
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

Normalization of audio, please refer to 
https://k.ylo.ph/2016/04/04/loudnorm.html/. /I use for a lot of files 
single-pass mode for single movies dual-pass mode. Both with acceptable 
results.

This script is also usefull, to read source file parameter (bit=) and 
set the same value as input for encoding (-ab ${bit}k) :

#!/bin/sh
for f in ../*.mp3; do
     bit=`ffmpeg -i "$f" 2>&1 | grep Audio | awk -F", " '{print $5}' | 
cut -d' ' -f1`
    ffmpeg -i "$f" -af loudnorm=I=-16:TP=-1.5:LRA=11 -ab ${bit}k -ar 48k 
"$(basename "$f" .mp3).mp3";
done

This script : mp3 to mp3, same file name, therefore the sources are in 
the directory above. The script will read the bitrate of the sources and 
set the same bitrate for output.

Best regards

Richard


More information about the ffmpeg-user mailing list