When converting video files and using containers such as Matroska, which are able to contain various types of streams, it is good to know how to set specific types of containers.Ī good command to know is the following: ffmpeg -codecs You can find these in the official FFMPEG documentation. It is important to note that FFMPEG may not always be able to guess the container format correctly, especially when using a less commonly used format such as MKV, which is designed to contain various types of streams, therefore when proceeding with such a conversion, you may have the same input file stream types in the output file, unless you specify the exact parameters.
If you would like to convert a video file using Microsoft’s format Audio Video Interleave or AVI into an MP4 file, use the following command: ffmpeg -i video.avi video.mp4
Regarding the container selection in this particular example, FFMPEG selects the codecs for you.Īs you may have already guessed, regarding the conversion of a video file it is a similar procedure. This particular conversion can reduce the original file size. Let’s say that we would like to convert a WAV file, we can easily do that by issuing the following command: ffmpeg -i audio.wav audio.mp3įrom the perspective of FFMPEG, this involves converting a Waveform Audio File which is an audio standard developed by Microsoft, into an MP3 stream. The command line interface of FFMPEG is quite intuitive and it is relatively simple to convert an audio or video file, though depending on the size of the file there may be a difference in the actual time taken when converting from one format to another. Due to it’s good compression capabilities, it is a good choice in terms of the overall output size of the converted video file when compared to other codecs such as MPEG-4. A significant advantage of the H.264 codec is that it was designed to provide the transmission of high quality video with less bandwidth over the internet. Each codec presents a range of advantages and disadvantages, for instance in terms of audio, a useful codec is FLAC, which stands for “Free Lossless Audio Codec”, and it is particularly good for storing lossless audio of very high quality.
Video and audio files are encoded using a codec such as H.264 for video or AAC for audio. An example of a container with such capabilities is Matroska or MKV. This is particularly useful when a video has multiple audio tracks in different languages as this can enable switching between them. Certain types of containers have different capabilities, such as storing subtitles or more than one audio stream inside a container, as well as a range of other types of metadata such as chapters. Multimedia files which FFMPEG is able to process typically consist of a container with audio and video streams. FFMPEG can be downloaded from the official FFMPEG website and it can also be downloaded using a package manager such as APT. In this tutorial we will outline the basic functionality of FFMPEG, however, it is important to consider that this is only a small portion of the FFMPEG project. Using FFMPEG to convert audio and video formats 2020.05.11įFMPEG is a powerful open-source tool you can use to handle various multimedia files.