Using the ffmpeg command line to convert video formats

Fast Forward MPEG (FFmpeg) is one of the most popular and best multimedia networks in the world. It provides a wealth of tools for you to play videos, convert formats, stream live streaming, and even analyze multimedia streams. These tools actually make FFmpeg a great framework. They provide you with the best technical solutions and offer users countless extremely practical free software.


FFmpeg can perform many functions. For example, you can easily convert videos from one format to another. The following is a very simple example of the command line for converting MP4 files to AVI files.

#ffmpeg –i Shawshank_Redemption.mp4 Shawshank_Redemption.avi


Various command lines for converting video formats using ffmpeg

Convert video to MPG format:

#ffmpeg –i Shawshank_Redemption.avi Shawshank_Redemption.mpg


Convert video to FLV format:

#ffmpeg –i original_video.avi –f flv final_video.flv


Convert video to Gif format:

#ffmpeg –i original_video.avi gif_uncompressed.gif


#ffmpeg -ss 60 –i original_video.avi –t 20 gif_uncompressed.gif


Convert video to DV format:

#ffmpeg –i origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dv


Convert video to Mov format:

#ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov


Convert DVD player format:

#ffmpeg –i original_video.avi –target pal-dvd –ps 1000000000 –aspect 16:9 final_video.mpeg



The following is a brief explanation of the above command line:

–aspect 16:9:The aspect ratio is 16:9, which is very suitable for widescreen.

-ps 1000000000 It is the size of the output file in bits. In this special case, it is the maximum size of the output video.

-target pal-dvd Determine the output format of the video.