[FFmpeg-devel] [PATCH 1/1] libavfilter/volume: do fade when adjusting the volume.

Gyan Doshi ffmpeg at gyani.pro
Thu Apr 24 07:10:20 EEST 2025



On 2025-04-24 02:05 am, Marton Balint wrote:
>
>
> On Wed, 23 Apr 2025, cenzhanquan2 at gmail.com wrote:
>
>> From: zhanquan cen <cenzhanquan2 at gmail.com>
>>
>> 1. add simple fade when volume.
>> 2. do fade when adjust volume to maximal.
>>
>> when to adjust volume we hope that the audio sample is smooth
>> we need to calculate the gradient step between each sample based
>> on the total change of the gradient (i.e. dst_volume - src_volume)
>> and the number of samples (nb_samples) and apply it to the target 
>> sample.
>
> I don't understand this. Why would you want any fading when you want 
> to apply the audio gain uniformly over the whole duration of audio?
It is useful to transition into the new volume level.
However, this shouldn't be hardcoded. Add an option for the transition 
time with default value of 0.

Regards,
Gyan



More information about the ffmpeg-devel mailing list