[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: normalize audio in mp4s



On Sat 07 Mar 2020 at 12:12:18 (+0100), Jonas Smedegaard wrote:
> Quoting David Wright (2020-03-07 04:56:05)
> > On Fri 06 Mar 2020 at 20:33:48 (+0100), Emanuel Berg wrote:
> > > how can I normalize the audio in mp4 video files? both WRT not
> > > having to lower the volume when there's a firefight and raise it
> > > when they start talking again, _and_ WRT playing several files, e.g.
> > > music videos, and having them have basically the same volume?
> > > 
> > > if need be, I can set volume modifications to each file, manually if
> > > I knew how to do it. this wouldn't work for firefight/talk
> > > movies tho.
> > 
> > I use the compand and gain effects in sox,
> [...]
> > The critical lines (embedded in a load of shell) are
> >   ffmpeg -hide_banner -y -i "$1" -ar 44100 -ac 2 "$Unique0/$Filenumber.wav"
> > where the $Filenumbers are 10000+ sequence numbers so they collate,
> >   sox "$Unique0"/1*.wav -t wav -r 44100 -b 16 -c 2 "$Unique0/0.wav" compand 0.3,1 6:-70,-60,-20 -15 -90 0.2 gain -n -0.01;
> > where the companding parameters are reasonably aggressive and the
> > normalisation is "turned up to ten", and
> >   lame -b "${Fixedbitrate:-128}" "$Unique0/0.wav" "$Unique0/0.mp3"
> > is for fairly unendowed MP3 players.
> [...]
> > I would be interested if someone worked out how to do splitting, sox, 
> > and recombining reliably enough to preserve the synchronisation. 
> > (Automatic, but not on the fly.)
> 
> ffmpeg should be able to do the whole processing, if you want peak or 
> RMS normalization.  If you want EBU R128 normalization then you need 
> e.g. melt (which uses ffmpeg internally and adds aditional plugins).
> 
> Here is a good explanation on the difference between "peak", "RMS", and 
> "EBU R-128": https://www.learndigitalaudio.com/normalize-audio
> 
> Hhere are some example of using ffmpeg: 
> https://superuser.com/questions/323119/how-can-i-normalize-audio-using-ffmpeg

I don't think normalisation, on its own, would be of much help to me.
Many digital recordings are mixed for perfect listening conditions,
and that's often just not possible, so some degree of dynamic range
compression is necessary *within* each track. And where the tracks
segue on a CD, that necessitates concatenation, as least with my
technique, making for longer tracks.

I don't know whether/how movies are segmented (I've seen reference
to "chapters" but don't know what they are). But it sounds as if the
OP needs similar DR compression between or even within scenes.

> I use melt because I can then handle video as well - either do various 
> compression of that as well, or "just" pass-through (which still 
> involves the challenge of keeping audio and video in sync - which is 
> more or less reliable depending on the container format of each video).

I'm not sure what type of video compression you mean: file size or
something else? We have one TV which can darken dark scenes and
brighten bright ones. Perhaps you need the opposite for watching
movies in the back seats of a car?

Melts looks like a very professional editor, but doesn't appear
to be easy to configure for automatic processing, so it might not
suit my requirements. The only guidance my process needs is which
tracks need concatenation, and that's a very small proportion of
the just those that were ripped from CDs.

I ripped my CD collection on a desktop at home (because it's a manual
process), but companded them all on a laptop running 24/7 in a freezing
house while I was walking in the Lake District (suited its processor
that tended to run 80°C+). Then I reran the concatenated ones when
I got home.

Cheers,
David.


Reply to: