How To Install FFmpeg In Linux & Use Commands

FFmpeg Basics Commands & Tips New Linux CLI Newbies

​Who doesn’t love converting media files for various purposes? On Linux distros, one of the best media converter available is FFmpeg. Most persons use it (regardless of OS) and still are amazed by its working. I myself use it every day to convert various files. However there are many Linux newbies that find it difficult to use FFmpeg, this article aims to help them with a few basics that will be sure to be helpful to them.

Download FFmpeg

​You can download FFmpeg from its official site easily from the link given below.

Install FFmpeg on Ubuntu

sudo apt install ffmpeg

Install FFmpeg on Fedora

​I chose to keep this point in first because many newbies don’t use FFmpeg just because it comes in CLI version in default. There are a lot of GUI applications available for FFmpeg which you can use easily and effectively. We at LinuxAndUbuntu understand that CLI version is more efficient for pro users, but for newbies, it’s nothing but an iron ball to chew.Below is the guide was written by us onhow to use GUI in FFmpeg using “WinFF”, an awesome GUI tool for FFmpeg.

convert media using ffmpeg winff

Some Easy Useful Commands

​FFmpeg is all about the use of commands. There is a command for every operation in FFmpeg. Let me introduce you to some most widely used, easy commands.

Get Video Information

​Here is the basic command to get the information of video file using FFmpeg.
ffmpeg -i video.flv

Convert Video Files Into Audio

​Use the below commands to convert video files into simple mp3 files. Remember to open a terminal in the folder where you have stored the file to be converted.
ffmpeg -i video.flv -vn -ar 44100 -ac 2 -ab 192 -f mp3 audio.mp3
​Replace the word “video” with the name of your video.If you wish to increase quality replace 192 with 320 or your wish.
basics ffmpeg media conversion commands

Convert Images Into Video

​Want to create a quick slideshow for something special, here is the command for that work –
ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg
​Now if you want to convert the new video file into some other format, input this command to convert its format
ffmpeg -i video1.avi -s 320×240 -vcodec msmpeg4v2 video2.avi
​Replace the video name with the name of the file.

Join a Video & Audio File Together

​Just in case you created a slideshow up there and now you want to add audio to it, here is the command for that too.
ffmpeg -i audio.mp3 -i video.avi video_audio_mix.mpg
​Again remember to change the word audio and video as per the file.

Mute The Audio

​Ever wish to show a cool video to your friends but it contains some explicit language and you want to remove audio? Here is the command for that too.
ffmpeg -i video.mp4 -an mute-video.mp4
​Statutory warning: replace video name with the file.

Make a GIF From a Video

​Ever wish to create a GIF from a famous movie scene and share it on WhatsApp and FB? Here is the command to convert video into GIF.
ffmpeg -i video.mp4 -vf scale=300:-1 -t 10 -r 10 image.gif
​To scale video properly change the number 300 into appropriate and use to “t” to specify parameter and “r” to frame rate.

FFmpeg Documentation

​The above is the basic command everyone needs basically. However, if you are in requirement of a special command, you can freely visit the official documentation to take full help.

Some important tips from me to newbies to FFmpeg

​Use the right commands. If the conversion fails, check out the whole command again. Don’t miss out any space or format name. You must be in the directory where you want the conversion to be done means where the file is located. Remember to change the required contents of command as well like “video” name with the name of file etc.

Final Words

​For all newbies out there, believe me, that once you are set to use FFmpeg in command line mode, you will leave GUI. For a pro-Linux user, CLI is much better as everyday Linux job can be done through terminal. However, we fully understand that getting into roots too soon might be hard. Feel free to use GUI as long as you wish, but try to switch to CLI as not all GUI does the CLI job. If you face any difficulty while converting files or got some doubts, feel free to ask in comments. We will be glad to help.
put_update_time/6, April 2019

Leave a Reply

Your email address will not be published. Required fields are marked *

linux system administration bootcamp