sound volume normalisation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

sound volume normalisation

jackyr
Hi all gourous

I do request your knowledge and advices

I am getting flv files encoded from ffmpeg
and then I had to normalize sound levels
since few weeks i had flv (H264+mp3) and it was fine
and a fast process

 1.   demux video , demux audio
 2.   run lame to find out the sound level
 3.   remux saved video + audio with volume the corrected volume level

now I am getting flv (h264+aac)
and doing the new cascading almost ffmpeg runs

 1.   demux video
 2.   demux aac audio
 3.   demux and convert aac to mp3
 4.   run lame on mp3 to find volume level
 5.   remux saved video + saved aac with corrected volume value

the second process takes a lot longer
do I make a mistake , is there any advices to speed up
is there a ffmpeg filter option which compete with lame ?

regards

jacky


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: sound volume normalisation

Bouke / VideoToolShed
----- Original Message -----
From: "jacky" <[hidden email]>
To: "FFmpeg user questions and RTFMs" <[hidden email]>
Sent: Tuesday, June 25, 2013 7:56 PM
Subject: [FFmpeg-user] sound volume normalisation


> Hi all gourous
>
> I do request your knowledge and advices
>
> I am getting flv files encoded from ffmpeg
> and then I had to normalize sound levels
> since few weeks i had flv (H264+mp3) and it was fine
> and a fast process
>
> 1.   demux video , demux audio
> 2.   run lame to find out the sound level
> 3.   remux saved video + audio with volume the corrected volume level
>
> now I am getting flv (h264+aac)
> and doing the new cascading almost ffmpeg runs
>
> 1.   demux video
> 2.   demux aac audio
> 3.   demux and convert aac to mp3
> 4.   run lame on mp3 to find volume level
> 5.   remux saved video + saved aac with corrected volume value
>
> the second process takes a lot longer
> do I make a mistake , is there any advices to speed up
> is there a ffmpeg filter option which compete with lame ?

I'm not a Guru, but nevertheless:
Ffmpeg nowadays has the R128 norm build in. This is a great way to find the
human subjective loudness, instead of finding peaks.
So you can analyze first, then transcode / rewrap with a volume change.
(Keep in mind that 1 LU roughly corresponds with 1 dB)
It still will be a two pass process, but without demuxing first.
And since it's only sound to walk trough / re-encode, it should be lightning
fast.
(Granted, if you need to do the entire YouTube content it might take a day
or so...)

hth,

Bouke

VideoToolShed
van Oldenbarneveltstraat 33
6512 AS  NIJMEGEN, the Netherlands
+31 24 3553311


> regards
>
> jacky
>
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user 

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: sound volume normalisation

Moritz Barsnick
In reply to this post by jackyr
On Tue, Jun 25, 2013 at 19:56:23 +0200, jacky wrote:
>  1.   demux video , demux audio
>  2.   run lame to find out the sound level

Have you seen ffmpeg's volumedetect filter?
http://www.ffmpeg.org/ffmpeg-filters.html#volumedetect

The example says it all.

Like Bouke writes though, you need to do two-pass, but all within
ffmpeg.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: sound volume normalisation

Bouke / VideoToolShed
----- Original Message -----
From: "Moritz Barsnick" <[hidden email]>
To: "FFmpeg user discussions" <[hidden email]>
Sent: Wednesday, June 26, 2013 12:18 AM
Subject: Re: [FFmpeg-user] sound volume normalisation


> On Tue, Jun 25, 2013 at 19:56:23 +0200, jacky wrote:
>>  1.   demux video , demux audio
>>  2.   run lame to find out the sound level
>
> Have you seen ffmpeg's volumedetect filter?
> http://www.ffmpeg.org/ffmpeg-filters.html#volumedetect
>
> The example says it all.

Moritz,
Not to sound more arrogant than i actually am, I can't praise the Lords of
R128 Loudness enough.
This  volumedetect is a nice function eg to plot waveforms, (and i did not
know about it, so thanks!) but the mean_volume seems very much VU to me.
(I could be mistaken though.)
In my daily job i do (amongst other things) broadcast output.
An old fashioned (non EBU R128 compliant) commercial is 6 dB louder than the
same one levelled conform new specs.
I'm pretty sure (again, i reserve the right to be wrong) this function will
not see the heavilly compressed / excited / otherwise raped sound as louder
than a regular show.

And now to set a standard loudness value for ALL sound found on the
internet...
(And while i'm ranting, teach player developers to build in a logarithmic
volume slider instead of a lineair.)

Bouke

> Like Bouke writes though, you need to do two-pass, but all within
> ffmpeg.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user 

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: sound volume normalisation

Lou Logan
On Wed, 26 Jun 2013 01:58:43 +0200
"Bouke \(VideoToolShed\)" <[hidden email]> wrote:

> ----- Original Message -----
> From: "Moritz Barsnick" <[hidden email]>
> To: "FFmpeg user discussions" <[hidden email]>
> Sent: Wednesday, June 26, 2013 12:18 AM
> Subject: Re: [FFmpeg-user] sound volume normalisation
>
>
> > On Tue, Jun 25, 2013 at 19:56:23 +0200, jacky wrote:
> >>  1.   demux video , demux audio
> >>  2.   run lame to find out the sound level
> >
> > Have you seen ffmpeg's volumedetect filter?
> > http://www.ffmpeg.org/ffmpeg-filters.html#volumedetect
> >
> > The example says it all.
>
> Moritz,
> Not to sound more arrogant than i actually am, I can't praise the Lords of
> R128 Loudness enough.
> This  volumedetect is a nice function eg to plot waveforms, (and i did not
> know about it, so thanks!)

Also see tools/normalize.py

(I haven't actually investigated or tried it yet though).
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: sound volume normalisation

jackyr

Le 26/06/2013 02:28, Lou a écrit :

> On Wed, 26 Jun 2013 01:58:43 +0200
> "Bouke \(VideoToolShed\)" <[hidden email]> wrote:
>
>> ----- Original Message -----
>> From: "Moritz Barsnick" <[hidden email]>
>> To: "FFmpeg user discussions" <[hidden email]>
>> Sent: Wednesday, June 26, 2013 12:18 AM
>> Subject: Re: [FFmpeg-user] sound volume normalisation
>>
>>
>>> On Tue, Jun 25, 2013 at 19:56:23 +0200, jacky wrote:
>>>>   1.   demux video , demux audio
>>>>   2.   run lame to find out the sound level
>>> Have you seen ffmpeg's volumedetect filter?
>>> http://www.ffmpeg.org/ffmpeg-filters.html#volumedetect
>>>
>>> The example says it all.
>> Moritz,
>> Not to sound more arrogant than i actually am, I can't praise the Lords of
>> R128 Loudness enough.
>> This  volumedetect is a nice function eg to plot waveforms, (and i did not
>> know about it, so thanks!)
> Also see tools/normalize.py
>
> (I haven't actually investigated or tried it yet though).
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
many thanks to all of you ,

I knew volume detect on window, but the linux server
was not up to date (lavfi) was not recognized
and it will be
(by the way is there a way to run the volume detect without lavfi
if you only need mean et max volume values )?

I will then set up the volume based on volumedetect value
and remux

again thanks to these advices
jacky

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user