In this article, we will take a look at the FFmpeg command line syntax. We will explore all the options made available in the FFmpeg tool while using it to transform one or more input video files.
But before we take a look at the syntax for FFmpeg commands, let us first try to understand what an FFmpeg command line tool is.
What Is An FFmpeg Command Line Tool?
FFMpeg is an open source command line tool used for multimedia file processing.
So now that looks like quite a complicated and technically rich definition. But what it really means is that we can use the FFmpeg tool to encode or decode audio or video files at a high speed and quality. But not just that, FFmpeg also helps us in achieving these at a very small file size.
So in general, we can say that FFmpeg is an efficient media file processing tool that is also open source!
What does FFmpeg stands for?
FFmpeg stands for Fast Forward Moving Pictures Expert Group.
But generally when we talk about FFmpeg, we talk about a library of tools that goes along with FFmpeg tool in video or audio file processing. So, this FFmpeg library is generally made up of these command line tools and libraries.
List Of FFmpeg Software Library
|ffmpeg||Command line tool||Fast audio and video encoder/decoder|
|ffplay||Command line tool||Media Player|
|ffserver||Command line tool||HTTP or RTSP based multimedia streaming server|
|ffprobe||Command line tool||Displays Media file information|
|libavcodec||FFmpeg software library||Contains various multimedia codec|
|libavdevice||FFmpeg software library||Library for various device handling|
|libavutil||FFmpeg software library||Contains a bunch of multimedia utilities|
|libavformat||FFmpeg software library||Contains various media formats|
|libavfilter||FFmpeg software library||Contains various filters|
|libswscale||FFmpeg software library||Used for media scaling|
|libswresample||FFmpeg software library||Used for audio resampling|
|libpostproc||FFmpeg software library||Used for post processing|
So now that we know what an FFmpeg tool is and its associated set of software libraries, let us take a look at the syntax for using FFmpeg tool.
FFmpeg Command Line Syntax
FFmpeg is a command line tool that comes with a highly complex set of options available to pass as both input and output parameters. So as a result it’s generic syntactical structure will also look quite complex at the first glance. Here is how a generic ffmpeg command syntax looks like:
ffmpeg global_options input1_options -i input1 input2_options -i input2....output1_options output1 output2_options output2
But do not worry for looking that complex, as we can easily understand what it does by breaking it down to simpler parts.
- global_options: So this option set will affect all inputs and outputs.
- inputx_options: But this will affect the specific input x.
- outputx_options: This will affect the specific output x.
So as you can see, we can pass certain options that are applicable to all or specific inputs and outputs.
So now that we have seen how a generic ffmpeg command looks like, let us take a look at how it is used using an example:
ffmpeg -y -i vidIn.mp4 -s vga vidOut.mp4
In the above example, the option “-y” passed initially is a global option, but the option “-s vga” passed before the output file name is an output specific option.
So there you have it! That is how a generic ffmpeg syntax looks like. But this may still be very looking very theoretical to you. So in the next article, we will take a look at all the available options that can be passed to both inputs and outputs in the next tutorial. But for now, this should give you a good idea on how FFmpeg command works.
But if you still have any doubts regarding this tutorial, do let me know in the comments below and I will be happy to answer them. So until next time, take care!
But before you go, do you want to know how to edit videos for WhatsApp? Check this out!