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

Marton Balint cus at passwd.hu
Fri Apr 25 22:23:27 EEST 2025



On Thu, 24 Apr 2025, Gyan Doshi wrote:

>
>
> 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.

The afade filter (or combining volume with afade) can already support such 
a use case, no?

Regards,
Marton


> However, this shouldn't be hardcoded. Add an option for the transition time 
> with default value of 0.
>
> Regards,
> Gyan
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
>


More information about the ffmpeg-devel mailing list