I'm trying to normalize about 2K mp3 audio files while maintaining my id3 info? Currently, I have to turn my radio volume up and down with just about each song. I am looking to normalize them so the volume in the car stays close to constant.
I found the command; https://trac.ffmpeg.org/wiki/AudioVolume
Code: Select all
ffmpeg -i test.mp3 -af "volumedetect" -vn -sn -dn -f null /dev/null
Code: Select all
[Parsed_volumedetect_0 @ 0x7f8ba1c121a0] max_volume: -5.0 dB
Code: Select all
ffmpeg -i test.mp3 -af "volume=5dB" testR.mp3
However, I have over 2K files so am looking to do them batch style. Everything I've found including ffmpeg-normalize seems to remove the jpg or won't normalize the max_volume to 0db (or even a consistent rms value).
I found a script that supposedly can be run as a bash script (normalize.sh) but I have no idea how to modify it to work for my purposes. Or how to put it in a bash file to execute it???
Code: Select all
# Detect the max volume from this command
ffmpeg -y -i "$1/$2" -af "volumedetect" -an -vn -y -f null /dev/null
# Re-encode audio with this command after setting the DB level and output file name
ffmpeg -y -i "$1/$2" -af "volume=`echo $sDBLevel`dB" -c:a libmp3lame -b:a 128k "$sOutputFileName"
normalize them to 0db (or even a decent RMS level) and output a mp3 file with the same name to /jazz2 maintaining all the id3 tag info. Can someone help me please? Or point me to a good place for ffmpeg help? I'm sure I'm not the first one to cross this bridge, help me please...