How to Convert Video to Grayscale using FFmpeg

  • Post category:FFmpeg

Welcome to our guide on how to convert video to grayscale using FFmpeg. Unlock the power of black and white aesthetics and enhance your video storytelling with our step-by-step instructions.

Step 1: FFmpeg Installation Check

Before we dive into the process, let’s make sure you have FFmpeg on your system. If it’s missing, you can download it from the official website or utilize our detailed installation guide.

How to Install FFmpeg in Windows

Step 2: Command Prompt or Terminal Access

Moving forward, you’ll need to open your command prompt (for Windows users) or terminal (for Mac and Linux users).

Step 3: Convert Video to Grayscale using FFmpeg

Here is a command to convert a video to grayscale using FFmpeg:

ffmpeg -i input.mp4 -vf format=gray -c:a copy output.mp4
  

Breakdown:

  • -i input.mp4 – Input video file
  • -vf format=gray – Set video filter to grayscale format
  • -c:a copy – Stream copy audio without changing
  • output.mp4 – Output grayscale video

The format filter converts pixels to grayscale. Each pixel’s R, G, and B channels are set to equal values based on luminance.

So in summary, the format video filter can apply different color effects like converting to grayscale. Audio is stream copied to avoid re-encoding.