Audio 如何在FFmpeg'中指定噪声地板;s型压缩机过滤器

Audio 如何在FFmpeg'中指定噪声地板;s型压缩机过滤器,audio,ffmpeg,audacity,Audio,Ffmpeg,Audacity,如果我想提高音频文件的音量,我总是使用Audacity's。今天我在看我是否可以用FFmpeg做同样的事情 我找到了和吉安的答案,这确实很有帮助,但还不够令人满意 现在我实际上是在模仿Audacity的程序。 如果我正确理解了A压缩机,那么我就不能一次性应用补偿增益。所以我需要先做一个volumedetect 假设我有以下“Audacity选项”,我想使用: Threshold: -30dB Noise Floor: -40dB Ratio: 2:1 Attack Time: 0,2s Re

如果我想提高音频文件的音量,我总是使用Audacity's。今天我在看我是否可以用FFmpeg做同样的事情

我找到了和吉安的答案,这确实很有帮助,但还不够令人满意

现在我实际上是在模仿Audacity的程序。
如果我正确理解了
A压缩机
,那么我就不能一次性应用补偿增益。所以我需要先做一个
volumedetect

假设我有以下“Audacity选项”,我想使用:

Threshold: -30dB  
Noise Floor: -40dB
Ratio: 2:1
Attack Time: 0,2s
Release Time: 1,0s
[x] Make-up gain for 0 dB after compressing
[x] Compress based on Peaks
如果我是对的,这可以转化为:

threshold=0.031623   # 10^(-30/20) = 10^(-1.5) = 0.031623.
ratio=2              # 2 is the default, so no need to specify.
attack=200           # 0.2*1000 = 200ms.
release=1000         # 1.0*1000 = 1000ms.
detection=0          # peak based.
我不明白的是我在哪里可以指定“噪音地板”。
acompressor
甚至有这样的选项吗

好的,
volumedetect

ffmpeg -i input.wav -lavfi acompressor=threshold=0.031623:attack=200:release=1000:detection=0
,volumedetect -f null -
or
ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
on=0,volumedetect -f null -
10^(-30/20)
(Windows)、
10^\(-30/20)
(Unix)。
pow(10,-30/20)
似乎不起作用)

…在我的情况下导致

n_samples: 23838888
mean_volume: -27.7 dB
max_volume: -7.7 dB
histogram_7db: 3
histogram_8db: 21
histogram_9db: 126
histogram_10db: 458
histogram_11db: 1727
histogram_12db: 5021
histogram_13db: 11816
histogram_14db: 24831
对于第二次通过,我施加的补偿增益为
10^(7.7/20)
2.4266

ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
on=0:makeup=10^^(7.7/20) -f wav output.wav
顺便说一句,我注意到
-lavfi acompressor=[…],volume=7.7dB
产生相同的输出

到目前为止还不错。这是
输出.wav的波形:

ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
on=0:makeup=10^^(7.7/20),showwavespic=s=888x295:split_channels=1 output.png
其中,这是Audacity(使用上述设置)处理的相同
input.wav
的波形:

我不是这方面的专家,但FFmpeg输出的较低总音量是否是由于缺少“噪声地板”造成的?
若有,如何说明?如果没有使用
acompressor
,还有什么其他过滤器

[编辑]

ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
on=0:makeup=10^^(7.7/20),volumedetect -f null NUL
n_samples: 23838888
mean_volume: -20.0 dB
max_volume: -0.0 dB
histogram_0db: 16
histogram_1db: 76
histogram_2db: 329
histogram_3db: 1158
histogram_4db: 3678
histogram_5db: 9473
histogram_6db: 19933
平均音量:-20.0 dB
平均音量:-16.9 dB
。所以Audacity的输出声音很大。同时,使用噪声地板会导致非常不同的
直方图xdb

我仔细查看了
acompressor
的其他选项,并开始在
中摆弄
level\u(“设置输入增益。默认值为1。范围在0.015625和64之间)。
我不知道这个范围代表什么,但我认为
2
的值意味着,使输入声音加倍

ffmpeg -i input.wav -lavfi acompressor=level_in=2:threshold=10^^(-30/20):attack=200:release=1
000:detection=0:makeup=10^^(7.7/20),volumedetect -f null NUL
n_samples: 23838888
mean_volume: -16.9 dB
max_volume: 0.0 dB
histogram_0db: 1611
histogram_1db: 3779
histogram_2db: 9619
histogram_3db: 20263
以及波形:

哇!真奇怪。与Audacity的输出相同的
平均音量
,波形非常相似。
请注意,对于
电平_in=1
,其补偿增益为
7.7dB

我想这回答了我关于“噪音地板”的问题。这并没有导致音量降低

也许一些Audacity专家可以向我解释为什么Audacity使用DRC过滤器将音频音量提高两倍,而这甚至不是一个选项。
还是我对这件事的研究完全错了


[/edit]

各个输出文件上的卷统计信息是什么?在我看来,您在ffmpeg中的补偿增益操作实际上并没有导致0 dB的峰值?(假设有一些净空,如Audacity波形所示。)@slhck
平均音量:-20.0 dB,最大音量:-0.0 dB
,对于FFmpeg产生的音量为
平均音量:-16.9 dB,最大音量:-0.0 dB
。(它实际上是一个“FFmpeg”波形,而不是“Audacity”波形;))各自输出文件的音量统计是多少?在我看来,您在ffmpeg中的补偿增益操作实际上并没有导致0 dB的峰值?(假设有一些净空,如Audacity波形所示。)@slhck
平均音量:-20.0 dB,最大音量:-0.0 dB
,对于FFmpeg产生的音量为
平均音量:-16.9 dB,最大音量:-0.0 dB
。(它实际上是“FFmpeg”波形,而不是“Audacity”波形;)
ffmpeg -i input.wav -lavfi acompressor=threshold=10^^(-30/20):attack=200:release=1000:detecti
on=0:makeup=10^^(7.7/20),volumedetect -f null NUL
n_samples: 23838888
mean_volume: -20.0 dB
max_volume: -0.0 dB
histogram_0db: 16
histogram_1db: 76
histogram_2db: 329
histogram_3db: 1158
histogram_4db: 3678
histogram_5db: 9473
histogram_6db: 19933