gpt4 book ai didi

ffmpeg如何缩短音量范围

转载 作者:行者123 更新时间:2023-12-04 23:20:17 27 4
gpt4 key购买 nike

我使用下面的这个命令来获取卷信息

ffmpeg -i {fileName} -af  "volumedetect" -f null -
并得到以下结果:
[Parsed_volumedetect_0 @ 000001b4f9675ec0] mean_volume: -25.1 dB
[Parsed_volumedetect_0 @ 000001b4f9675ec0] max_volume: -4.0 dB
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_4db: 12
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_5db: 72
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_6db: 293
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_7db: 808
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_8db: 2276
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_9db: 5885
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_10db: 13146
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_11db: 26627
我想像下面这样将音量范围缩短到一半
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_6db: ...
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_7db: ...
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_8db: ...
[Parsed_volumedetect_0 @ 000001b4f9675ec0] histogram_9db: ...
如何通过 ffmpeg 命令来实现?
更新1:
filename.mp3 音量检测如下:
[Parsed_volumedetect_0 @ 00000192cd9adcc0] max_volume: -0.3 dB
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_0db: 32
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_1db: 333
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_2db: 1216
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_3db: 3490
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_4db: 8829
[Parsed_volumedetect_0 @ 00000192cd9adcc0] histogram_5db: 19873
执行命令后
ffmpeg -i filename.mp3 -af filename_output.mp3
filename_output.mp3 音量检测如下:
[Parsed_volumedetect_0 @ 0000017af506dd00] max_volume: -0.4 dB
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_0db: 13
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_1db: 226
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_2db: 906
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_3db: 2688
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_4db: 7202
[Parsed_volumedetect_0 @ 0000017af506dd00] histogram_5db: 16473
没有大的变化,如果我想缩短更多的音量范围,怎么办?

最佳答案

您可以使用 FFMPEG's Dynamic Audio Normalizer (dynaudnorm) 来实现此目的。特征。从文档:

Normalizer achieves this goal without applying "dynamic range compressing". It will retain 100% of the dynamic range within each section of the audio files.


实际上,音频部分之间的总分贝量会发生变化。但是,这些更改将与每个部分相关,以最大程度地减少音频中的失真。该命令应如下所示:
ffmpeg -i input.mp3 -af dynaudnorm output.mp3
在上面的片段中,我以 mp3 为例。这应该适用于所有 ffmpeg 支持的格式。

关于ffmpeg如何缩短音量范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68325306/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com