FFmpeg - Convert MOV video to MP4

FFmpeg - Convert MOV video to MP4

FFmpeg command to convert MOV video to MP4 video:

ffmpeg -i input.mov \
    -vf "scale=-1:720" \
    -c:v libx264 \
    -crf 23 \
    -c:a aac \
    -b:a 192k \
    output.mp4

This will convert mov to mp4 by scaling the video to 720 pixels height maintaining original aspect ratio, compresses the video using libx264 codec with 23 CRF, compresses audio using aac codec with 192 kbps bitrate

  • -i input.mov: input file
  • -vf "scale=-1:720": video filter (-vf) to scale the video. The -1 automatically calculates the width to maintain the aspect ratio. Height set to 720 pixels.
  • -c:v libx264: sets video codec (-c:v) to libx264 aka encoding H.264 video.
  • -crf 23: Constant Rate Factor (-crf) method for controlling quality of video compression. Lower values for better quality but larger file sizes, and vice versa. Values range is 0–51, 0 for lossless, 23 default, and 51 worst possible quality.
  • -c:a aac: sets the audio codec (-c:a) to aac – Advanced Audio Codec.
  • -b:a 192k: sets the audio bitrate (-b:a) to 192 kilobits per second
  • output.mp4: output

20. Nov 2023