Jump to content

Feature Request: Audio Normalization


Netfool

Recommended Posts

Netfool

Lots of content has audio levels designed for theatre sound systems.  When played through lots of home systems, by the time you turn up the level to the point where you can hear the conversations (especially the conspiratorial whispers), the M&E tracks reach window rattling levels. 
There is a loudnorm parameter in ffmpeg that may help, and there is a python program ffmpeg-normalize that may perhaps be better.  I've not yet experimented with either, but I will report back when I know more.

Adding the ability to normalize audio in conversions, preferably by adding the normalized audio as a SAP would seem like a worthwhile feature.  Please consider it future revisions of Emby Server.

  • Like 3
  • Agree 2
Link to comment
Share on other sites

arrbee99

Definitely. Have mentioned it before. Only thing I found that had it was in Kodi.

Link to comment
Share on other sites

This is part of my pipeline for loading movies/shows into my system.  Previously before this I'd get one movie with low volume and another that was way to loud.  So I started to copy audio track but write a new 2 channel audio track that's normalized.  Solved the problem as I also preserve and can use the original sound track as well.

  • Agree 1
Link to comment
Share on other sites

Netfool

Can you share how you did that?

Sounds like a perfect application for a script that just runs through the whole library.  (quick, while I only have 0.01% of what's in yours!)

PS: Sorry for not posting this in Feature Requests originally 🙄

Edited by Netfool
Typo correction
Link to comment
Share on other sites

It's a one of a kind system designed just for my system but it started as an early port of https://github.com/mdhiggins/sickbeard_mp4_automator

I don't use any of the "hooks" in it and actually stripped them out but just use it for scripting the ffmpeg process and manipulating the video, audio and subs.

I then added extra command to this to do the normalization of track 1 only for stereo.  You could also build a 2nd track that's normalized from 6 channel while coping other audio tracks.

Since I only care about English I strip other audio tracks and subs from the files as I don't need them.

If you can get that running, I can dig through my stuff to find what to add to it to do the normalization. Hell, it could even be built in these days, I haven't looked.  But the script is sort of a swiff army knife for batch processing files before adding to you library.

  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...
Ronstang

You would have thought by now the sound engineers would have figured this out and made an adjusted 5.1 audio track for release on disc, streaming, or cable networks......but Hollywood lives in a bubble.  Sometimes the sound is so bad I simply run the CCs so I don't have to keep rewinding trying to figure out what someone said.  Sound engineers don't know how to master music anymore either.....then again there isn't much these days one could consider music.  We're doomed.

  • Like 1
Link to comment
Share on other sites

Gilgamesh_48
22 minutes ago, Ronstang said:

You would have thought by now the sound engineers would have figured this out and made an adjusted 5.1 audio track for release on disc, streaming, or cable networks......but Hollywood lives in a bubble.  Sometimes the sound is so bad I simply run the CCs so I don't have to keep rewinding trying to figure out what someone said.  Sound engineers don't know how to master music anymore either.....then again there isn't much these days one could consider music.  We're doomed.

The sound on almost all media is designed for listening at between high and very high volume and there are few pieces of hardware that even remotely will correct "normalize" audio that comes through HDMI. 

I have a Fire 4K stick, a Shield TV and a few Rokus. I also have a brand new Denon receiver. The Denon has something called "Night mode" but it seems to no really do much at all. There seems to be nothing else that might be a normalizing function. 

The Fire TV has some audio adjustments but they do little to help make dialog more understandable.
The Shield is also quite lacking in that department.

The Roku has a function called "Volume leveling" and when it is on it actually does an OK job. It is almost as good as the hardware analog device I used to use. It gives me still another reason to use my Roku Ultra for more and more of my media consumption.

I have found that using the Roku makes it easy to understand 99.9% of the media I watch. I can even pick out most of the dialog in Japanese, German and Spanish movies except when they go into slang in their language and no amount of volume leveling will help me with that. ;) (Of course I also have problems with English slang particularly from the other side of the pond.) 

Now for one of the great questions of the universe: Why is it that we turn down the radio when we are driving and looking for an address?

Link to comment
Share on other sites

Gilgamesh_48
7 hours ago, PenkethBoy said:

Modern - admittedly higher end TV's - can do this automatically if the option is set

Except that requires you process sound through the TV. I used to do that but my TV seems to have an issue with just a few files and I found my new receiver does not have that issue. Also if processing audio through the TV you loose, in a number of cases, the ability to use many of the "advanced" audio forms.

I used to believe that "leveling" belonged in the audio chain after it was processed but now I have come to the conclusion that it belongs as early in the chain as possible and, since the media producers are never going to provide good proper audio, Normalization belongs in either the client hardware or, if that cannot/willnot be done, it belongs in the software first processing the stream; in this case Emby. 

Link to comment
Share on other sites

lowdough

How would any TV know what volumes are on the other shows in the queue so that it could normalize the current show's volume with them?

Link to comment
Share on other sites

Hi, using dynamic compression it it the processors can can boost/lower overall loudness and some can also clip very large spikes as well.

Link to comment
Share on other sites

Gilgamesh_48
15 minutes ago, cayars said:

Hi, using dynamic compression it it the processors can can boost/lower overall loudness and some can also clip very large spikes as well.

Some people complain that even the best "dynamic compression" alters the sound and takes the "juice" out of it. I believe it is really a matter of "personal taste" and I, for one, do not think that "dynamic compression" adversely effects 99% of the audio of movies or TV shows. In fact it allows many movies and TV shows to actually become watchable. Without "dynamic compression" many movies particularly and some TV shows either have to be played so loudly the neighbors two counties away complain or you cannot understand the dialog or in some cases you can't even hear any dialog at all.

I believe that it should be a choice for all Emby users and it should be no more than two keypresses away from turning it on or off while media is playing.

I have this on the Roku but I cannot find it on either my Fire devices or my Shield. It would be easiest and most efficient to place the choice inside of Emby so that it would be device independent. Emby is all about the user and this would  be a good step toward making Emby even more user friendly. This is one "feature" where the developer overhead is more than justified by the user satisfaction that it would, if well done, produce. Of course it should be a user choice so as to not "force" anyone to use it and it should default to off like all "features" that change the original form of the media.

Link to comment
Share on other sites

PenkethBoy
2 hours ago, Gilgamesh_48 said:

Except that requires you process sound through the TV. I used to do that but my TV seems to have an issue with just a few files and I found my new receiver does not have that issue. Also if processing audio through the TV you loose, in a number of cases, the ability to use many of the "advanced" audio forms.

 

If you have a modern tv - you dont get less features you get the same as the tv supports

if you use a soundbar/ receiver etc then its up to that device to do the levelling - if it cant ........

Link to comment
Share on other sites

Gilgamesh_48
20 minutes ago, PenkethBoy said:

if you use a soundbar/ receiver etc then its up to that device to do the levelling - if it cant ........

Then leveling should be done in the client software, in this case Emby.

  • Agree 1
Link to comment
Share on other sites

rbjtech

I'm like @cayars I do this as part of the pre processing before the media gets added as I add a 2 channel stereo mixed and normalized aac soundtrack as the default.   That way it not only direct plays on all TV's but the centre dialogue channel is at a decent level.  It means adding a soundtrack however,  so not realtime .. 

  • Like 1
Link to comment
Share on other sites

rbjtech

.. any post processing / real time would likely mean a transcoded audio file - so not the end of the world.

Link to comment
Share on other sites

PenkethBoy
2 hours ago, Gilgamesh_48 said:

Then leveling should be done in the client software, in this case Emby.

that only one solution

  • Like 1
Link to comment
Share on other sites

Gilgamesh_48
12 minutes ago, PenkethBoy said:

that only one solution

But it is the one that involves the least money for the user. It is one solution that extends throughout all, or at least most, hardware combinations. 

I am not saying that some people will not want/need a hardware solution but it is expensive for people to buy capable hardware for every room they wish to use Emby in. In my case it is only two rooms but even then I would have to buy hardware for each room. Of course, in my case, it is solved because I have Roku Ultras and they do a good job normalizing volume but I have friends with only Fire TVs and they are not so well served.

Edited by Gilgamesh_48
  • Agree 1
Link to comment
Share on other sites

PenkethBoy

hardware is another solution but software solutions also exist - just requires some effort and time

Link to comment
Share on other sites

It would not be possible to do on all clients (probably only a few) so then would need to be remuxed if you needed it normalized.

The easy way to do this now is via script and that's free and once you normalize your media it works with any Client, Emby or otherwise.

Link to comment
Share on other sites

Gilgamesh_48
Just now, cayars said:

It would not be possible to do on all clients (probably only a few) so then would need to be remuxed if you needed it normalized.

The easy way to do this now is via script and that's free and once you normalize your media it works with any Client, Emby or otherwise.

Running a script to do that against my entire library is impractical at best. For me the best solution is on the fly and if that has to be by transcoding on the server then so be it. Transcoding audio is not an intensive task and "should" be pretty easy to implement for normalization.

But, as I have said, it is not really important for me because my Rokus do a good job.

  • Agree 1
Link to comment
Share on other sites

lowdough

Why would it be impractical?  Could one pass read the average level, then make another pass to make the modifications to those that deviated significantly from it?  What if it took a minute, a day, a month, or a year?  Subsequent scans could modify only the new files.

Link to comment
Share on other sites

Gilgamesh_48
5 minutes ago, lowdough said:

Why would it be impractical?  Could one pass read the average level, then make another pass to make the modifications to those that deviated significantly from it?  What if it took a minute, a day, a month, or a year?  Subsequent scans could modify only the new files.

I assume that you mean the mentioned script.
The reason it is impractical is that I do not really want all my library modified and I do not wish to have two copies of said library. 

Also it is not really about time but it is about using up resources. It also makes rebooting the computer more complex and no matter how simple the script is it makes failure more likely on the computer it runs on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...