How to convert a Video File into an Audio using FFmpeg in Linux Command Line:
FFmpeg:
FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line
FFmpeg
tool itself, designed for processing video and audio files. It is widely used for format transcoding, basic editing (trimming and concatenation), video scaling, video post-production effects, and standards compliance (SMPTE, ITU).
Install FFmpeg in Ubuntu:
If you're using Ubuntu, Its derivatives, or any other Debian based OS, this method will work:
sudo apt install ffmpeg -y
Convert Video to Audio:
According to their website, "Converting video and audio has never been so easy." & that's true. Converting a video to an audio file is a pretty simple process. Here's the code:
ffmpeg -i input.mp4 -o output.mp3
Here:
- -i tag means the input file - any video file i.e. Video.mp4
- -o means the output file - any audio format i.e. Converted.avi
Additional Tags:
FFmpeg is much more than converting videos to audio. It's a very diverse tool. It can do much more than that. To explore more of its options type ffmpeg --help
in the terminal:
Here are some of the results as the list is very long see for yourself.
As can be seen in the above picture -vn
tag disables the video when reading the file so this can be handy when converting a large file as it reduces the converting time.
ffmpeg -i Song.mp4 -vn -o Song.mp3
Conclusion:
That's it. As you saw converting a video to audio is very simple. By using this tool you can do much more. Just explore more options by adding the --help
flag or use man ffmpeg
. You can convert multiple video files at a time by adding a bash script. If you found it useful give it a thumbs up 👍 and follow me for more useful tips and tricks.