Forrest logo
back to the ffmpeg tool

ffmpeg:tldr:26962

ffmpeg: Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23.
$ ffmpeg -i ${input_video}.avi -codec:a aac -b:a 128k -codec:v libx264 -crf 23 ${output_video}.mp4
try on your machine

This command is using the FFmpeg software to convert a video file from avi format to mp4 format. Let's break down the command:

  • ffmpeg is the command used to invoke the FFmpeg software.
  • -i ${input_video}.avi specifies the input file. ${input_video} is a variable, so the actual input file name would be substituted in its place. It assumes that the input video file is in the avi format.
  • -codec:a aac specifies the audio codec to be used for the output file. In this case, the Advanced Audio Codec (AAC) is chosen.
  • -b:a 128k sets the audio bitrate to 128 kilobits per second. It determines the audio quality in the output file.
  • -codec:v libx264 specifies the video codec to be used for the output file. Here, the libx264 codec is selected, which is a widely used and efficient video codec.
  • -crf 23 sets the Constant Rate Factor (CRF) value. The CRF determines the video quality and compression level. A lower value results in better quality and larger file size, while a higher value decreases quality and reduces file size. CRF 23 is a moderate setting.
  • ${output_video}.mp4 specifies the name and format of the output file. Again, ${output_video} is a variable, so the actual output file name would be substituted in its place. It assumes that the output video file should be in the mp4 format.
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ffmpeg tool