FFmpeg混合滤波器始终执行“体积归一化".如何预防它以及它可能有什么弊端? [英] FFmpeg amix-filter always does "volume normalization". How to prevent it and what are the possible drawbacks of it?

查看:148
本文介绍了FFmpeg混合滤波器始终执行“体积归一化".如何预防它以及它可能有什么弊端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对此主题有很多疑问 link1 link2

There are many questions on this topic link1, link2, and link3. However, I am asking for suggestions on the probable solution and if it has some drawbacks.

问题定义: amix-filter始终执行卷标准化",并且无法关闭

Problem Definition: amix-filter always does "volume normalization" and can't be turned off

参考:请阅读 Reino 上找到.他还在FFmpeg论坛上打开了门票来解释这种情况.

Reference: Please read comments over here by @Reino. He also had opened a ticket on the FFmpeg forum to explain the situation.

棘手的解决方案: amix = inputs = 13:dropout_transition = 1000,volume = 13

Hacky Solution: amix=inputs=13:dropout_transition=1000,volume=13

参考:在此处,以及在 问题:

1)"amix以1/n缩放每个输入的音量,其中n =有效输入的数量.对每个音频帧进行评估.因此,当输入丢失时,剩余的输入将按较小的比例缩放,因此它们的数量会增加."请参阅

1) "amix scales each input's volume by 1/n where n = no. of active inputs. This is evaluated for each audio frame. So when an input drops out, the volume of the remaining inputs is scaled by a smaller amount, hence their volumes increase."Refer

例如,如果我要合并10个音频流,则第一个音频流将按比例缩放1/10,第二按1/9缩放,第3按1/8进行缩放.第9按1/2进行缩放,最后按1进行最后缩放.我是否正确理解了这一点,或者是否想念我想知道的东西?

For example, if I am merging 10 audio streams then, the 1st audio stream will be scaled by 1/10, 2nd by 1/9, 3rd by 1/8 .. 9th by 1/2 and last 10th by 1. Have I understood this correctly or let me know if I am missing something?

2) dropout_transition :,过渡时间,以秒为单位,用于在输入流结束时重新进行音量规范化.默认值为2秒.

2) dropout_transition: The transition time, in seconds, for volume renormalization when an input stream ends. The default value is 2 seconds.

dropout_transition表示它将跳过几秒钟,对吗?因此,如果我设置dropout_transition = 1000(非常大的数字),则无论视频长度如何,FFmpeg都会在提供的秒数内丢弃/跳过音频过渡.同样,如果我做错了假设,请纠正我.

dropout_transition means it will SKIP given seconds, right? So if I set dropout_transition=1000(very large number) then regardless of video length FFmpeg will drop/skip audio transition for provided seconds. Again, please do correct me if I have made wrong assumption.

3)我已经尝试了许多其他解决方案,但没有任何运气,现在,我非常依赖提供的解决方案.上面的hacky解决方案有什么缺点吗?

3) I have tried many other solutions without any luck and now I am relying profoundly on the provided solution. Is there any drawback to the above hacky solution?

推荐答案

如果我要合并10个音频流,则第一个音频流将按1/10缩放,第二按1/9缩放,按3缩放1/8 .. 9乘1/2,最后10乘1.

不.假设您有4个输入,分别长10、7、4和2秒.让我们将辍学过渡保持为0.然后在开始的2秒钟内,所有输入均处于活动状态,因此每个输入都按1/4缩放.在2到4秒之间,有3个输入处于活动状态,因此所有活动输入(#1、2、3)均按1/3缩放.从4到7秒,只有输入1和2处于活动状态,因此两者均按1/2缩放.从7到10秒,只有输入1处于活动状态,因此它按1进行缩放,即其音量不变.

No. Let's say you have 4 inputs, which are 10, 7, 4 and 2 seconds long respectively. Let's keep dropout transition as 0. Then for first 2 seconds, all inputs are active, so each input is scaled by 1/4. From 2 to 4 seconds, 3 inputs are active, so all active inputs (#1, 2, 3) are scaled by 1/3. From 4 to 7 seconds, only inputs 1 and 2 are active, so both are scaled by 1/2. And from 7 to 10 seconds, only input 1 is active, so it is scaled by 1 i.e. its volume is unchanged.

dropout_transition意味着它会跳过几秒钟,对吧?

不.继续上述情况,假设退出转换为1秒.因此,当输入4结束时,缩放比例不会立即从1/4更改为1/3.它会逐渐过渡1秒以上.

No. Continuing with the above scenario, let's say dropout transition is 1 second. So, when input 4 ends, the scaling does not change from 1/4 to 1/3 immediately. It transitions over 1 second, gradually.

上述hacky解决方案是否有缺点?

在大多数情况下都可以.如果您要合并大声的音乐,则范围会变平,但是在那种情况下没关系.

For most cases, it's fine. If you're combining loud pieces of music, then there will be flattening of range, but it shouldn't matter in that case.

这篇关于FFmpeg混合滤波器始终执行“体积归一化".如何预防它以及它可能有什么弊端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆