- sudo snap install ffmpeg # version 4.3.1, or
- sudo apt-get install ffmpeg
ffmpeg is a Hyper fast Audio and Video encoder. Its general usage format is:
- ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
For example, to mute two video sections between 5-15 seconds and 20-25 seconds we run the command:
- ffmpeg -i Original_video.mp4 -af "volume=enable='between(t,5, 15)':volume=0, volume=enable='between(t,20,25)':volume=0" Output_video.mp4
-af is the audio filter which works by specifying multiple volume filters that are enabled/disabled at the specified duration of time.
- volume=enable='between(t,5,15)':volume=0
means use a volume filter that is enabled between 5 and 15 seconds to set the volume in a specified portion to 0. In our case, the input file is the Original_video.mp4 and the output file with specified sections muted is Output_video.mp4.