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

Re: normalize audio in mp4s



Quoting David Christensen (2020-03-07 03:41:22)
> On 2020-03-06 18:05, Emanuel Berg wrote:
> 
> <snip>
> 
> > Well, it sounds advanced... Yes, its a stereo alright, that much
> > I know.
> > 
> > I tried this but it sounds so bad I even had to put a warning in
> > a comment:
> > 
> > # first do:
> > # $ pip install ffmpeg-normalize
> > #
> > # but... don't use, at least not with music, sounds terrible :(
> > get-mp3-normalized () {
> >      local -a files
> >      files=($@)
> > 
> >      local dB=-10 # db/LUFS
> > 
> >      for f in $files; do
> >          ffmpeg-normalize -f -c:a libmp3lame -t $dB -ext mp3 $f
> >      done
> > } # [1]
> > 
> > 
> > [1] https://dataswamp.org/~incal/conf/.zsh/audio-convert
> 
> It is going to be difficult or impossible to get good results across 
> many different mp4 files by feeding them all through a command-line tool 
> with the same set of options.  It might be possible to script a solution 
> that uses command-line tools to analyze each file and tune the options, 
> but I dunno...
> 
> 
> The most direct path to good results would be to use an interactive 
> audio editor.  Then it's up to your skills as an audio engineer.  As, 
> Audacity only does audio files, the workflow would be to use a video 
> tool to extract the audio tracks, rework the audio with Audacity, and 
> then use a video tool to replace the old audio with the new audio.
> 
> 
> Be sure you backup your original files before you start messing with them.

If you want something you can throw into a script, I recommend to look 
at melt and use its "loudness" filter.

You will want to run it in two-pass mode, so that it knows ahead the 
dynamics of each "tune" (or movie).

It can be tricky to capture the output from first pass and feed it into 
second pass (because the main use for the MLT framework is not the 
command-line tool melt but instead XML-based linkage to GUI tools).

Maybe this script is useful for inspiration: 
http://source.jones.dk/bin.git/tree/localvideowebencode


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature


Reply to: