ffmpeg audio file editing commands

To edit video and audio files in ffmpeg, below are some commands. Open a terminal window and try them out. These are very useful when creating training videos.

Extract mp3 audio from mp4 file
$ ffmpeg -i video.mp4 -vn -ab 256k -ar 48000 -y audio.mp3 <enter>

Split from 7 seconds to end
$ ffmpeg -i audio.mp3 -ss 7 -acodec copy output.mp3 <enter>

Split from 7 seconds point to 3:19 point
$ ffmpeg -i output.mp3 -ss 00:00:07 -to 00:03:19 -acodec copy clipped.mp3 <enter>

Boost Sound by 1.5 times of output.mp3 file.
$ ffmpeg -i clipped.mp3 -filter:a "volume=1.5" boosted.mp3 <enter>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s