Thursday, September 21, 2017

Extract Audio from Video with FFmpeg and Format Factory

FFmpeg:

FFmpeg is a free software project that produces libraries and programs for handling multimedia data.



Format Factory:

FormatFactory is an ad-supported freeware multimedia converter that can convert video, audio, and picture files. It is also capable of ripping DVDs and CDs to other file formats, as well as creating .iso images. It can also join multiple video files together into one.



How to extract audio from video using FFmpeg:

If you just want to copy the audio stream without re-encoding just do:

ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac

-vn is no video.
-acodec copy says use the same audio stream that's already in there.

Read the output to see what codec it is, to set the right filename extension.


To encode a high quality MP3 from an AVI best using -q:a for variable bit rate.

ffmpeg -i sample.avi -q:a 0 -map a sample.mp3

If you want to extract a portion of audio from a video use the -ss option to specify the starting timestamp, and the -t option to specify the encoding duration, eg from 3 minutes and 5 seconds in for 45 seconds. The timestamps need to be in HH:MM:SS.xxx format or in seconds. If you don't specify the -t option it will go to the end.

ffmpeg -i sample.avi -ss 00:03:05 -t 00:00:45.0 -q:a 0 -map a sample.mp3



How to extract audio from video using Format Factory:

The simple interface of Format Factory doesn’t show the full potential of what the program is capable of. If you’re looking to extract audio from any of your videos, Format Factory offers a good selection of options to get a decent rip from a video source.


1. Open Format Factory and select the Audio menu.

2. Format Factory supports a lot of standard audio codecs like MP3, WMA, WAV, AAC, FLAC, and even M4A and OGG. Select your desired output format in the menu box. Select the output audio format.

3. Select your output setting options.

4. Select your file.

5. Convert!