0

I'm debugging the command

ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=**5**:d=2" ./output-file

But if I try to run a new fadein, after the fadeout, it won't work. The sound doesn't come back.

ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=**5**:d=2,**afade=t=in:ss=**10**:d=2**" ./output-file

What's the right way to achieve this? Thank you.

1 Answer 1

2

What a fade out does is fade the volume from input level to 0 and then keep it at 0 for the rest of the track. Similarly, what a fade in does is fade the volume from 0 to input level and it mutes the volume from the start of the track upto the fade in start time.

When you applied the fade in after the fade out, the 2nd fade filter is working with a muted track, so the fade is from 0 to 0.

What you need to do is apply timeline editing to each fade filter so it operates from the start of its transition till the start of the next fade transition.

So,

ffmpeg -i ./input-file.mp3 -af "afade=t=out:st=5:d=2:enable='between(t\,0\,10)',afade=t=in:st=10:d=2:enable='gte(t\,10)'" ./output-file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.