ffmpeg -i movie.mov -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4

Explanation:

  • ffmpeg: Invokes the FFmpeg command-line tool.
  • -i movie.mov: Specifies the input file as movie.mov. Replace movie.mov with the actual name of your movie file.
  • -c:v libx264: Sets the video codec to libx264, which is a highly efficient and widely supported H.264 encoder. This is generally the best choice for most situations.
  • -crf 23: Sets the Constant Rate Factor (CRF) for video quality. This is a very important setting.
    • Lower CRF values (e.g., 18-23) mean higher quality (larger file size).
    • Higher CRF values (e.g., 28-35) mean lower quality (smaller file size).
    • 23 is a good starting point for a reasonably sized MP4 file. Experiment to find the best balance for your needs.
  • -c:a aac: Sets the audio codec to aac (Advanced Audio Coding). This is a good general-purpose audio codec.
  • -b:a 128k: Sets the audio bitrate to 128kbps. This is a reasonable bitrate for audio quality. You can adjust this to 192k or 256k for higher quality, but it will increase the file size.
  • output.mp4: Specifies the output file name as output.mp4. Change this to your desired output filename.

Important Considerations and Further Options:

  • Video Codec: libx264 is generally the best choice for MP4. If you need to preserve specific features of the original movie, you might consider other codecs (e.g., libx265 for better compression, but potentially lower quality).
  • Bitrate: The -b:a option controls the audio bitrate. Experiment with different values. 128k is a good starting point.
  • Resolution: You can specify the resolution (width and height) using the -s option. For example, -s 1280x720 would create a 720p (1280x720) output.
  • Frame Rate: You can specify the frame rate using the -r option. For example, -r 30 would set the frame rate to 30 frames per second.
  • Audio Channels: If your movie has multiple audio channels (e.g., 5.1), you can specify the channels using the -ac option. For example, -ac 2 would set the audio to stereo.
  • Constant Quality (CRF): Instead of a CRF value, you can use a constant quality setting. This is more complex to set up. You can find guides online for how to do this.

How to Run the Command:

  1. Install FFmpeg: If you don't have FFmpeg installed, you'll need to download and install it. You can find instructions on the FFmpeg website: https://ffmpeg.org/
  2. Open a Terminal or Command Prompt: Open your operating system's terminal or command prompt.
  3. Navigate to the Directory: Use the cd command to navigate to the directory containing movie.mov.
  4. Run the Command: Copy and paste the command from above into the terminal and press Enter.

Example with Multiple Options:

To convert movie.mov to output.mp4 with a CRF of 28, 128kbps audio, and 30 fps, you would use:

ffmpeg -i movie.mov -c:v libx264 -crf 28 -c:a aac -b:a 128k output.mp4

Remember to adjust the options to suit your specific needs and the characteristics of your movie. Experiment with the CRF value to find the best balance between quality and file size.

Edit
Pub: 24 Jun 2025 23:26 UTC
Views: 22