

To trim an audio file we need two options - a starting sample time and either a duration or an ending point. We have already seen several options which start with -LETTER and are followed by a value if required (like the -i needing a file name). ffmpeg -hide_banner -i nasa-spacewalk-interview.wav output.mp3 Trimming Audio You can hide the configuration by adding -hide_banner anywhere in your command:

When FFmpeg first runs it will tell you about the configuration of your FFmpeg instance followed by the information related to your command. There is a lot of information shown in the terminal when using FFmpeg. To never overwrite you can replace -y with -n. ffmpeg -y -i nasa-spacewalk-interview.wav output.mp3 To automatically overwrite add the -y flag before any infiles.

If you run the above command more than once, you will be asked if you should overwrite the existing output.mp3 file. ffmpeg -i file1.wav -i file2.wav output.wav Overwriting Files Automatically You can provide multiple infiles like so. The -i tells FFmpeg that the next string is an infile that operations should happen against. You should see a new file appear in your directory. Between these two points we can further manipulate the file and export the result of the manipulations, but to start we will take in a file and spit out a new file in a different file format./ffmpeg -i nasa-spacewalk-interview.wav output.mp3 Your First CommandįFMpeg takes one or more files as an input and finishes a command by exporting a file. Then, open the directory in your terminal. Two audio files to work with - you can download one here and the other here.Ĭreate a new directory on your computer.When I started using FFmpeg I would have loved more audio-focused beginner tutorials, so this is to help those people who are in the same boat I was.īefore we begin you will need to download a few things: It’s the go-to for this kind of work - if you’ve used any conversion or simple editing tools there is a good chance that it relies on FFmpeg in some way. FFmpeg is an open source toolkit for converting and manipulating both audio and video files from the terminal.
