Plainsage
Plainsage

Reputation: 145

How can i remove portions of audio instead of concatenate the portions

If i've got this command that concatenates audio between 115-368 seconds and 605 to the end and the output only has this audio.

ffmpeg -i "abc.mp3" -filter_complex "[0:a]atrim=start=115:end=368,asetpts=PTS-STARTPTS[ba];[0:a]atrim=start=605,asetpts=PTS-STARTPTS[da]" -b:a 320k "def.mp3"

How can i make this same command so that instead of the output being concatenation of these 2, it removes these two portions and the output has the remaining audio in it

I know there's a way where i can just instead get the start and end of the audio i want and concatenate those, but i'd like to know for my knowledge if there is a way to remove the audio, rather than concatenate into the output.

Upvotes: 0

Views: 67

Answers (1)

Rolf of Saxony
Rolf of Saxony

Reputation: 22443

It's a somewhat confusing question but if what you want to achieve by the words, remove rather than concatenate, is a simple silence during certain periods, you could simply chain the volume filter.

e.g.:

ffmpeg -i input.mp3 -af "volume=enable='between(t,0,15)':volume=0,volume=enable='between(t,30,45)':volume=0" out.mp3

Would give you the entire audio but with silence at the start for 15 seconds and silence between seconds 30 to 45.

Upvotes: 1

Related Questions