
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation. My music video collection that I downloaded from youtube has videos of significantly different loudness, so when I watch a selection of videos that suit my mood with mplayer I have to change the system volume every few videos because I get to one that's either too loud or too quiet for the current settings. I'd like to run a script across my video collection to get the average loudness of each video so the mplayer softvol setting can be adjusted to compensate. Then of course I'd do some manual adjustment like increasing the volume of The Divinyls and The Angels. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

On 28/06/17 01:11, Russell Coker via luv-main wrote:
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation.
There is is a "normalize" tool for doing this to audio files: http://normalize.nongnu.org/ It would be nice to extend this to work on video soundtracks. Cheers, Andrew

On 28.06.2017 01:11, Russell Coker via luv-main wrote:
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation.
My music video collection that I downloaded from youtube has videos of significantly different loudness, so when I watch a selection of videos that suit my mood with mplayer I have to change the system volume every few videos because I get to one that's either too loud or too quiet for the current settings.
I'd like to run a script across my video collection to get the average loudness of each video so the mplayer softvol setting can be adjusted to compensate. Then of course I'd do some manual adjustment like increasing the volume of The Divinyls and The Angels.
Vorbisgain sort of does this for ogg files (from the man page)..... Vorbisgain calculates the ReplayGain values for the named Ogg Vorbis input files and writesback the result in the form of tags (comments) in the file. These values can be used by a play-back program to maintain a uniform sound level during play. (See http://www.replaygain.org/ Not very many players support this though, I put this up as it may give any one interested a starting point for further work as it clearly has already been considered an issue. For any music I download, I convert it to an ogg file with Audacity but first use Effect>Amplify to normalise the gain, in order to get a reasonably close range of loudness. I use Audacity rather than one of the converter programs particularly for its Amplify command. Lindsay

On Wed, Jun 28, 2017 at 08:51:08AM +1000, zlinew9@virginbroadband.com.au wrote:
For any music I download, I convert it to an ogg file with Audacity but first use Effect>Amplify to normalise the gain, in order to get a reasonably close range of loudness. I use Audacity rather than one of the converter programs particularly for its Amplify command.
See also python-rgain: Package: python-rgain Source: rgain Version: 1.3.4-1 Installed-Size: 93 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Architecture: all Depends: python-gi, gir1.2-gstreamer-1.0, python-mutagen, gstreamer1.0-plugins-base, gstreamer1.0-plugins-good, python (>= 2.7), python (<< 2.8), python:any (>= 2.6.6-7~) Recommends: gstreamer1.0-plugins-ugly | gstreamer1.0-libav Description-en: Replay Gain volume normalization Python tools This package provides a Python package to calculate the Replay Gain values of audio files and normalize the volume of those files according to the values. Two basic scripts exploiting these capabilities are shipped as well. . Replay Gain is a proposed standard designed to solve the very problem of varying volumes across audio files. Its specifications are available at http://replaygain.org/ . Description-md5: 48f1f68a3520e4a1beab32f395c121b8 Homepage: https://bitbucket.org/fk/rgain/ Section: python Priority: optional Filename: pool/main/r/rgain/python-rgain_1.3.4-1_all.deb Size: 25982 MD5sum: 86fea888aca88affb359b6564477cc4d SHA256: 1cd58c4525d0b70a6c358c655f8e82573a30a2fbbce2d7070028f8b26d4decca I haven't used this, so don't know how well it works. The description sounds useful and relevant. It contains two scripts: 1. replaygain - read, calculate, and write Replay Gain for 1 or more files. works for several formats: ogg, flac, wavpack, mp4, mp3 2. collectiongain - does the same for an entire collection of music, just give it a path rather than filenames. Also, here's a list of packages in debian that mention replay gain somewhere in the package info: $ apt-cache search replay.?gain | awk -F' - ' '{printf "%-25s %s\n", $1, $2}' bs1770gain measure and adjust audio and video sound loudness crip terminal-based ripper/encoder/tagger tool groovebasin music player server with a web-based user interface libebur128-1 implementation of the EBU R128 loudness standard libebur128-dev implementation of the EBU R128 loudness standard (development files) libmpcdec-dev MusePack decoder libreplaygain-dev Calculate ReplayGain information libreplaygain1 Calculate ReplayGain information rhythmbox-plugins plugins for rhythmbox music player soundkonverter audio converter frontend for KDE vorbisgain add Replay Gain volume tags to Ogg Vorbis files bluemindo ergonomic and modern music player designed for audiophiles aacgain Lossless mp4 normalizer with statistical analysis libgrooveloudness4 loudness scanner for libgroove libgrooveloudness-dev loudness scanner sink for libgroove (development files) qmmp Feature-rich audio player with support of many formats python-rgain Replay Gain volume normalization Python tools PS: as is fairly common with python (and gem and ruby and node.js etc) programs, the web page for rgain gives instructions to first install the dependencies with apt-get (unneccessary but not actively harmful), and then cretinously tells you to run an installer script for rgain as root. Don't do that, it's extremely bad advice from programmers who don't care about the operating systems their code is running on, who see the OS as an obstacle to be worked around and trashed rather something to use and work with. Even without any malicious surprises in the installer script, that kind of advice breaks systems. Worse, it's an incredibly bad habit to get into especially for people who actually need instructions like that (they're exactly the people who should NEVER be encouraged to follow unsafe, insecure instructions). Ditto for instructions that do things like tell you pipe the output of wget or curl into a root sh or bash or whatever. Instead, just run 'apt-get install python-rgain'. All the dependencies will be resolved automatically by apt-get. That's its job. craig -- craig sanders <cas@taz.net.au>

Craig Sanders via luv-main <luv-main@luv.asn.au> writes:
See also python-rgain:
Apparently the project is looking for a new maintainer: https://bitbucket.org/fk/rgain -- Brian May <brian@linuxpenguins.xyz> https://linuxpenguins.xyz/brian/

On 28/06/17 01:11, Russell Coker via luv-main wrote:
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation.
My music video collection that I downloaded from youtube has videos of significantly different loudness, so when I watch a selection of videos that suit my mood with mplayer I have to change the system volume every few videos because I get to one that's either too loud or too quiet for the current settings.
I'd like to run a script across my video collection to get the average loudness of each video so the mplayer softvol setting can be adjusted to compensate. Then of course I'd do some manual adjustment like increasing the volume of The Divinyls and The Angels.
hi something like this should do it ------------------------------------------ #!/usr/bin/bash vid=$1 tx=${vid%.*} ffmpeg -i $1 -vn -b:a 256k $tx.mp3 ffmpeg -i $1 -an $tx.mkv normalize $tx.mp3 ffmpeg -i $tx.mkv -i $tx.mp3 $tx.n.mkv rm $tx.mp3 rm $tx.mkv mv $tx.n.mkv $tx.mkv ------------------------------------------ normalize is a package in rpmfusion-free for Fedora users first ffmpeg removes the video next ffmpeg removes the audio final ffmpeg put it back together Steve

Thanks for the suggestion, I will have to investigate that normalise package. But I don't want to rewrite the mp3 or m4a part as they are lossy compression and will lose quality. So I want to get MPlayer to adjust it at playback time. But I might do that for the collection of mp3 and m4a files I have on my phone. My phone speakers don't give the best quality anyway. ;) On 28 June 2017 5:20:07 pm AEST, Steve Roylance via luv-main <luv-main@luv.asn.au> wrote:
On 28/06/17 01:11, Russell Coker via luv-main wrote:
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation.
My music video collection that I downloaded from youtube has videos of significantly different loudness, so when I watch a selection of videos that suit my mood with mplayer I have to change the system volume every few videos because I get to one that's either too loud or too quiet for the current settings.
I'd like to run a script across my video collection to get the average loudness of each video so the mplayer softvol setting can be adjusted to compensate. Then of course I'd do some manual adjustment like increasing the volume of The Divinyls and The Angels.
hi
something like this should do it
------------------------------------------ #!/usr/bin/bash
vid=$1 tx=${vid%.*} ffmpeg -i $1 -vn -b:a 256k $tx.mp3 ffmpeg -i $1 -an $tx.mkv normalize $tx.mp3 ffmpeg -i $tx.mkv -i $tx.mp3 $tx.n.mkv rm $tx.mp3 rm $tx.mkv mv $tx.n.mkv $tx.mkv ------------------------------------------
normalize is a package in rpmfusion-free for Fedora users first ffmpeg removes the video next ffmpeg removes the audio final ffmpeg put it back together
Steve _______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
-- Sent from my Nexus 6P with K-9 Mail.

hi there are many options in ffmpeg including copy stream and most types of file formats if you have the codec ffmpeg -codecs will list what is loaded, my system reports for "ffmpeg -codecs | wc -l" is 421 also the included help "ffmpeg -h full | wc -l" is 8765 there are many web sites devoted to selecting the right set of options and a revised version of the script below Steve On 28/06/17 20:06, Russell Coker wrote:
Thanks for the suggestion, I will have to investigate that normalise package.
But I don't want to rewrite the mp3 or m4a part as they are lossy compression and will lose quality. So I want to get MPlayer to adjust it at playback time.
But I might do that for the collection of mp3 and m4a files I have on my phone. My phone speakers don't give the best quality anyway. ;)
On 28 June 2017 5:20:07 pm AEST, Steve Roylance via luv-main <luv-main@luv.asn.au> wrote:
On 28/06/17 01:11, Russell Coker via luv-main wrote:
Is there a way of balancing loudness of different mp4 files? While it's impossible to do this perfectly (there is no general agreement on how to measure it) it is possible to give a good approximation.
My music video collection that I downloaded from youtube has videos of significantly different loudness, so when I watch a selection of videos that suit my mood with mplayer I have to change the system volume every few videos because I get to one that's either too loud or too quiet for the current settings.
I'd like to run a script across my video collection to get the average loudness of each video so the mplayer softvol setting can be adjusted to compensate. Then of course I'd do some manual adjustment like increasing the volume of The Divinyls and The Angels.
hi
something like this should do it
------------------------------------------
#!/usr/bin/bash
vid=$1 tx=${vid%.*} ffmpeg -i $1 -vn $tx.mp3 ffmpeg -i $1 -an -c copy $tx.m4a normalize $tx.mp3 ffmpeg -i $tx.m4a -i $tx.mp3 -vcodec copy $tx.n.m4a rm $tx.mp3 rm $tx.m4a mv $tx.n.m4a $tx.m4a
------------------------------------------
normalize is a package in rpmfusion-free for Fedora users first ffmpeg removes the video next ffmpeg removes the audio final ffmpeg put it back together
Steve _______________________________________________ luv-main mailing list luv-main@luv.asn.au https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main
participants (6)
-
Andrew Pam
-
Brian May
-
Craig Sanders
-
Russell Coker
-
Steve Roylance
-
zlinew9ï¼ virginbroadband.com.au