====== Audio Normalization ======
It may happen that you have downloaded different episodes of the same serie from different sources for various reasons and that the audio levels are not consistent.
This method will ensure you normalize as much as possible the audio levels between your files.
The tool is [[https://pypi.org/project/ffmpeg-normalize/|ffmpeg normalize]] a python script capable of leveraging ffmpeg filters capability.
===== Installation =====
Create a dedicated user, make it part of the **media** group so that it can access your media library:
useradd -d /data/daemons/ffmpeg-normalize -m ffmpeg-normalize -g media
Now, set **umask 0002** in the //.bashrc// of the user
umask 0002
export PATH=/data/daemons/ffmpeg-normalize/.local/bin:$PATH
so that any created files are accessible by the //media// groups, and also you add the bin path for the installation later on.
enable PIP in gentoo for your user ([[gentoo:pip|here]]), put the following file under **/data/daemons/ffmpeg-normalize/.confg/pip/pip.conf**:
[global]
break-system-packages = true
user = true
Then you can install the tool:
su - ffmpeg-normalize
pip install ffmpeg-normalize
==== Usage ====
there! ready to go:
cd /data/Media/
ffmpeg-normalize *.mkv -c:a aac
check [[https://pypi.org/project/ffmpeg-normalize/#detailed-options|here]] and [[https://github.com/slhck/ffmpeg-normalize/wiki/examples|here]] for more information and examples.
this will write all the normalized videos to a subfolder called **normalized** now check them carefully before replacing originals!