POV-Ray : Newsgroups : povray.off-topic : ffmpeg and normalizing audio volume : Re: ffmpeg and normalizing audio volume Server Time
3 Jul 2024 00:16:17 EDT (-0400)
  Re: ffmpeg and normalizing audio volume  
From: jr
Date: 8 May 2016 06:00:08
Message: <572f0e28$1@news.povray.org>
hi,

On 07/05/2016 13:14, Doctor John wrote:
> ... I therefore need to normalize all my files - a mixed
> bag of mp3s, oggs and flacs.
> The slow way of doing it is to detect the maximum volume of each file
> with 'ffmpeg -i example.mp3 -af "volumedetect" -f null /dev/null', note

using ffmpeg v 0.8.7 here, get message "Unrecognised option 'af'".

> the maximum volume (e.g. -10 dB) and then correct it with 'ffmpeg -i
> example.mp3 -af "volume=10dB" example.mp3'.
> Can anyone familiar with ffmpeg think of a way of scripting this so that
> I don't have to manually re-encode every individual file?
> 
> BTW I'm using bash on a linux box.

I'm not familiar with 'ffmpeg' (I use 'lame' for recoding mp3s) and
don't know the exact format of the "volume" line you get from volumedetect.

however, I'd opt for a two-stage approach: (i) write a shell script
which processes a single file named on its command-line, (ii) use the
'find' utility to process all (named) files, eg, if your shell script is
~/mycmd:

  $ find ~/Music -type f -name \*.mp3 -exec ~/mycmd {} \;

the backslashes are necessary; find also supports a this-filename -or
that-filename syntax but requires backslach escapes all over the place.


jr.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.