A couple of things to note for the examples below:
- your_video_file.mp4 refers to the file name of your video, so change this appropriately.
- Each method will create a file called audio.mp3. You can change this file name to whatever you like.
Without encoding
This method will simply extract the audio in its original state from the video file.
ffmpeg -i your_video_file.mp4 -vn audio.mp3
With encoding
This next method will allow you to re-encode the audio from the video file with a different codec to the original one. Below you'll find conversions with libmp3lame, AAC and Opus codecs.
ffmpeg -i your_video_file.mp4 -vn -acodec libmp3lame audio.mp3
ffmpeg -i your_video_file.mp4 -vn -acodec aac audio.mp3
ffmpeg -i your_video_file.mp4 -vn -acodec opus audio.mp3
Need some help with online video delivery, storage and processing? Get in touch with us using the button below and we'll be happy to help you out.